From 34631c50f1657241b42e4493a98e99d708cab832 Mon Sep 17 00:00:00 2001 From: Junyi Lou <15688661+junyilou@users.noreply.github.com> Date: Mon, 18 Aug 2025 13:48:04 +0800 Subject: [PATCH] Fix per suggestion Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com> --- yt_dlp/extractor/bilibili.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/yt_dlp/extractor/bilibili.py b/yt_dlp/extractor/bilibili.py index 4d880daf8b..d5666418b3 100644 --- a/yt_dlp/extractor/bilibili.py +++ b/yt_dlp/extractor/bilibili.py @@ -666,9 +666,8 @@ class BiliBiliIE(BilibiliBaseIE): initial_state = self._search_json(r'window\.__INITIAL_STATE__\s*=', webpage, 'initial state', video_id, default=None) if not initial_state: - if traverse_obj(self._search_json( - r'\s*window\._riskdata_\s*=', webpage, 'risk data', video_id, default=None), 'v_voucher'): - raise ExtractorError('You are downloading too frequently, please wait and try later', expected=True) + if self._search_json(r'\bwindow\._riskdata_\s*=', webpage, 'risk', video_id, default={}).get('v_voucher'): + raise ExtractorError('You have exceeded the rate limit. Try again later', expected=True) query = {'platform': 'web'} prefix = prefix.upper() if prefix == 'BV':