aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorPetr Půlpán <Pulpan3@gmail.com>2014-06-26 07:35:47 +0200
committerPetr Půlpán <Pulpan3@gmail.com>2014-06-26 07:35:47 +0200
commitd410fee91d90ebd030fe69148befc0358a07ed2d (patch)
tree86c4301ebf63ca3ebcd59892d796d629ba7f38bf /youtube_dl
parentba7aa464de0a0a6596eb5334b7e2491a03dfbc92 (diff)
[VideoTt] fix ValueError (#3161)
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/videott.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/youtube_dl/extractor/videott.py b/youtube_dl/extractor/videott.py
index b5034b02f..a647807d0 100644
--- a/youtube_dl/extractor/videott.py
+++ b/youtube_dl/extractor/videott.py
@@ -4,7 +4,10 @@ import re
import base64
from .common import InfoExtractor
-from ..utils import unified_strdate
+from ..utils import (
+ unified_strdate,
+ int_or_none,
+)
class VideoTtIE(InfoExtractor):
@@ -50,9 +53,9 @@ class VideoTtIE(InfoExtractor):
'thumbnail': settings['config']['thumbnail'],
'upload_date': unified_strdate(video['added']),
'uploader': video['owner'],
- 'view_count': int(video['view_count']),
- 'comment_count': int(video['comment_count']),
- 'like_count': int(video['liked']),
- 'dislike_count': int(video['disliked']),
+ 'view_count': int_or_none(video['view_count']),
+ 'comment_count': None if video.get('comment_count') == '--' else int_or_none(video['comment_count']),
+ 'like_count': int_or_none(video['liked']),
+ 'dislike_count': int_or_none(video['disliked']),
'formats': formats,
} \ No newline at end of file