1
0
Fork 0

Add pre-processor stage video

Related: #456, #5808
This commit is contained in:
pukkandan 2022-12-30 11:15:41 +05:30
commit 119e40ef64
No known key found for this signature in database
GPG key ID: 7EEE9E1E817D0A39
4 changed files with 59 additions and 57 deletions

View file

@ -2977,6 +2977,16 @@ class YoutubeDL:
# Does nothing under normal operation - for backward compatibility of process_info
self.post_extract(info_dict)
def replace_info_dict(new_info):
nonlocal info_dict
if new_info == info_dict:
return
info_dict.clear()
info_dict.update(new_info)
new_info, _ = self.pre_process(info_dict, 'video')
replace_info_dict(new_info)
self._num_downloads += 1
# info_dict['_filename'] needs to be set for backward compatibility
@ -3090,13 +3100,6 @@ class YoutubeDL:
for link_type, should_write in write_links.items()):
return
def replace_info_dict(new_info):
nonlocal info_dict
if new_info == info_dict:
return
info_dict.clear()
info_dict.update(new_info)
new_info, files_to_move = self.pre_process(info_dict, 'before_dl', files_to_move)
replace_info_dict(new_info)