]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[francetv] Fix duration
authorSergey M․ <dstftw@gmail.com>
Sat, 4 Apr 2015 16:52:25 +0000 (22:52 +0600)
committerSergey M․ <dstftw@gmail.com>
Sat, 4 Apr 2015 16:52:25 +0000 (22:52 +0600)
youtube_dl/extractor/francetv.py

index 55b8e9d9ea09439ae71086b35c6db119b4398242..0d92ef9c4533ee87a392d3db34ed801d2140da25 100644 (file)
@@ -14,6 +14,7 @@ from ..utils import (
     clean_html,
     ExtractorError,
     int_or_none,
+    float_or_none,
     parse_duration,
 )
 
@@ -86,7 +87,7 @@ class FranceTVBaseInfoExtractor(InfoExtractor):
             'title': info['titre'],
             'description': clean_html(info['synopsis']),
             'thumbnail': compat_urlparse.urljoin('http://pluzz.francetv.fr', info['image']),
-            'duration': parse_duration(info['duree']),
+            'duration': float_or_none(info.get('real_duration'), 1000) or parse_duration(info['duree']),
             'timestamp': int_or_none(info['diffusion']['timestamp']),
             'formats': formats,
         }