diff options
-rwxr-xr-x | artetv_dl/__main__.py | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/artetv_dl/__main__.py b/artetv_dl/__main__.py index 814b2f1..8e6c759 100755 --- a/artetv_dl/__main__.py +++ b/artetv_dl/__main__.py @@ -16,19 +16,9 @@ def main(): url = sys.argv[1] - content = urlopen(url) - - soup = BeautifulSoup(content, "lxml") - - iframes = soup.find_all("iframe") - - url = "" - - for iframe in iframes: - url = unquote(iframe['src']) + programId = re.findall('[0-9A-Z]{6}-[0-9A-Z]{3}-[0-9A-Z]', url)[0] - url = re.split("url=",url)[1] - url = re.split("\?autostart", url)[0] + url = "https://api.arte.tv/api/player/v1/config/en/{}".format(programId) content = urlopen(url) json_data = json.loads(content.read().decode()) |