Skip to content

Commit

Permalink
Fix zip file's local destination folder not being sanitized
Browse files Browse the repository at this point in the history
  • Loading branch information
lendenmc committed Dec 2, 2016
1 parent baab3f3 commit 6868634
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ifskills-dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def test_working_files(self):
print("No working files for this course")
return
wf_name = self.title + " - " + "Working Files"
if os.path.exists(self.title + '/' + wf_name):
if os.path.exists(self.sanitize_filename(self.title) + '/' + wf_name):
print("Working files already downloaded for this course")
return
return True
Expand Down Expand Up @@ -509,11 +509,12 @@ def stream_working_files(zip_file, local_filename_prefix):
course = Course(course_id, course_content, session)
course.makedirs()
if course.test_working_files():
local_folder = course.sanitize_filename(course.title)
zip_url = course.fetch_zip_url()
msg = "Downloading course working files"
print_msg(msg, url=zip_url.strip('\n'))
zip_file = course.download(zip_url)
course.stream_working_files(zip_file, course.title)
course.stream_working_files(zip_file, local_folder)
print()
for lecture in course.lectures:
local_file = course.make_filename(lecture)
Expand Down

0 comments on commit 6868634

Please sign in to comment.