1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-03 08:35:32 +00:00

--compat-option no-live-chat should disable danmaku

Closes #4387
This commit is contained in:
pukkandan
2022-07-19 15:27:11 +05:30
parent bc83b4b06c
commit b79f9e302d
2 changed files with 5 additions and 5 deletions

View File

@ -647,10 +647,10 @@ class InfoExtractor:
return None
if self._x_forwarded_for_ip:
ie_result['__x_forwarded_for_ip'] = self._x_forwarded_for_ip
subtitles = ie_result.get('subtitles')
if (subtitles and 'live_chat' in subtitles
and 'no-live-chat' in self.get_param('compat_opts', [])):
del subtitles['live_chat']
subtitles = ie_result.get('subtitles') or {}
if 'no-live-chat' in self.get_param('compat_opts'):
for lang in ('live_chat', 'comments', 'danmaku'):
subtitles.pop(lang, None)
return ie_result
except GeoRestrictedError as e:
if self.__maybe_fake_ip_and_retry(e.countries):