]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/umg.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / umg.py
index 8c84f2009e454e1a3091697815edf4ef6c122ffb..b509fda8834853d8b7e291fabd2aad572e8c36d4 100644 (file)
@@ -1,6 +1,3 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
 from .common import InfoExtractor
 from ..utils import (
     int_or_none,
@@ -10,6 +7,7 @@
 
 
 class UMGDeIE(InfoExtractor):
+    _WORKING = False
     IE_NAME = 'umg:de'
     IE_DESC = 'Universal Music Deutschland'
     _VALID_URL = r'https?://(?:www\.)?universal-music\.de/[^/]+/videos/[^/?#]+-(?P<id>\d+)'
@@ -22,13 +20,13 @@ class UMGDeIE(InfoExtractor):
             'title': 'Jedes Wort ist Gold wert',
             'timestamp': 1513591800,
             'upload_date': '20171218',
-        }
+        },
     }
 
     def _real_extract(self, url):
         video_id = self._match_id(url)
         video_data = self._download_json(
-            'https://api.universal-music.de/graphql',
+            'https://graphql.universal-music.de/',
             video_id, query={
                 'query': '''{
   universalMusic(channel:16) {
@@ -47,7 +45,7 @@ def _real_extract(self, url):
       createdDate
     }
   }
-}''' % video_id})['data']['universalMusic']['video']
+}''' % video_id})['data']['universalMusic']['video']  # noqa: UP031
 
         title = video_data['headline']
         hls_url_template = 'http://mediadelivery.universal-music-services.de/vod/mp4:autofill/storage/' + '/'.join(list(video_id)) + '/content/%s/file/playlist.m3u8'
@@ -56,11 +54,9 @@ def _real_extract(self, url):
         formats = []
 
         def add_m3u8_format(format_id):
-            m3u8_formats = self._extract_m3u8_formats(
+            formats.extend(self._extract_m3u8_formats(
                 hls_url_template % format_id, video_id, 'mp4',
-                'm3u8_native', m3u8_id='hls', fatal='False')
-            if m3u8_formats and m3u8_formats[0].get('height'):
-                formats.extend(m3u8_formats)
+                'm3u8_native', m3u8_id='hls', fatal=False))
 
         for f in video_data.get('formats', []):
             f_url = f.get('url')
@@ -91,7 +87,6 @@ def add_m3u8_format(format_id):
         if not formats:
             for format_id in (867, 836, 940):
                 add_m3u8_format(format_id)
-        self._sort_formats(formats)
 
         return {
             'id': video_id,