New option --no-write-playlist-metafiles to NOT write playlist metadata files

This commit is contained in:
pukkandan 2021-01-30 16:43:20 +05:30
parent 7c245ce877
commit cac96421d9
3 changed files with 64 additions and 44 deletions

View File

@ -378,6 +378,11 @@ ## Filesystem Options:
--write-annotations Write video annotations to a --write-annotations Write video annotations to a
.annotations.xml file .annotations.xml file
--no-write-annotations Do not write video annotations (default) --no-write-annotations Do not write video annotations (default)
--write-playlist-metafiles Write playlist metadata in addition to the
video metadata when using --write-info-json,
--write-description etc. (default)
--no-write-playlist-metafiles Do not write playlist metadata when using
--write-info-json, --write-description etc.
--get-comments Retrieve video comments to be placed in the --get-comments Retrieve video comments to be placed in the
.info.json file .info.json file
--load-info-json FILE JSON file containing the video information --load-info-json FILE JSON file containing the video information

View File

@ -206,6 +206,7 @@ class YoutubeDL(object):
unless writeinfojson is also given unless writeinfojson is also given
writeannotations: Write the video annotations to a .annotations.xml file writeannotations: Write the video annotations to a .annotations.xml file
writethumbnail: Write the thumbnail image to a file writethumbnail: Write the thumbnail image to a file
allow_playlist_files: Also write playlists' description, infojson etc in a seperate file
write_all_thumbnails: Write all thumbnail formats to files write_all_thumbnails: Write all thumbnail formats to files
writelink: Write an internet shortcut file, depending on the writelink: Write an internet shortcut file, depending on the
current platform (.url/.webloc/.desktop) current platform (.url/.webloc/.desktop)
@ -1108,6 +1109,8 @@ def __process_playlist(self, ie_result, download):
# We process each entry in the playlist # We process each entry in the playlist
playlist = ie_result.get('title') or ie_result.get('id') playlist = ie_result.get('title') or ie_result.get('id')
self.to_screen('[download] Downloading playlist: %s' % playlist) self.to_screen('[download] Downloading playlist: %s' % playlist)
if self.params.get('allow_playlist_files', True):
ie_copy = { ie_copy = {
'playlist': playlist, 'playlist': playlist,
'playlist_id': ie_result.get('id'), 'playlist_id': ie_result.get('id'),

View File

@ -937,6 +937,18 @@ def _dict_from_multiple_values_options_callback(
'--no-write-annotations', '--no-write-annotations',
action='store_false', dest='writeannotations', action='store_false', dest='writeannotations',
help='Do not write video annotations (default)') help='Do not write video annotations (default)')
filesystem.add_option(
'--write-playlist-metafiles',
action='store_true', dest='allow_playlist_files', default=True,
help=(
'Write playlist metadata in addition to the video metadata '
'when using --write-info-json, --write-description etc. (default)'))
filesystem.add_option(
'--no-write-playlist-metafiles',
action='store_false', dest='allow_playlist_files',
help=(
'Do not write playlist metadata when using '
'--write-info-json, --write-description etc.'))
filesystem.add_option( filesystem.add_option(
'--get-comments', '--get-comments',
action='store_true', dest='getcomments', default=False, action='store_true', dest='getcomments', default=False,