Skip to content

Commit

Permalink
Merge pull request #177 from JC-Chung/JC-Chung-patch-1
Browse files Browse the repository at this point in the history
[YouTube] Q&A message didn't have `header`
  • Loading branch information
xenova committed Nov 29, 2022
2 parents 657e56e + abfe92b commit 60a5a64
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions chat_downloader/sites/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -1758,18 +1758,21 @@ def _get_chat_messages(self, initial_info, ytcfg, params):

header = original_item[original_message_type].get(
'header')
parsed_header = self._parse_item(
header, offset=offset)
header_message = parsed_header.get('message')
if header:
parsed_header = self._parse_item(
header, offset=offset)
header_message = parsed_header.get('message')

contents = original_item[original_message_type].get(
'contents')
parsed_contents = self._parse_item(
contents, offset=offset)

data.update(parsed_header)
if header:
data.update(parsed_header)
data.update(parsed_contents)
data['header_message'] = header_message
if header:
data['header_message'] = header_message
else:
debug_log(
'No bannerRenderer item',
Expand Down

0 comments on commit 60a5a64

Please sign in to comment.