From 23c1a66730133487ea00208a78036623cac61d2c Mon Sep 17 00:00:00 2001 From: pukkandan Date: Fri, 19 Mar 2021 16:05:32 +0530 Subject: [PATCH] Make sure `post_hook` gets the final filename --- yt_dlp/YoutubeDL.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index d5b1ba07c1..482f1fbac8 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -2459,13 +2459,13 @@ def correct_ext(filename): assert fixup_policy in ('ignore', 'never') try: - self.post_process(dl_filename, info_dict, files_to_move) + info_dict = self.post_process(dl_filename, info_dict, files_to_move) except PostProcessingError as err: self.report_error('Postprocessing: %s' % str(err)) return try: for ph in self._post_hooks: - ph(full_filename) + ph(info_dict['filepath']) except Exception as err: self.report_error('post hooks: %s' % str(err)) return @@ -2599,6 +2599,7 @@ def post_process(self, filename, ie_info, files_to_move=None): del info['__files_to_move'] for pp in self._pps['aftermove']: info = self.run_pp(pp, info) + return info def _make_archive_id(self, info_dict): video_id = info_dict.get('id')