# We process each entry in the playlist
playlist = ie_result.get('title') or ie_result.get('id')
self.to_screen('[download] Downloading playlist: %s' % playlist)
+ ie_copy = {
+ 'playlist': playlist,
+ 'playlist_id': ie_result.get('id'),
+ 'playlist_title': ie_result.get('title'),
+ 'playlist_uploader': ie_result.get('uploader'),
+ 'playlist_uploader_id': ie_result.get('uploader_id'),
+ 'playlist_index': 0
+ }
+ ie_copy.update(dict(ie_result))
def ensure_dir_exists(path):
return make_dir(path, self.report_error)
if self.params.get('writeinfojson', False):
infofn = replace_extension(
- self.prepare_filepath(self.prepare_filename(ie_result), 'infojson'),
+ self.prepare_filepath(self.prepare_filename(ie_copy), 'infojson'),
'info.json', ie_result.get('ext'))
if not ensure_dir_exists(encodeFilename(infofn)):
return
if self.params.get('overwrites', True) and os.path.exists(encodeFilename(infofn)):
- self.to_screen('[info] Playlist description metadata is already present')
+ self.to_screen('[info] Playlist metadata is already present')
else:
- self.to_screen('[info] Writing description playlist metadata as JSON to: ' + infofn)
+ self.to_screen('[info] Writing playlist metadata as JSON to: ' + infofn)
playlist_info = dict(ie_result)
playlist_info.pop('entries')
try:
write_json_file(self.filter_requested_info(playlist_info), infofn)
except (OSError, IOError):
- self.report_error('Cannot write playlist description metadata to JSON file ' + infofn)
+ self.report_error('Cannot write playlist metadata to JSON file ' + infofn)
if self.params.get('writedescription', False):
descfn = replace_extension(
- self.prepare_filepath(self.prepare_filename(ie_result), 'description'),
+ self.prepare_filepath(self.prepare_filename(ie_copy), 'description'),
'description', ie_result.get('ext'))
if not ensure_dir_exists(encodeFilename(descfn)):
return
if not ensure_dir_exists(encodeFilename(infofn)):
return
if not self.params.get('overwrites', True) and os.path.exists(encodeFilename(infofn)):
- self.to_screen('[info] Video description metadata is already present')
+ self.to_screen('[info] Video metadata is already present')
else:
- self.to_screen('[info] Writing video description metadata as JSON to: ' + infofn)
+ self.to_screen('[info] Writing video metadata as JSON to: ' + infofn)
try:
write_json_file(self.filter_requested_info(info_dict), infofn)
except (OSError, IOError):
- self.report_error('Cannot write metadata to JSON file ' + infofn)
+ self.report_error('Cannot write video metadata to JSON file ' + infofn)
return
info_dict['__infojson_filepath'] = infofn