]> jfr.im git - yt-dlp.git/blobdiff - youtube_dl/extractor/francetv.py
[francetv] Restore support for jt videos
[yt-dlp.git] / youtube_dl / extractor / francetv.py
index 8274001720e297ce3591be332d5d72ab73e5f960..11db6d9216c1f741cb4cef5661fe5eed8664b406 100644 (file)
@@ -14,7 +14,6 @@
     clean_html,
     ExtractorError,
     int_or_none,
-    float_or_none,
     parse_duration,
     determine_ext,
 )
@@ -59,9 +58,8 @@ def _extract_video(self, video_id, catalogue):
                     # See https://github.com/rg3/youtube-dl/issues/3963
                     # m3u8 urls work fine
                     continue
-                video_url_parsed = compat_urllib_parse_urlparse(video_url)
                 f4m_url = self._download_webpage(
-                    'http://hdfauth.francetv.fr/esi/TA?url=%s' % video_url_parsed.path,
+                    'http://hdfauth.francetv.fr/esi/TA?url=%s' % video_url,
                     video_id, 'Downloading f4m manifest token', fatal=False)
                 if f4m_url:
                     formats.extend(self._extract_f4m_formats(f4m_url, video_id, 1, format_id))
@@ -87,7 +85,7 @@ def _extract_video(self, video_id, catalogue):
             'title': info['titre'],
             'description': clean_html(info['synopsis']),
             'thumbnail': compat_urlparse.urljoin('http://pluzz.francetv.fr', info['image']),
-            'duration': float_or_none(info.get('real_duration'), 1000) or parse_duration(info['duree']),
+            'duration': int_or_none(info.get('real_duration')) or parse_duration(info['duree']),
             'timestamp': int_or_none(info['diffusion']['timestamp']),
             'formats': formats,
         }
@@ -166,7 +164,8 @@ class FranceTVIE(FranceTVBaseInfoExtractor):
                             (?:www\.)?france[2345o]\.fr/
                                 (?:
                                     emissions/[^/]+/(?:videos|diffusions)?|
-                                    videos
+                                    videos|
+                                    jt
                                 )
                             /|
                             embed\.francetv\.fr/\?ue=
@@ -250,6 +249,7 @@ class FranceTVIE(FranceTVBaseInfoExtractor):
                 'description': 'md5:',
                 'upload_date': '20150226',
                 'timestamp': 1424989860,
+                'duration': 5400,
             },
         },
         {