]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/adobetv.py
[ie/crunchyroll] Fix auth and remove cookies support (#9749)
[yt-dlp.git] / yt_dlp / extractor / adobetv.py
index 12b8192060731ef270eb7200dd4012cc4eae0331..d1525a1af2d5e82d44bace8ab9ed29e57610951b 100644 (file)
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
 import functools
 import re
 
@@ -9,6 +7,7 @@
     float_or_none,
     int_or_none,
     ISO639Utils,
+    join_nonempty,
     OnDemandPagedList,
     parse_duration,
     str_or_none,
@@ -71,7 +70,6 @@ def _parse_video_data(self, video_data):
                     })
                     s3_extracted = True
             formats.append(f)
-        self._sort_formats(formats)
 
         return {
             'id': video_id,
@@ -233,6 +231,7 @@ def _real_extract(self, url):
 class AdobeTVVideoIE(AdobeTVBaseIE):
     IE_NAME = 'adobetv:video'
     _VALID_URL = r'https?://video\.tv\.adobe\.com/v/(?P<id>\d+)'
+    _EMBED_REGEX = [r'<iframe[^>]+src=[\'"](?P<url>(?:https?:)?//video\.tv\.adobe\.com/v/\d+[^"]+)[\'"]']
 
     _TEST = {
         # From https://helpx.adobe.com/acrobat/how-to/new-experience-acrobat-dc.html?set=acrobat--get-started--essential-beginners
@@ -263,13 +262,12 @@ def _real_extract(self, url):
                 continue
             formats.append({
                 'filesize': int_or_none(source.get('kilobytes') or None, invscale=1000),
-                'format_id': '-'.join(filter(None, [source.get('format'), source.get('label')])),
+                'format_id': join_nonempty(source.get('format'), source.get('label')),
                 'height': int_or_none(source.get('height') or None),
                 'tbr': int_or_none(source.get('bitrate') or None),
                 'width': int_or_none(source.get('width') or None),
                 'url': source_src,
             })
-        self._sort_formats(formats)
 
         # For both metadata and downloaded files the duration varies among
         # formats. I just pick the max one