From 5d7c36399f4ec75a07fde842378c682420317f83 Mon Sep 17 00:00:00 2001 From: Alexander Graf <17130992+aandergr@users.noreply.github.com> Date: Fri, 24 Jul 2020 18:19:52 +0200 Subject: [PATCH] Windows: Sanitize Path of Resume Files --- instaloader/instaloader.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/instaloader/instaloader.py b/instaloader/instaloader.py index 93a0da1..f4e7507 100644 --- a/instaloader/instaloader.py +++ b/instaloader/instaloader.py @@ -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 else total_count) + sanitized_target = target + if isinstance(target, str): + sanitized_target = _PostPathFormatter.sanitize_path(target) with resumable_iteration( context=self.context, iterator=posts, load=load_structure_from_file, save=save_structure_to_file, 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, enabled=self.resume_prefix is not None