Skip to content

Commit

Permalink
sanitized course folder name
Browse files Browse the repository at this point in the history
  • Loading branch information
swargaraj committed Oct 14, 2024
1 parent 65b3820 commit 192113c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def download_course(self, course_id, curriculum):
for _ in range(max_concurrent_lectures):
try:
mindex, chapter, lindex, lecture = next(task_generator)
folder_path = os.path.join(COURSE_DIR, f"{mindex}. {sanitize_filename(chapter['title'])}")
folder_path = os.path.join(COURSE_DIR, f"{mindex}. {remove_emojis_and_binary(sanitize_filename(chapter['title']))}")
temp_folder_path = os.path.join(folder_path, str(lecture['id']))
self.create_directory(temp_folder_path)
lect_info = self.fetch_lecture_info(course_id, lecture['id'])
Expand Down Expand Up @@ -398,7 +398,7 @@ def main():
skip_assignments = args.skip_assignments

course_info = udemy.fetch_course(course_id)
COURSE_DIR = os.path.join(DOWNLOAD_DIR, sanitize_filename(course_info['title']))
COURSE_DIR = os.path.join(DOWNLOAD_DIR, remove_emojis_and_binary(sanitize_filename(course_info['title'])))

logger.info(f"Course Title: {course_info['title']}")

Expand Down
2 changes: 1 addition & 1 deletion utils/process_mpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def process_mpd(mpd_file_path, download_folder_path, output_file_name, length, k
nm3u8dl_command = (
f"n_m3u8dl-re \"{mpd_file_path}\" --save-dir \"{download_folder_path}\" "
f"--save-name \"{output_file_name}.mp4\" --auto-select --concurrent-download "
f"--key {key} --del-after-done --no-log --tmp-dir \"{output_path}\" "
f"--key {key} --del-after-done --no-log --tmp-dir \"{download_folder_path}\" "
f"--log-level ERROR"
)

Expand Down

0 comments on commit 192113c

Please sign in to comment.