Skip to content

Commit

Permalink
[doodstream] more robust auth_url
Browse files Browse the repository at this point in the history
  • Loading branch information
schnusch committed Apr 30, 2021
1 parent 847a646 commit 7c6d532
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions youtube_dl/extractor/doodstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ def _real_extract(self, url):
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))
Expand Down

0 comments on commit 7c6d532

Please sign in to comment.