mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-09-08 07:26:09 +02:00
[mtg] Improve view count extraction
This commit is contained in:
parent
b35b0d73d8
commit
502d87c546
@ -15,6 +15,7 @@
|
|||||||
int_or_none,
|
int_or_none,
|
||||||
parse_iso8601,
|
parse_iso8601,
|
||||||
qualities,
|
qualities,
|
||||||
|
try_get,
|
||||||
update_url_query,
|
update_url_query,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -203,6 +204,11 @@ class TVPlayIE(InfoExtractor):
|
|||||||
'url': 'http://tvplay.skaties.lv/parraides/vinas-melo-labak/418113?autostart=true',
|
'url': 'http://tvplay.skaties.lv/parraides/vinas-melo-labak/418113?autostart=true',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
# views is null
|
||||||
|
'url': 'http://tvplay.skaties.lv/parraides/tv3-zinas/760183',
|
||||||
|
'only_matching': True,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'url': 'http://tv3play.tv3.ee/sisu/kodu-keset-linna/238551?autostart=true',
|
'url': 'http://tv3play.tv3.ee/sisu/kodu-keset-linna/238551?autostart=true',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
@ -306,7 +312,7 @@ def _real_extract(self, url):
|
|||||||
'season_number': season_number,
|
'season_number': season_number,
|
||||||
'duration': int_or_none(video.get('duration')),
|
'duration': int_or_none(video.get('duration')),
|
||||||
'timestamp': parse_iso8601(video.get('created_at')),
|
'timestamp': parse_iso8601(video.get('created_at')),
|
||||||
'view_count': int_or_none(video.get('views', {}).get('total')),
|
'view_count': try_get(video, lambda x: x['views']['total'], int),
|
||||||
'age_limit': int_or_none(video.get('age_limit', 0)),
|
'age_limit': int_or_none(video.get('age_limit', 0)),
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'subtitles': subtitles,
|
'subtitles': subtitles,
|
||||||
|
Loading…
Reference in New Issue
Block a user