]> jfr.im git - yt-dlp.git/commitdiff
[extractor/bilibili] Fix `--no-playlist` for anthology
authorpukkandan <redacted>
Fri, 30 Dec 2022 06:27:33 +0000 (11:57 +0530)
committerpukkandan <redacted>
Fri, 30 Dec 2022 06:40:57 +0000 (12:10 +0530)
Closes #5797

yt_dlp/extractor/bilibili.py

index 37711c138a4b7b4bfc9ae189e02a96582c5f7a61..92620f697b6cd4b2435ea1db951e2ee73a86cb22 100644 (file)
@@ -303,7 +303,8 @@ def _real_extract(self, url):
                 getter=lambda entry: f'https://www.bilibili.com/video/{video_id}?p={entry["page"]}')
 
         if is_anthology:
-            title += f' p{part_id:02d} {traverse_obj(page_list_json, ((part_id or 1) - 1, "part")) or ""}'
+            part_id = part_id or 1
+            title += f' p{part_id:02d} {traverse_obj(page_list_json, (part_id - 1, "part")) or ""}'
 
         aid = video_data.get('aid')
         old_video_id = format_field(aid, None, f'%s_part{part_id or 1}')