aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-10-20 02:46:28 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-10-20 02:48:49 +0530
commitf47cf86eff47accf47082f88583ef25cdae18467 (patch)
tree5c3ac499d2b2d5a9b86449e84336e068e4d1a566
parent7a26ce2641c45b561dde190e2eb92b7d923ca5de (diff)
downloadhypervideo-pre-f47cf86eff47accf47082f88583ef25cdae18467.tar.lz
hypervideo-pre-f47cf86eff47accf47082f88583ef25cdae18467.tar.xz
hypervideo-pre-f47cf86eff47accf47082f88583ef25cdae18467.zip
[extractor/redgifs] Fix extractors
Closes #5202, closes #5216
-rw-r--r--yt_dlp/extractor/redgifs.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/yt_dlp/extractor/redgifs.py b/yt_dlp/extractor/redgifs.py
index 3181cd409..1f4d04903 100644
--- a/yt_dlp/extractor/redgifs.py
+++ b/yt_dlp/extractor/redgifs.py
@@ -65,10 +65,12 @@ class RedGifsBaseInfoExtractor(InfoExtractor):
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