mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-06-08 22:38:35 +02:00
First pass at test feedback
This commit is contained in:
parent
5d51ddbbfc
commit
fe4a15ff75
|
@ -21,6 +21,9 @@ def pp_key(cls):
|
|||
|
||||
def expand_relative_paths(self, files_to_move, finaldir):
|
||||
for filetype in self.FILETYPE_KEYS:
|
||||
if filetype not in files_to_move:
|
||||
files_to_move[filetype] = []
|
||||
|
||||
for file_attrs in files_to_move[filetype]:
|
||||
if not os.path.isabs(file_attrs['final_filepath']):
|
||||
file_attrs['final_filepath'] = os.path.join(finaldir, file_attrs['final_filepath'])
|
||||
|
@ -45,8 +48,7 @@ def write_filepath_into_info(self, info, filetype, file_attrs):
|
|||
|
||||
def run(self, info):
|
||||
dl_path, dl_name = os.path.split(info['filepath'])
|
||||
finaldir = info.get('__finaldir', dl_path)
|
||||
info['__files_to_move']['media'] = []
|
||||
finaldir = info.get('__finaldir', os.path.abspath(dl_path))
|
||||
|
||||
if self._downloaded:
|
||||
info['__files_to_move']['media'] = [{'current_filepath': info['filepath'], 'final_filepath': dl_name}]
|
||||
|
@ -54,9 +56,6 @@ def run(self, info):
|
|||
files_to_move = self.expand_relative_paths(info['__files_to_move'], finaldir)
|
||||
|
||||
for filetype in self.FILETYPE_KEYS:
|
||||
if filetype not in files_to_move:
|
||||
continue
|
||||
|
||||
for file_attrs in files_to_move[filetype]:
|
||||
current_filepath = file_attrs['current_filepath']
|
||||
final_filepath = file_attrs['final_filepath']
|
||||
|
|
Loading…
Reference in New Issue
Block a user