mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-08-16 18:28:33 -04:00
Compare commits
3 Commits
9ebac35577
...
376aa24b15
Author | SHA1 | Date | |
---|---|---|---|
|
376aa24b15 | ||
|
c9d14bd22a | ||
|
149eb0bbf3 |
@ -2810,10 +2810,14 @@ class YoutubeDL:
|
||||
self.params.get('subtitleslangs'), {'all': all_sub_langs}, use_regex=True)
|
||||
except re.error as e:
|
||||
raise ValueError(f'Wrong regex for subtitlelangs: {e.pattern}')
|
||||
elif normal_sub_langs:
|
||||
requested_langs = ['en'] if 'en' in normal_sub_langs else normal_sub_langs[:1]
|
||||
else:
|
||||
requested_langs = ['en'] if 'en' in all_sub_langs else all_sub_langs[:1]
|
||||
requested_langs = LazyList(itertools.chain(
|
||||
['en'] if 'en' in normal_sub_langs else [],
|
||||
filter(lambda f: f.startswith('en'), normal_sub_langs),
|
||||
['en'] if 'en' in all_sub_langs else [],
|
||||
filter(lambda f: f.startswith('en'), all_sub_langs),
|
||||
normal_sub_langs, all_sub_langs,
|
||||
))[:1]
|
||||
if requested_langs:
|
||||
self.to_screen(f'[info] {video_id}: Downloading subtitles: {", ".join(requested_langs)}')
|
||||
|
||||
|
@ -160,7 +160,7 @@ class CrunchyrollBetaIE(CrunchyrollBaseIE):
|
||||
episode_response = self._download_json(
|
||||
f'{api_domain}/cms/v2{bucket}/episodes/{internal_id}', display_id,
|
||||
note='Retrieving episode metadata', query=params)
|
||||
if episode_response.get('is_premium_only') and not episode_response.get('playback'):
|
||||
if episode_response.get('is_premium_only') and not bucket.endswith('crunchyroll'):
|
||||
if self.is_logged_in:
|
||||
raise ExtractorError('This video is for premium members only', expected=True)
|
||||
else:
|
||||
|
@ -4120,7 +4120,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||
'thumbnail': traverse_obj(original_thumbnails, (-1, 'url')),
|
||||
'description': video_description,
|
||||
'uploader': get_first(video_details, 'author'),
|
||||
'uploader_id': self._search_regex(r'/(?:channel|user)/([^/?&#]+)', owner_profile_url, 'uploader id') if owner_profile_url else None,
|
||||
'uploader_id': self._search_regex(r'/(?:channel/|user/|@)([^/?&#]+)', owner_profile_url, 'uploader id', default=None),
|
||||
'uploader_url': owner_profile_url,
|
||||
'channel_id': channel_id,
|
||||
'channel_url': format_field(channel_id, None, 'https://www.youtube.com/channel/%s'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user