mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-25 00:00:48 +01:00
parent
bfec31bec8
commit
07689fc149
@ -1,4 +1,5 @@
|
|||||||
import random
|
import random
|
||||||
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
@ -19,6 +20,7 @@ class RedditIE(InfoExtractor):
|
|||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'zv89llsvexdz',
|
'id': 'zv89llsvexdz',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
|
'display_id': '6rrwyj',
|
||||||
'title': 'That small heart attack.',
|
'title': 'That small heart attack.',
|
||||||
'thumbnail': r're:^https?://.*\.(?:jpg|png)',
|
'thumbnail': r're:^https?://.*\.(?:jpg|png)',
|
||||||
'thumbnails': 'count:4',
|
'thumbnails': 'count:4',
|
||||||
@ -158,6 +160,15 @@ def add_thumbnail(src):
|
|||||||
'duration': int_or_none(reddit_video.get('duration')),
|
'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
|
# Not hosted on reddit, must continue extraction
|
||||||
return {
|
return {
|
||||||
**info,
|
**info,
|
||||||
|
Loading…
Reference in New Issue
Block a user