1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-11-03 16:15:14 +00:00

[extractor/youtube] Differentiate between no and disabled comments (#5491)

`comments` and `comment_count` will be set to None, as opposed to 
an empty list and 0, respectively.

Fixes https://github.com/yt-dlp/yt-dlp/issues/5068

Authored by: coletdjnz, pukkandan
This commit is contained in:
Matthew
2022-11-10 16:33:03 +13:00
committed by GitHub
parent dc3028d233
commit 0cf643b234
2 changed files with 6 additions and 0 deletions

View File

@@ -3270,6 +3270,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
message = self._get_text(root_continuation_data, ('contents', ..., 'messageRenderer', 'text'), max_runs=1)
if message and not parent and tracker['running_total'] == 0:
self.report_warning(f'Youtube said: {message}', video_id=video_id, only_once=True)
raise self.CommentsDisabled
@staticmethod
def _generate_comment_continuation(video_id):