Skip to content

Commit

Permalink
Windows: Sanitize Path of Resume Files
Browse files Browse the repository at this point in the history
  • Loading branch information
aandergr committed Jul 24, 2020
1 parent f71ea56 commit 5d7c363
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion instaloader/instaloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,13 +743,16 @@ def posts_download_loop(self,
"""
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
Expand Down

0 comments on commit 5d7c363

Please sign in to comment.