Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Can't handle chapter & lecture names with backtick "`" #242

Open
914840 opened this issue Sep 4, 2024 · 0 comments
Open

[Bug]: Can't handle chapter & lecture names with backtick "`" #242

914840 opened this issue Sep 4, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@914840
Copy link

914840 commented Sep 4, 2024

What happened?

Freeze at Merging video and audio, this might take a minute when downloading lectures that have backtick in their chapter/lecture name.

[12:18:31] [udemy-downloader] [handle_segments:1249] INFO: > Lecture Tracks Downloaded
[12:18:31] [udemy-downloader] [handle_segments:1260] INFO: KID for video file is: xxx
[12:18:31] [udemy-downloader] [handle_segments:1267] INFO: KID for audio file is: xxx
[12:18:31] [udemy-downloader] [handle_segments:1306] INFO: > Merging video and audio, this might take a minute...

Replace backticks like this fix the problem:

> git diff main.py
diff --git a/main.py b/main.py
index affcdc8..08d965e 100644
--- a/main.py
+++ b/main.py
@@ -1191,6 +1191,7 @@ def mux_process(
     transcode = "-hwaccel cuda -hwaccel_output_format cuda" if use_nvenc else ""
     audio_decryption_arg = f"-decryption_key {audio_key}" if audio_key is not None else ""
     video_decryption_arg = f"-decryption_key {video_key}" if video_key is not None else ""
+    video_title = video_title.replace("`","")

     if os.name == "nt":
         if use_h265:
@@ -1608,7 +1609,7 @@ def parse_new(udemy: Udemy, udemy_object: dict):
         os.mkdir(course_dir)

     for chapter in udemy_object.get("chapters"):
-        chapter_title = chapter.get("chapter_title")
+        chapter_title = chapter.get("chapter_title").replace("`","")
         chapter_index = chapter.get("chapter_index")
         chapter_dir = os.path.join(course_dir, chapter_title)
         if not os.path.exists(chapter_dir):

Expected Result

  • Handle names with backtick and merge files properly.

Branch

master/main

What operating systems are you seeing the problem on?

Linux/Unix

Relevant log output

No response

Other information

No response

@914840 914840 added the bug Something isn't working label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants