mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-20 05:47:24 +01:00
float_or_none: use partial_application
This commit is contained in:
parent
6c6d75be16
commit
0a05711805
@ -51,6 +51,7 @@ def _real_extract(self, url):
|
||||
if self._yes_playlist(playlist_id, video_id) and unsmuggled_data.get('extract_playlist') is not False:
|
||||
return self.playlist_result(
|
||||
(self.url_result(
|
||||
# it may be better to use self.cache for storing device_id
|
||||
smuggle_url(f'https://ani.gamer.com.tw/animeVideo.php?sn={ep["videoSn"]}', {
|
||||
'extract_playlist': False,
|
||||
'device_id': device_id,
|
||||
@ -67,7 +68,7 @@ def _real_extract(self, url):
|
||||
'thumbnail': 'cover',
|
||||
'title': 'title',
|
||||
'timestamp': ('upTime', {unified_timestamp}),
|
||||
'duration': ('duration', {float_or_none}, {lambda x: x * 60}),
|
||||
'duration': ('duration', {float_or_none(scale=60)}),
|
||||
'age_limit': ('rating', {lambda x: self.RATING_TO_AGE_LIMIT.get(x)}),
|
||||
})))
|
||||
|
||||
@ -91,6 +92,7 @@ def _real_extract(self, url):
|
||||
raise ExtractorError('Invalid device id!')
|
||||
elif error_code == 1017:
|
||||
self.raise_login_required()
|
||||
|
||||
raise ExtractorError(traverse_obj(m3u8_info, ('error', 'message'))
|
||||
or 'Failed to download m3u8 URL')
|
||||
|
||||
@ -102,7 +104,5 @@ def _real_extract(self, url):
|
||||
'Origin': 'https://ani.gamer.com.tw',
|
||||
**self.geo_verification_headers(),
|
||||
}),
|
||||
'http_headers': {
|
||||
'Origin': 'https://ani.gamer.com.tw',
|
||||
},
|
||||
'http_headers': {'Origin': 'https://ani.gamer.com.tw'},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user