]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/wasdtv.py
[extractor/rokfin] Re-construct manifest url (#6507)
[yt-dlp.git] / yt_dlp / extractor / wasdtv.py
index 38c10dc6211f20ead24dd2a650c5e4d91465d3c8..f57c619b5f8848f41121af0ef831086b8f51157b 100644 (file)
@@ -1,6 +1,3 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
 from .common import InfoExtractor
 from ..utils import (
     ExtractorError,
@@ -40,7 +37,6 @@ def _real_extract(self, url):
         media_url, is_live = self._get_media_url(media_meta)
         video_id = media.get('media_id') or container.get('media_container_id')
         formats, subtitles = self._extract_m3u8_formats_and_subtitles(media_url, video_id, 'mp4')
-        self._sort_formats(formats)
         return {
             'id': str(video_id),
             'title': container.get('media_container_name') or self._og_search_title(self._download_webpage(url, video_id)),
@@ -98,7 +94,7 @@ def _get_media_url(self, media_meta):
 
 class WASDTVRecordIE(WASDTVBaseIE):
     IE_NAME = 'wasdtv:record'
-    _VALID_URL = r'https?://wasd\.tv/[^/#?]+/videos\?record=(?P<id>\d+)$'
+    _VALID_URL = r'https?://wasd\.tv/[^/#?]+(?:/videos)?\?record=(?P<id>\d+)$'
     _TESTS = [{
         'url': 'https://wasd.tv/spacemita/videos?record=907755',
         'md5': 'c9899dd85be4cc997816ff9f9ca516ce',
@@ -113,6 +109,9 @@ class WASDTVRecordIE(WASDTVBaseIE):
             'is_live': False,
             'view_count': int,
         },
+    }, {
+        'url': 'https://wasd.tv/spacemita?record=907755',
+        'only_matching': True,
     }]
 
     def _get_container(self, url):
@@ -149,7 +148,6 @@ def _real_extract(self, url):
         clip = self._fetch(f'v2/clips/{clip_id}', video_id=clip_id, description='clip')
         clip_data = clip.get('clip_data')
         formats, subtitles = self._extract_m3u8_formats_and_subtitles(clip_data.get('url'), video_id=clip_id, ext='mp4')
-        self._sort_formats(formats)
         return {
             'id': clip_id,
             'title': clip.get('clip_title') or self._og_search_title(self._download_webpage(url, clip_id, fatal=False)),