[youtube] Make duration an integer or None
authorPhilipp Hagemeister <phihag@phihag.de>
Mon, 16 Dec 2013 03:09:05 +0000 (04:09 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Mon, 16 Dec 2013 03:09:05 +0000 (04:09 +0100)
youtube_dl/extractor/youtube.py

index 874429b78cc4917ca1cbbec7245c85436dd73783..a68a214cabe5e9f020fa1ee818b31d0943b2b0fb 100644 (file)
@@ -1377,9 +1377,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
 
         if 'length_seconds' not in video_info:
             self._downloader.report_warning(u'unable to extract video duration')
-            video_duration = ''
+            video_duration = None
         else:
-            video_duration = compat_urllib_parse.unquote_plus(video_info['length_seconds'][0])
+            video_duration = int(compat_urllib_parse.unquote_plus(video_info['length_seconds'][0]))
 
         # annotations
         video_annotations = None