]> jfr.im git - yt-dlp.git/commitdiff
[extractor/youtube] Do not warn on duplicate chapters
authorpukkandan <redacted>
Tue, 27 Sep 2022 02:55:31 +0000 (08:25 +0530)
committerpukkandan <redacted>
Tue, 27 Sep 2022 02:56:26 +0000 (08:26 +0530)
Eg: vYbaM8w8yzw

yt_dlp/extractor/youtube.py

index c4aa6f8fe10b185c67eb149d19fcf7a9077911a8..a9d838345d1a1692884f4738666afa12c29e8cda 100644 (file)
@@ -3034,8 +3034,9 @@ def _extract_chapters(self, chapter_list, chapter_time, chapter_title, duration,
                 self.report_warning(f'Incomplete chapter {idx}')
             elif chapters[-1]['start_time'] <= chapter['start_time'] <= duration:
                 chapters.append(chapter)
-            else:
-                self.report_warning(f'Invalid start time for chapter "{chapter["title"]}"')
+            elif chapter not in chapters:
+                self.report_warning(
+                    f'Invalid start time ({chapter["start_time"]} < {chapters[-1]["start_time"]}) for chapter "{chapter["title"]}"')
         return chapters[1:]
 
     def _extract_comment(self, comment_renderer, parent=None):