diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index a9c29062f5..f44624e398 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -1950,7 +1950,7 @@ def _extract_chapters_from_engagement_panel(self, data, duration): content_list = traverse_obj( data, ('engagementPanels', ..., 'engagementPanelSectionListRenderer', 'content', 'macroMarkersListRenderer', 'contents'), - expected_type=list) + expected_type=list, default=[]) chapter_time = lambda chapter: parse_duration(self._get_text(chapter.get('timeDescription'))) chapter_title = lambda chapter: self._get_text(chapter.get('title')) @@ -1996,7 +1996,10 @@ def parse_time_text(time_text): """ time_text_split = time_text.split(' ') if len(time_text_split) >= 3: - return datetime_from_str('now-%s%s' % (time_text_split[0], time_text_split[1]), precision='auto') + try: + return datetime_from_str('now-%s%s' % (time_text_split[0], time_text_split[1]), precision='auto') + except ValueError: + return None def _extract_comment(self, comment_renderer, parent=None): comment_id = comment_renderer.get('commentId')