]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[extractor/common] Add 'preference' to _parse_html5_media_entries
authorYen Chi Hsuan <yan12125@gmail.com>
Sat, 25 Feb 2017 10:40:05 +0000 (18:40 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Sat, 25 Feb 2017 10:40:05 +0000 (18:40 +0800)
Some websites, like NJPWorld, put different qualities on different
player pages.

youtube_dl/extractor/common.py

index 4252d682563f9831a33225ff3dc906aa27f0eb01..eb3c091aaab5d84ab8972003877ffd1d38827fca 100644 (file)
@@ -2010,7 +2010,7 @@ class InfoExtractor(object):
                 })
         return formats
 
-    def _parse_html5_media_entries(self, base_url, webpage, video_id, m3u8_id=None, m3u8_entry_protocol='m3u8', mpd_id=None):
+    def _parse_html5_media_entries(self, base_url, webpage, video_id, m3u8_id=None, m3u8_entry_protocol='m3u8', mpd_id=None, preference=None):
         def absolute_url(video_url):
             return compat_urlparse.urljoin(base_url, video_url)
 
@@ -2032,7 +2032,8 @@ class InfoExtractor(object):
                 is_plain_url = False
                 formats = self._extract_m3u8_formats(
                     full_url, video_id, ext='mp4',
-                    entry_protocol=m3u8_entry_protocol, m3u8_id=m3u8_id)
+                    entry_protocol=m3u8_entry_protocol, m3u8_id=m3u8_id,
+                    preference=preference)
             elif ext == 'mpd':
                 is_plain_url = False
                 formats = self._extract_mpd_formats(