Explorar el Código

[vimple] Do not fail if duration is missing

Philipp Hagemeister hace 11 años
padre
commit
45ead916d1
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      youtube_dl/extractor/vimple.py

+ 3 - 1
youtube_dl/extractor/vimple.py

@@ -1,11 +1,13 @@
 # coding: utf-8
 # coding: utf-8
 from __future__ import unicode_literals
 from __future__ import unicode_literals
+
 import re
 import re
 import zlib
 import zlib
 import base64
 import base64
 import xml.etree.ElementTree
 import xml.etree.ElementTree
 
 
 from .common import InfoExtractor
 from .common import InfoExtractor
+from ..utils import int_or_none
 
 
 
 
 class VimpleIE(InfoExtractor):
 class VimpleIE(InfoExtractor):
@@ -79,6 +81,6 @@ class VimpleIE(InfoExtractor):
             'title': video.find('Title').text,
             'title': video.find('Title').text,
             'formats': formats,
             'formats': formats,
             'thumbnail': video.find('Poster').get('url'),
             'thumbnail': video.find('Poster').get('url'),
-            'duration': int(video.get('duration')),
+            'duration': int_or_none(video.get('duration')),
             'webpage_url': video.find('Share').get('videoPageUrl'),
             'webpage_url': video.find('Share').get('videoPageUrl'),
         }
         }