]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[extractor/common] Change the default m3u8 protocol in HTML5
authorYen Chi Hsuan <yan12125@gmail.com>
Sun, 21 Aug 2016 18:18:46 +0000 (02:18 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Sun, 21 Aug 2016 18:26:07 +0000 (02:26 +0800)
Helper functions should have consistent default values

ChangeLog
youtube_dl/extractor/charlierose.py
youtube_dl/extractor/common.py
youtube_dl/extractor/snotr.py

index a8d8d05a3774d9030940ddb66676f50d52f5aec4..383ff59eacf63b2cb4a6b9b6262dacaf8697a14c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@ Core
 * Fix js_to_json(): correct octal or hexadecimal number detection
 
 Extractors
++ [charlierose] Add new extractor (#10382)
 + [litv] Support 'promo' URLs (#10385)
 * [snotr] Fix extraction (#10338)
 * [n-tv.de] Fix extraction (#10331)
index 817f7128fad9c50a0bddf1de94190b1c647f6443..4bf2cf7b0ce7648ec2786952220b452c20201a52 100644 (file)
@@ -35,7 +35,8 @@ class CharlieRoseIE(InfoExtractor):
         title = remove_end(self._og_search_title(webpage), ' - Charlie Rose')
 
         info_dict = self._parse_html5_media_entries(
-            self._PLAYER_BASE % video_id, webpage, video_id)[0]
+            self._PLAYER_BASE % video_id, webpage, video_id,
+            m3u8_entry_protocol='m3u8_native')[0]
 
         self._sort_formats(info_dict['formats'])
         self._remove_duplicate_formats(info_dict['formats'])
index 07d58afe7bb2a89a70a61dba447723e1518cc873..ba4c03d3d128377796e37555aba90d968039b44b 100644 (file)
@@ -1695,7 +1695,7 @@ class InfoExtractor(object):
                         self.report_warning('Unknown MIME type %s in DASH manifest' % mime_type)
         return formats
 
-    def _parse_html5_media_entries(self, base_url, webpage, video_id, m3u8_id=None):
+    def _parse_html5_media_entries(self, base_url, webpage, video_id, m3u8_id=None, m3u8_entry_protocol='m3u8'):
         def absolute_url(video_url):
             return compat_urlparse.urljoin(base_url, video_url)
 
@@ -1715,8 +1715,8 @@ class InfoExtractor(object):
             if determine_ext(full_url) == 'm3u8':
                 is_plain_url = False
                 formats = self._extract_m3u8_formats(
-                    full_url, video_id, ext='mp4', entry_protocol='m3u8_native',
-                    m3u8_id=m3u8_id)
+                    full_url, video_id, ext='mp4',
+                    entry_protocol=m3u8_entry_protocol, m3u8_id=m3u8_id)
             else:
                 is_plain_url = True
                 formats = [{
index 3bb78cb84898acf4fddccd556d252a25a8559832..4819fe5b4b6322cc02e9e1fdd4c128cbe28e55b0 100644 (file)
@@ -46,7 +46,8 @@ class SnotrIE(InfoExtractor):
         title = self._og_search_title(webpage)
 
         description = self._og_search_description(webpage)
-        info_dict = self._parse_html5_media_entries(url, webpage, video_id)[0]
+        info_dict = self._parse_html5_media_entries(
+            url, webpage, video_id, m3u8_entry_protocol='m3u8_native')[0]
 
         view_count = str_to_int(self._html_search_regex(
             r'<p[^>]*>\s*<strong[^>]*>Views:</strong>\s*<span[^>]*>([\d,\.]+)',