]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/arcpublishing.py
[extractor] Deprecate `_sort_formats`
[yt-dlp.git] / yt_dlp / extractor / arcpublishing.py
index fd2c795aeed292e1f49c99f2c3be2e0ec714e8ae..febd3d28a5850fe899fe951661edd6242ec7968d 100644 (file)
@@ -1,6 +1,3 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
 import re
 
 from .common import InfoExtractor
@@ -73,8 +70,8 @@ class ArcPublishingIE(InfoExtractor):
         ], 'video-api-cdn.%s.arcpublishing.com/api'),
     ]
 
-    @staticmethod
-    def _extract_urls(webpage):
+    @classmethod
+    def _extract_embed_urls(cls, url, webpage):
         entries = []
         # https://arcpublishing.atlassian.net/wiki/spaces/POWA/overview
         for powa_el in re.findall(r'(<div[^>]+class="[^"]*\bpowa\b[^"]*"[^>]+data-uuid="%s"[^>]*>)' % ArcPublishingIE._UUID_REGEX, webpage):
@@ -86,7 +83,7 @@ def _extract_urls(webpage):
         return entries
 
     def _real_extract(self, url):
-        org, uuid = re.match(self._VALID_URL, url).groups()
+        org, uuid = self._match_valid_url(url).groups()
         for orgs, tmpl in self._POWA_DEFAULTS:
             if org in orgs:
                 base_api_tmpl = tmpl
@@ -124,8 +121,7 @@ def _real_extract(self, url):
                 formats.extend(smil_formats)
             elif stream_type in ('ts', 'hls'):
                 m3u8_formats = self._extract_m3u8_formats(
-                    s_url, uuid, 'mp4', 'm3u8' if is_live else 'm3u8_native',
-                    m3u8_id='hls', fatal=False)
+                    s_url, uuid, 'mp4', live=is_live, m3u8_id='hls', fatal=False)
                 if all([f.get('acodec') == 'none' for f in m3u8_formats]):
                     continue
                 for f in m3u8_formats:
@@ -148,7 +144,6 @@ def _real_extract(self, url):
                     'url': s_url,
                     'quality': -10,
                 })
-        self._sort_formats(formats)
 
         subtitles = {}
         for subtitle in (try_get(video, lambda x: x['subtitles']['urls'], list) or []):
@@ -158,7 +153,7 @@ def _real_extract(self, url):
 
         return {
             'id': uuid,
-            'title': self._live_title(title) if is_live else title,
+            'title': title,
             'thumbnail': try_get(video, lambda x: x['promo_image']['url']),
             'description': try_get(video, lambda x: x['subheadlines']['basic']),
             'formats': formats,