aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/francetv.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-04-04 23:02:04 +0600
committerSergey M․ <dstftw@gmail.com>2015-04-04 23:02:04 +0600
commitbc03228ab52672666b79c9fadfbf886f8d8bf5d0 (patch)
tree1079a66ca36481f11c320fc901048c58c754f26d /youtube_dl/extractor/francetv.py
parentf05d0e73c6d38d86393f8f552fbfcdda80f37607 (diff)
[francetv] Improve formats extraction
Diffstat (limited to 'youtube_dl/extractor/francetv.py')
-rw-r--r--youtube_dl/extractor/francetv.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/youtube_dl/extractor/francetv.py b/youtube_dl/extractor/francetv.py
index 0d92ef9c4..fd3e7aa7b 100644
--- a/youtube_dl/extractor/francetv.py
+++ b/youtube_dl/extractor/francetv.py
@@ -16,6 +16,7 @@ from ..utils import (
int_or_none,
float_or_none,
parse_duration,
+ determine_ext,
)
@@ -51,7 +52,8 @@ class FranceTVBaseInfoExtractor(InfoExtractor):
if not video_url:
continue
format_id = video['format']
- if video_url.endswith('.f4m'):
+ ext = determine_ext(video_url)
+ if ext == 'f4m':
if georestricted:
# See https://github.com/rg3/youtube-dl/issues/3963
# m3u8 urls work fine
@@ -61,12 +63,9 @@ class FranceTVBaseInfoExtractor(InfoExtractor):
'http://hdfauth.francetv.fr/esi/urltokengen2.html?url=%s' % video_url_parsed.path,
video_id, 'Downloading f4m manifest token', fatal=False)
if f4m_url:
- f4m_formats = self._extract_f4m_formats(f4m_url, video_id)
- for f4m_format in f4m_formats:
- f4m_format['preference'] = 1
- formats.extend(f4m_formats)
- elif video_url.endswith('.m3u8'):
- formats.extend(self._extract_m3u8_formats(video_url, video_id, 'mp4'))
+ formats.extend(self._extract_f4m_formats(f4m_url, video_id, 1, format_id))
+ elif ext == 'm3u8':
+ formats.extend(self._extract_m3u8_formats(video_url, video_id, 'mp4', m3u8_id=format_id))
elif video_url.startswith('rtmp'):
formats.append({
'url': video_url,