diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-04-29 05:57:50 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-04-29 07:41:39 +0530 |
commit | 07689fc149698d74368eeccfe583824a963b973d (patch) | |
tree | f76a9de8cb0c5f0105361bab2cfc559c64e59245 | |
parent | bfec31bec8bff7d5ca0625a52359b48517089430 (diff) | |
download | hypervideo-pre-07689fc149698d74368eeccfe583824a963b973d.tar.lz hypervideo-pre-07689fc149698d74368eeccfe583824a963b973d.tar.xz hypervideo-pre-07689fc149698d74368eeccfe583824a963b973d.zip |
[reddit] Prevent infinite loop
Closes #3588
-rw-r--r-- | yt_dlp/extractor/reddit.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/yt_dlp/extractor/reddit.py b/yt_dlp/extractor/reddit.py index a042a59cc..aabc8dba9 100644 --- a/yt_dlp/extractor/reddit.py +++ b/yt_dlp/extractor/reddit.py @@ -1,4 +1,5 @@ import random +from urllib.parse import urlparse from .common import InfoExtractor from ..utils import ( @@ -19,6 +20,7 @@ class RedditIE(InfoExtractor): 'info_dict': { 'id': 'zv89llsvexdz', 'ext': 'mp4', + 'display_id': '6rrwyj', 'title': 'That small heart attack.', 'thumbnail': r're:^https?://.*\.(?:jpg|png)', 'thumbnails': 'count:4', @@ -158,6 +160,15 @@ class RedditIE(InfoExtractor): 'duration': int_or_none(reddit_video.get('duration')), } + parsed_url = urlparse(video_url) + if parsed_url.netloc == 'v.redd.it': + self.raise_no_formats('This video is processing', expected=True, video_id=video_id) + return { + **info, + 'id': parsed_url.path.split('/')[1], + 'display_id': video_id, + } + # Not hosted on reddit, must continue extraction return { **info, |