aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/youtube.py
diff options
context:
space:
mode:
authorMatthew <coletdjnz@protonmail.com>2022-11-10 16:33:03 +1300
committerGitHub <noreply@github.com>2022-11-10 03:33:03 +0000
commit0cf643b234ff2f4d017a980dbaefdb14ed6e4db6 (patch)
tree1611c3a216592b489065340805ad030d70801db1 /yt_dlp/extractor/youtube.py
parentdc3028d233b2f7091215dc0d9acc522914b9b59d (diff)
downloadhypervideo-pre-0cf643b234ff2f4d017a980dbaefdb14ed6e4db6.tar.lz
hypervideo-pre-0cf643b234ff2f4d017a980dbaefdb14ed6e4db6.tar.xz
hypervideo-pre-0cf643b234ff2f4d017a980dbaefdb14ed6e4db6.zip
[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
Diffstat (limited to 'yt_dlp/extractor/youtube.py')
-rw-r--r--yt_dlp/extractor/youtube.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py
index 7e3c17ae0..5b7c94c4e 100644
--- a/yt_dlp/extractor/youtube.py
+++ b/yt_dlp/extractor/youtube.py
@@ -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):