]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/kuwo.py
[ie/orf:on] Improve extraction (#9677)
[yt-dlp.git] / yt_dlp / extractor / kuwo.py
index 0c9518e66144659620b92f92e3d9992583caf9d5..3c93dedac2f9ea2a886e840286213bce83f0b02c 100644 (file)
@@ -54,6 +54,7 @@ def _get_formats(self, song_id, tolerate_ip_deny=False):
 
 
 class KuwoIE(KuwoBaseIE):
+    _WORKING = False
     IE_NAME = 'kuwo:song'
     IE_DESC = '酷我音乐'
     _VALID_URL = r'https?://(?:www\.)?kuwo\.cn/yinyue/(?P<id>\d+)'
@@ -91,7 +92,7 @@ def _real_extract(self, url):
         webpage, urlh = self._download_webpage_handle(
             url, song_id, note='Download song detail info',
             errnote='Unable to get song detail info')
-        if song_id not in urlh.geturl() or '对不起,该歌曲由于版权问题已被下线,将返回网站首页' in webpage:
+        if song_id not in urlh.url or '对不起,该歌曲由于版权问题已被下线,将返回网站首页' in webpage:
             raise ExtractorError('this song has been offline because of copyright issues', expected=True)
 
         song_name = self._html_search_regex(
@@ -104,7 +105,6 @@ def _real_extract(self, url):
             lrc_content = None
 
         formats = self._get_formats(song_id)
-        self._sort_formats(formats)
 
         album_id = self._html_search_regex(
             r'<a[^>]+href="http://www\.kuwo\.cn/album/(\d+)/"',
@@ -134,6 +134,7 @@ def _real_extract(self, url):
 
 
 class KuwoAlbumIE(InfoExtractor):
+    _WORKING = False
     IE_NAME = 'kuwo:album'
     IE_DESC = '酷我音乐 - 专辑'
     _VALID_URL = r'https?://(?:www\.)?kuwo\.cn/album/(?P<id>\d+?)/'
@@ -170,6 +171,7 @@ def _real_extract(self, url):
 
 
 class KuwoChartIE(InfoExtractor):
+    _WORKING = False
     IE_NAME = 'kuwo:chart'
     IE_DESC = '酷我音乐 - 排行榜'
     _VALID_URL = r'https?://yinyue\.kuwo\.cn/billboard_(?P<id>[^.]+).htm'
@@ -195,6 +197,7 @@ def _real_extract(self, url):
 
 
 class KuwoSingerIE(InfoExtractor):
+    _WORKING = False
     IE_NAME = 'kuwo:singer'
     IE_DESC = '酷我音乐 - 歌手'
     _VALID_URL = r'https?://(?:www\.)?kuwo\.cn/mingxing/(?P<id>[^/]+)'
@@ -252,6 +255,7 @@ def page_func(page_num):
 
 
 class KuwoCategoryIE(InfoExtractor):
+    _WORKING = False
     IE_NAME = 'kuwo:category'
     IE_DESC = '酷我音乐 - 分类'
     _VALID_URL = r'https?://yinyue\.kuwo\.cn/yy/cinfo_(?P<id>\d+?).htm'
@@ -291,6 +295,7 @@ def _real_extract(self, url):
 
 
 class KuwoMvIE(KuwoBaseIE):
+    _WORKING = False
     IE_NAME = 'kuwo:mv'
     IE_DESC = '酷我音乐 - MV'
     _VALID_URL = r'https?://(?:www\.)?kuwo\.cn/mv/(?P<id>\d+?)/'
@@ -339,8 +344,6 @@ def _real_extract(self, url):
             'format_id': 'mv',
         })
 
-        self._sort_formats(formats)
-
         return {
             'id': song_id,
             'title': song_name,