Windows: Sanitize Path of Resume Files

This commit is contained in:
Alexander Graf 2020-07-24 18:19:52 +02:00
parent f71ea562af
commit 5d7c36399f

View File

@ -743,13 +743,16 @@ class Instaloader:
""" """
displayed_count = (max_count if total_count is None or max_count is not None and max_count < total_count displayed_count = (max_count if total_count is None or max_count is not None and max_count < total_count
else total_count) else total_count)
sanitized_target = target
if isinstance(target, str):
sanitized_target = _PostPathFormatter.sanitize_path(target)
with resumable_iteration( with resumable_iteration(
context=self.context, context=self.context,
iterator=posts, iterator=posts,
load=load_structure_from_file, load=load_structure_from_file,
save=save_structure_to_file, save=save_structure_to_file,
format_path=lambda magic: self.format_filename_within_target_path( format_path=lambda magic: self.format_filename_within_target_path(
target, owner_profile, self.resume_prefix or '', magic, 'json.xz' sanitized_target, owner_profile, self.resume_prefix or '', magic, 'json.xz'
), ),
check_bbd=self.check_resume_bbd, check_bbd=self.check_resume_bbd,
enabled=self.resume_prefix is not None enabled=self.resume_prefix is not None