From 7c6d532803a30b26714a1897ad4f1584f305ccdb Mon Sep 17 00:00:00 2001 From: schnusch Date: Sat, 24 Apr 2021 22:22:06 +0200 Subject: [PATCH] [doodstream] more robust auth_url --- youtube_dl/extractor/doodstream.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/doodstream.py b/youtube_dl/extractor/doodstream.py index cfc5ebafd..7337d87c5 100644 --- a/youtube_dl/extractor/doodstream.py +++ b/youtube_dl/extractor/doodstream.py @@ -73,8 +73,11 @@ class DoodStreamIE(InfoExtractor): title = video_id token = self._html_search_regex(r'[?&]token=([a-z0-9]+)[&\']', webpage, 'token') - auth_url = 'https://dood.to' + self._html_search_regex( - r'(/pass_md5.*?)\'', webpage, 'pass_md5') + auth_url = self._html_search_regex(r"('/pass_md5.*?')", webpage, + 'pass_md5') + auth_url = self._parse_json(auth_url, video_id, + transform_source=js_to_json) + auth_url = urljoin(url, auth_url) webpage = self._download_webpage(auth_url, video_id, headers=referer) final_url = webpage + ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(10)) + "?token=" + token + "&expiry=" + str(int(time.time() * 1000))