aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoru-spec-png <54671367+u-spec-png@users.noreply.github.com>2021-10-25 19:33:01 +0000
committerGitHub <noreply@github.com>2021-10-26 01:03:01 +0530
commit8e7ab2cf08970dbeedef304cd25bcd6abf36966b (patch)
tree034988e23b029ba51c88e885346e55ec9298eff0
parentad64a2323f1ce0f8aeb07e4ead46630edec2bf2d (diff)
downloadhypervideo-pre-8e7ab2cf08970dbeedef304cd25bcd6abf36966b.tar.lz
hypervideo-pre-8e7ab2cf08970dbeedef304cd25bcd6abf36966b.tar.xz
hypervideo-pre-8e7ab2cf08970dbeedef304cd25bcd6abf36966b.zip
[Bilibili:comments] Fix infinite loop (#1423)
Closes #1412 Authored by: u-spec-png
-rw-r--r--yt_dlp/extractor/bilibili.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/yt_dlp/extractor/bilibili.py b/yt_dlp/extractor/bilibili.py
index ee1722e94..483f93d67 100644
--- a/yt_dlp/extractor/bilibili.py
+++ b/yt_dlp/extractor/bilibili.py
@@ -376,8 +376,10 @@ class BiliBiliIE(InfoExtractor):
replies = traverse_obj(
self._download_json(
f'https://api.bilibili.com/x/v2/reply?pn={idx}&oid={video_id}&type=1&jsonp=jsonp&sort=2&_=1567227301685',
- video_id, note=f'Extracting comments from page {idx}'),
- ('data', 'replies')) or []
+ video_id, note=f'Extracting comments from page {idx}', fatal=False),
+ ('data', 'replies'))
+ if not replies:
+ return
for children in map(self._get_all_children, replies):
yield from children