]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[nrk,abc:iview] use _extract_akamai_formats
authorRemita Amine <remitamine@gmail.com>
Mon, 22 Aug 2016 06:48:40 +0000 (07:48 +0100)
committerRemita Amine <remitamine@gmail.com>
Mon, 22 Aug 2016 06:54:08 +0000 (07:54 +0100)
youtube_dl/extractor/abc.py
youtube_dl/extractor/nrk.py

index 879ded88dd4cd3c5efde51d3a4ecb995812e3c74..c7b6df7d08df1f0df8247a9b39c77acfd56dbbb0 100644 (file)
@@ -7,7 +7,6 @@ from ..utils import (
     ExtractorError,
     js_to_json,
     int_or_none,
-    update_url_query,
     parse_iso8601,
 )
 
@@ -123,14 +122,7 @@ class ABCIViewIE(InfoExtractor):
         title = video_params['title']
         stream = next(s for s in video_params['playlist'] if s.get('type') == 'program')
 
-        formats = []
-        f4m_url = stream.get('hds-unmetered') or stream['hds-metered']
-        formats.extend(self._extract_f4m_formats(
-            update_url_query(f4m_url, {'hdcore': '3.7.0'}),
-            video_id, f4m_id='hds', fatal=False))
-        formats.extend(self._extract_m3u8_formats(f4m_url.replace(
-            'akamaihd.net/z/', 'akamaihd.net/i/').replace('/manifest.f4m', '/master.m3u8'),
-            video_id, 'mp4', 'm3u8_native', m3u8_id='hls', fatal=False))
+        formats = self._extract_akamai_formats(stream['hds-unmetered'], video_id)
         self._sort_formats(formats)
 
         subtitles = {}
index 6ded5bd456fa86bf16e1762601889b46f2d68fe9..ed42eb301040bc9ed4a5e28add4209c8bb9e505b 100644 (file)
@@ -14,16 +14,6 @@ from ..utils import (
 
 
 class NRKBaseIE(InfoExtractor):
-    def _extract_formats(self, manifest_url, video_id, fatal=True):
-        formats = []
-        formats.extend(self._extract_f4m_formats(
-            manifest_url + '?hdcore=3.5.0&plugin=aasp-3.5.0.151.81',
-            video_id, f4m_id='hds', fatal=fatal))
-        formats.extend(self._extract_m3u8_formats(manifest_url.replace(
-            'akamaihd.net/z/', 'akamaihd.net/i/').replace('/manifest.f4m', '/master.m3u8'),
-            video_id, 'mp4', 'm3u8_native', m3u8_id='hls', fatal=fatal))
-        return formats
-
     def _real_extract(self, url):
         video_id = self._match_id(url)
 
@@ -45,7 +35,7 @@ class NRKBaseIE(InfoExtractor):
                 asset_url = asset.get('url')
                 if not asset_url:
                     continue
-                formats = self._extract_formats(asset_url, video_id, fatal=False)
+                formats = self._extract_akamai_formats(asset_url, video_id)
                 if not formats:
                     continue
                 self._sort_formats(formats)
@@ -69,7 +59,7 @@ class NRKBaseIE(InfoExtractor):
         if not entries:
             media_url = data.get('mediaUrl')
             if media_url:
-                formats = self._extract_formats(media_url, video_id)
+                formats = self._extract_akamai_formats(media_url, video_id)
                 self._sort_formats(formats)
                 duration = parse_duration(data.get('duration'))
                 entries = [{