From 227277217bbabbd979c2c80edd7ecc16392b69b4 Mon Sep 17 00:00:00 2001 From: rhgndf <16336768+rhgndf@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:28:42 +0800 Subject: [PATCH] [duboku] Handle error --- yt_dlp/extractor/duboku.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/duboku.py b/yt_dlp/extractor/duboku.py index 43a5e5f2c2..d0ca668a3e 100644 --- a/yt_dlp/extractor/duboku.py +++ b/yt_dlp/extractor/duboku.py @@ -138,7 +138,10 @@ class DubokuIE(InfoExtractor): sign_url = 'https://w.duboku.io/static/player/vidjs25.php' sign_html = self._download_webpage(sign_url, video_id) - sign = re.search(r'encodeURIComponent\(\'(.*)\'\);', sign_html).group(1) + sign = re.search(r'encodeURIComponent\(\'(.*)\'\);', sign_html) + if not sign: + raise ExtractorError('Cannot find sign in player') + sign = sign.group(1) # if it is an embedded iframe, maybe it's an external source headers = {'Referer': webpage_url}