aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-08-17 00:32:28 +0700
committerSergey M․ <dstftw@gmail.com>2016-08-17 00:32:28 +0700
commit502d87c5464f1894a8777873b9d11b76ba5a6375 (patch)
treedbc4b2870dd365c903526ddd8b5241e2e039b6f4 /youtube_dl
parentb35b0d73d853c52ca96ccf4488a4f8960a12e2ae (diff)
[mtg] Improve view count extraction
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/tvplay.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/youtube_dl/extractor/tvplay.py b/youtube_dl/extractor/tvplay.py
index c8ec2465c..4186e82db 100644
--- a/youtube_dl/extractor/tvplay.py
+++ b/youtube_dl/extractor/tvplay.py
@@ -15,6 +15,7 @@ from ..utils import (
int_or_none,
parse_iso8601,
qualities,
+ try_get,
update_url_query,
)
@@ -204,6 +205,11 @@ class TVPlayIE(InfoExtractor):
'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',
'only_matching': True,
},
@@ -306,7 +312,7 @@ class TVPlayIE(InfoExtractor):
'season_number': season_number,
'duration': int_or_none(video.get('duration')),
'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)),
'formats': formats,
'subtitles': subtitles,