]> jfr.im git - yt-dlp.git/commitdiff
Add compat-option `no-attach-infojson`
authorpukkandan <redacted>
Tue, 11 May 2021 08:55:31 +0000 (14:25 +0530)
committerpukkandan <redacted>
Tue, 11 May 2021 08:55:31 +0000 (14:25 +0530)
README.md
yt_dlp/YoutubeDL.py
yt_dlp/__init__.py
yt_dlp/postprocessor/ffmpeg.py

index 207f29493836fdc28ecf14eda41dbda6da3dcc45..c8936027f3c10777daba717183748a4105a837dc 100644 (file)
--- a/README.md
+++ b/README.md
@@ -122,6 +122,7 @@ ### Differences in default behavior
 1. Unlike youtube-dlc, yt-dlp does not allow merging multiple audio/video streams into one file by default (since this conflicts with the use of `-f bv*+ba`). If needed, this feature must be enabled using `--audio-multistreams` and `--video-multistreams`. You can also use `--compat-options multistreams` to enable both
 1. `--ignore-errors` is enabled by default. Use `--abort-on-error` or `--compat-options abort-on-error` to abort on errors instead
 1. When writing metadata files such as thumbnails, description or infojson, the same information (if available) is also written for playlists. Use `--no-write-playlist-metafiles` or `--compat-options no-playlist-metafiles` to not write these files
+1. `--add-metadata` attaches the `infojson` to `mkv` files in addition to writing the metadata when used with `--write-infojson`. Use `--compat-options no-attach-info-json` to revert this
 1. `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
 1. The output of `-F` is listed in a new format. Use `--compat-options list-formats` to revert this
 1. 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
index 3cf86cee7424dfcf0f62d14252a0c5032c91b0eb..c51be22cb420097f0b121ee665505aa63366abb7 100644 (file)
@@ -386,7 +386,7 @@ class YoutubeDL(object):
                        if True, otherwise use ffmpeg/avconv if False, otherwise
                        use downloader suggested by extractor if None.
     compat_opts:       Compatibility options. See "Differences in default behavior".
-                       Note that only format-sort, format-spec, no-live-chat,
+                       Note that only format-sort, format-spec, no-live-chat, no-attach-infojson
                        playlist-index, list-formats, no-youtube-channel-redirect
                        and no-youtube-unavailable-videos works when used via the API
 
index 356772b1da4de3dc9db5356b8b1c00bc446ecc21..f1bdc1b76340432ebcfc3ca50589bc7129e7feb7 100644 (file)
@@ -260,7 +260,7 @@ def parse_compat_opts():
     all_compat_opts = [
         'filename', 'format-sort', 'abort-on-error', 'format-spec', 'multistreams',
         'no-playlist-metafiles', 'no-live-chat', 'playlist-index', 'list-formats',
-        'no-youtube-channel-redirect', 'no-youtube-unavailable-videos',
+        'no-youtube-channel-redirect', 'no-youtube-unavailable-videos', 'no-attach-info-json',
     ]
     compat_opts = parse_compat_opts()
 
index 0e160f5dcd91a985f33fcbf8c43d4568e15580f1..78a80f3f8617287ca627791965362300c515cb73 100644 (file)
@@ -605,7 +605,8 @@ def ffmpeg_escape(text):
                 in_filenames.append(metadata_filename)
                 options.extend(['-map_metadata', '1'])
 
-        if '__infojson_filename' in info and info['ext'] in ('mkv', 'mka'):
+        if ('no-attach-info-json' not in self.get_param('compat_opts', [])
+                and '__infojson_filename' in info and info['ext'] in ('mkv', 'mka')):
             old_stream, new_stream = self.get_stream_number(
                 filename, ('tags', 'mimetype'), 'application/json')
             if old_stream is not None: