From 2db2de317c53311b380321d22b640bddca394c84 Mon Sep 17 00:00:00 2001 From: doe1080 <98906116+doe1080@users.noreply.github.com> Date: Sun, 22 Jun 2025 21:04:22 +0900 Subject: [PATCH] Apply suggestions --- yt_dlp/extractor/huya.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/yt_dlp/extractor/huya.py b/yt_dlp/extractor/huya.py index e8190a372..65099b062 100644 --- a/yt_dlp/extractor/huya.py +++ b/yt_dlp/extractor/huya.py @@ -21,10 +21,9 @@ class HuyaLiveIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.|m\.)?huya\.com/(?!(?:video/play/))(?P[^/#?&]+)(?:\D|$)' IE_NAME = 'huya:live' IE_DESC = '虎牙直播' - - _VALID_URL = r'https?://(?:(?:m|www)\.)?huya\.com/(?!(?:video/play/))(?P[^/#?&]+)(?:\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\d+)\.html' IE_NAME = 'huya:video' IE_DESC = '虎牙视频' - _VALID_URL = r'https?://(?:www\.)?huya\.com/video/play/(?P\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,