1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-06-27 17:08:32 +00:00

Apply suggestions

This commit is contained in:
doe1080 2025-06-22 21:04:22 +09:00
parent 865a397bd5
commit 2db2de317c

View File

@ -21,10 +21,9 @@
class HuyaLiveIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.|m\.)?huya\.com/(?!(?:video/play/))(?P<id>[^/#?&]+)(?:\D|$)'
IE_NAME = 'huya:live'
IE_DESC = '虎牙直播'
_VALID_URL = r'https?://(?:(?:m|www)\.)?huya\.com/(?!(?:video/play/))(?P<id>[^/#?&]+)(?:\D|$)'
_TESTS = [{
'url': 'https://www.huya.com/572329',
'info_dict': {
@ -141,10 +140,10 @@ def encrypt(self, params, stream_info, stream_name):
class HuyaVideoIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?huya\.com/video/play/(?P<id>\d+)\.html'
IE_NAME = 'huya:video'
IE_DESC = '虎牙视频'
_VALID_URL = r'https?://(?:www\.)?huya\.com/video/play/(?P<id>\d+)\.html'
_TESTS = [{
'url': 'https://www.huya.com/video/play/1002412640.html',
'info_dict': {
@ -221,8 +220,6 @@ def _real_extract(self, url: str):
'width': ('width', {int_or_none}),
}))
formats.extend(fmts)
if not formats:
self.raise_no_formats('No video found')
return {
'id': video_id,