mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-06-28 01:18:30 +00:00
Replace v.redd.it URLs with corresponding onion URLs
This commit is contained in:
parent
87b15458f3
commit
739c772b84
@ -295,7 +295,7 @@ def _real_initialize(self):
|
|||||||
|
|
||||||
def _get_subtitles(self, video_id):
|
def _get_subtitles(self, video_id):
|
||||||
# Fallback if there were no subtitles provided by DASH or HLS manifests
|
# Fallback if there were no subtitles provided by DASH or HLS manifests
|
||||||
caption_url = f'https://v.redd.it/{video_id}/wh_ben_en.vtt'
|
caption_url = f'https://v.reddittorjg6rue252oqsxryoxengawnmo46qy4kyii5wtqnwfj4ooad.onion/{video_id}/wh_ben_en.vtt'
|
||||||
if self._is_valid_url(caption_url, video_id, item='subtitles'):
|
if self._is_valid_url(caption_url, video_id, item='subtitles'):
|
||||||
return {'en': [{'url': caption_url}]}
|
return {'en': [{'url': caption_url}]}
|
||||||
|
|
||||||
@ -406,8 +406,8 @@ def add_thumbnail(src):
|
|||||||
r'https?://v\.redd\.it/(?P<id>[^/?#&]+)', reddit_video['fallback_url'],
|
r'https?://v\.redd\.it/(?P<id>[^/?#&]+)', reddit_video['fallback_url'],
|
||||||
'video_id', default=display_id)
|
'video_id', default=display_id)
|
||||||
|
|
||||||
dash_playlist_url = playlist_urls[0] or f'https://v.redd.it/{video_id}/DASHPlaylist.mpd'
|
dash_playlist_url = playlist_urls[0] or f'https://v.reddittorjg6rue252oqsxryoxengawnmo46qy4kyii5wtqnwfj4ooad.onion/{video_id}/DASHPlaylist.mpd'
|
||||||
hls_playlist_url = playlist_urls[1] or f'https://v.redd.it/{video_id}/HLSPlaylist.m3u8'
|
hls_playlist_url = playlist_urls[1] or f'https://v.reddittorjg6rue252oqsxryoxengawnmo46qy4kyii5wtqnwfj4ooad.onion/{video_id}/HLSPlaylist.m3u8'
|
||||||
qs = traverse_obj(parse_qs(hls_playlist_url), {
|
qs = traverse_obj(parse_qs(hls_playlist_url), {
|
||||||
'f': ('f', 0, {lambda x: ','.join([x, 'subsAll']) if x else 'hd,subsAll'}),
|
'f': ('f', 0, {lambda x: ','.join([x, 'subsAll']) if x else 'hd,subsAll'}),
|
||||||
})
|
})
|
||||||
@ -441,7 +441,7 @@ def add_thumbnail(src):
|
|||||||
'duration': int_or_none(reddit_video.get('duration')),
|
'duration': int_or_none(reddit_video.get('duration')),
|
||||||
}
|
}
|
||||||
|
|
||||||
if parsed_url.netloc == 'v.redd.it':
|
if parsed_url.netloc == 'v.reddittorjg6rue252oqsxryoxengawnmo46qy4kyii5wtqnwfj4ooad.onion':
|
||||||
self.raise_no_formats('This video is processing', expected=True, video_id=video_id)
|
self.raise_no_formats('This video is processing', expected=True, video_id=video_id)
|
||||||
return {
|
return {
|
||||||
**info,
|
**info,
|
||||||
|
Loading…
Reference in New Issue
Block a user