diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-07-19 15:27:11 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-07-19 15:29:28 +0530 |
commit | b79f9e302d1f75edda18035e4efffc395b5710e5 (patch) | |
tree | a6b5bfe71f9388a6a31e8148e52690454a9eb726 | |
parent | bc83b4b06cd2648276c7f075754ace8be22f889a (diff) | |
download | hypervideo-pre-b79f9e302d1f75edda18035e4efffc395b5710e5.tar.lz hypervideo-pre-b79f9e302d1f75edda18035e4efffc395b5710e5.tar.xz hypervideo-pre-b79f9e302d1f75edda18035e4efffc395b5710e5.zip |
`--compat-option no-live-chat` should disable danmaku
Closes #4387
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | yt_dlp/extractor/common.py | 8 |
2 files changed, 5 insertions, 5 deletions
@@ -139,7 +139,7 @@ Some of yt-dlp's default options are different from that of youtube-dl and youtu * `playlist_index` behaves differently when used with options like `--playlist-reverse` and `--playlist-items`. See [#302](https://github.com/yt-dlp/yt-dlp/issues/302) for details. You can use `--compat-options playlist-index` if you want to keep the earlier behavior * The output of `-F` is listed in a new format. Use `--compat-options list-formats` to revert this * All *experiences* of a funimation episode are considered as a single video. This behavior breaks existing archives. Use `--compat-options seperate-video-versions` to extract information from only the default player -* Youtube live chat (if available) is considered as a subtitle. Use `--sub-langs all,-live_chat` to download all subtitles except live chat. You can also use `--compat-options no-live-chat` to prevent live chat from downloading +* Live chats (if available) are considered as subtitles. Use `--sub-langs all,-live_chat` to download all subtitles except live chat. You can also use `--compat-options no-live-chat` to prevent any live chat/danmaku from downloading * Youtube channel URLs are automatically redirected to `/video`. Append a `/featured` to the URL to download only the videos in the home page. If the channel does not have a videos tab, we try to download the equivalent `UU` playlist instead. For all other tabs, if the channel does not show the requested tab, an error will be raised. Also, `/live` URLs raise an error if there are no live videos instead of silently downloading the entire channel. You may use `--compat-options no-youtube-channel-redirect` to revert all these redirections * Unavailable videos are also listed for youtube playlists. Use `--compat-options no-youtube-unavailable-videos` to remove this * If `ffmpeg` is used as the downloader, the downloading and merging of formats happen in a single step when possible. Use `--compat-options no-direct-merge` to revert this diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index 1c751870c..fc087a69c 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -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): |