mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-01-30 10:42:05 +00:00
[cleanup] Misc fixes
Closes #3565, https://github.com/yt-dlp/yt-dlp/issues/3514#issuecomment-1105944364
This commit is contained in:
@@ -1922,8 +1922,7 @@ class InfoExtractor:
|
||||
def _sort_formats(self, formats, field_preference=[]):
|
||||
if not formats:
|
||||
return
|
||||
format_sort = self.FormatSort(self, field_preference)
|
||||
formats.sort(key=lambda f: format_sort.calculate_preference(f))
|
||||
formats.sort(key=self.FormatSort(self, field_preference).calculate_preference)
|
||||
|
||||
def _check_formats(self, formats, video_id):
|
||||
if formats:
|
||||
|
||||
@@ -17,7 +17,7 @@ class FujiTVFODPlus7IE(InfoExtractor):
|
||||
'url': 'https://fod.fujitv.co.jp/title/5d40/5d40110076',
|
||||
'info_dict': {
|
||||
'id': '5d40110076',
|
||||
'ext': 'mp4',
|
||||
'ext': 'ts',
|
||||
'title': '#1318 『まる子、まぼろしの洋館を見る』の巻',
|
||||
'series': 'ちびまる子ちゃん',
|
||||
'series_id': '5d40',
|
||||
@@ -28,7 +28,7 @@ class FujiTVFODPlus7IE(InfoExtractor):
|
||||
'url': 'https://fod.fujitv.co.jp/title/5d40/5d40810083',
|
||||
'info_dict': {
|
||||
'id': '5d40810083',
|
||||
'ext': 'mp4',
|
||||
'ext': 'ts',
|
||||
'title': '#1324 『まる子とオニの子』の巻/『結成!2月をムダにしない会』の巻',
|
||||
'description': 'md5:3972d900b896adc8ab1849e310507efa',
|
||||
'series': 'ちびまる子ちゃん',
|
||||
@@ -51,7 +51,7 @@ class FujiTVFODPlus7IE(InfoExtractor):
|
||||
for src in src_json['video_selector']:
|
||||
if not src.get('url'):
|
||||
continue
|
||||
fmt, subs = self._extract_m3u8_formats_and_subtitles(src['url'], video_id, 'mp4')
|
||||
fmt, subs = self._extract_m3u8_formats_and_subtitles(src['url'], video_id, 'ts')
|
||||
for f in fmt:
|
||||
f.update(dict(zip(('height', 'width'),
|
||||
self._BITRATE_MAP.get(f.get('tbr'), ()))))
|
||||
|
||||
@@ -242,6 +242,9 @@ class FunimationIE(FunimationBaseIE):
|
||||
'language_preference': language_preference(lang.lower()),
|
||||
})
|
||||
formats.extend(current_formats)
|
||||
if not formats and (requested_languages or requested_versions):
|
||||
self.raise_no_formats(
|
||||
'There are no video formats matching the requested languages/versions', expected=True, video_id=display_id)
|
||||
self._remove_duplicate_formats(formats)
|
||||
self._sort_formats(formats, ('lang', 'source'))
|
||||
|
||||
|
||||
@@ -3107,7 +3107,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||
'n': self._decrypt_nsig(query['n'][0], video_id, player_url)})
|
||||
except ExtractorError as e:
|
||||
self.report_warning(
|
||||
f'nsig extraction failed: You may experience throttling for some formats\n'
|
||||
'nsig extraction failed: You may experience throttling for some formats\n'
|
||||
f'n = {query["n"][0]} ; player = {player_url}\n{e}', only_once=True)
|
||||
throttled = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user