]> Raphaƫl G. Git Repositories - youtubedl/blobdiff - youtube_dl/extractor/videott.py
Imported Upstream version 2014.10.30
[youtubedl] / youtube_dl / extractor / videott.py
index b5034b02f9bb352ad7bb081995ad3e9963c98088..a647807d01f8b3e5a2ed3eab99acc545533327d4 100644 (file)
@@ -4,7 +4,10 @@ import re
 import base64
 
 from .common import InfoExtractor
 import base64
 
 from .common import InfoExtractor
-from ..utils import unified_strdate
+from ..utils import (
+    unified_strdate,
+    int_or_none,
+)
 
 
 class VideoTtIE(InfoExtractor):
 
 
 class VideoTtIE(InfoExtractor):
@@ -50,9 +53,9 @@ class VideoTtIE(InfoExtractor):
             'thumbnail': settings['config']['thumbnail'],
             'upload_date': unified_strdate(video['added']),
             'uploader': video['owner'],
             '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
             'formats': formats,
         }
\ No newline at end of file