]> jfr.im git - yt-dlp.git/commitdiff
[extractor/redgifs] Fix extractors
authorpukkandan <redacted>
Wed, 19 Oct 2022 21:16:28 +0000 (02:46 +0530)
committerpukkandan <redacted>
Wed, 19 Oct 2022 21:18:49 +0000 (02:48 +0530)
Closes #5202, closes #5216

yt_dlp/extractor/redgifs.py

index 3181cd409c630feadf127772a9a020b0f9c86775..1f4d04903f8432741882efdd2effc11c47d33973 100644 (file)
@@ -65,10 +65,12 @@ def _parse_gif_data(self, gif_data):
 
     def _fetch_oauth_token(self, video_id):
         # These pages contain the OAuth token that is necessary to make API calls.
-        index_page = self._download_webpage(f'https://www.redgifs.com/watch/{video_id}', video_id)
+        index_page = self._download_webpage(
+            'https://www.redgifs.com', video_id, note='Downloading home page')
         index_js_uri = self._html_search_regex(
             r'href="?(/assets/js/index[.a-z0-9]*.js)"?\W', index_page, 'index_js_uri')
-        index_js = self._download_webpage(f'https://www.redgifs.com/{index_js_uri}', video_id)
+        index_js = self._download_webpage(
+            f'https://www.redgifs.com/{index_js_uri}', video_id, note='Downloading index.js')
         # It turns out that a { followed by any valid JSON punctuation will always result in the
         # first two characters of the base64 encoding being "ey".
         # Use this fact to find any such string constant of a reasonable length with the correct