Skip to content

Commit

Permalink
[extractor/youtube] Fix parsing comment_count (yt-dlp#6523)
Browse files Browse the repository at this point in the history
Closes yt-dlp#5849
Authored by: nick-cd
  • Loading branch information
nick-cd authored and aalsuwaidi committed Apr 21, 2024
1 parent 36b1314 commit 1610e7f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions yt_dlp/extractor/youtube.py
Expand Up @@ -4268,11 +4268,11 @@ def process_language(container, base_url, lang_code, sub_name, query):

info['comment_count'] = traverse_obj(initial_data, (
'contents', 'twoColumnWatchNextResults', 'results', 'results', 'contents', ..., 'itemSectionRenderer',
'contents', ..., 'commentsEntryPointHeaderRenderer', 'commentCount', 'simpleText'
'contents', ..., 'commentsEntryPointHeaderRenderer', 'commentCount'
), (
'engagementPanels', lambda _, v: v['engagementPanelSectionListRenderer']['panelIdentifier'] == 'comment-item-section',
'engagementPanelSectionListRenderer', 'header', 'engagementPanelTitleHeaderRenderer', 'contextualInfo', 'runs', ..., 'text'
), expected_type=int_or_none, get_all=False)
'engagementPanelSectionListRenderer', 'header', 'engagementPanelTitleHeaderRenderer', 'contextualInfo'
), expected_type=self._get_count, get_all=False)

try: # This will error if there is no livechat
initial_data['contents']['twoColumnWatchNextResults']['conversationBar']['liveChatRenderer']['continuations'][0]['reloadContinuationData']['continuation']
Expand Down

0 comments on commit 1610e7f

Please sign in to comment.