mirror of
https://cdm-project.com/Download-Tools/udemy-downloader.git
synced 2025-04-30 01:54:25 +02:00
commit
3478095bb5
13
main.py
13
main.py
@ -55,6 +55,7 @@ def log_subprocess_output(prefix: str, pipe: IO[bytes]):
|
||||
if pipe:
|
||||
for line in iter(pipe.readline, b''): # b'\n'-separated lines
|
||||
logger.debug('[%s]: %r', prefix, line.decode("utf8").strip())
|
||||
pipe.flush()
|
||||
|
||||
|
||||
# this is the first function that is called, we parse the arguments, setup the logger, and ensure that required directories exist
|
||||
@ -640,7 +641,7 @@ class Udemy:
|
||||
url = COURSE_URL.format(portal_name=portal_name, course_id=course_id)
|
||||
try:
|
||||
resp = self.session._get(url)
|
||||
if resp.status_code in [502, 503]:
|
||||
if resp.status_code in [502, 503, 504]:
|
||||
logger.info(
|
||||
"> The course content is large, using large content extractor..."
|
||||
)
|
||||
@ -1083,14 +1084,14 @@ def mux_process(video_title, video_filepath, audio_filepath, output_path):
|
||||
@author Jayapraveen
|
||||
"""
|
||||
if os.name == "nt":
|
||||
command = "ffmpeg -y -i \"{}\" -i \"{}\" -acodec copy -vcodec copy -fflags +bitexact -map_metadata -1 -metadata title=\"{}\" \"{}\"".format(
|
||||
command = "ffmpeg -nostdin -loglevel error -y -i \"{}\" -i \"{}\" -acodec copy -vcodec copy -fflags +bitexact -map_metadata -1 -metadata title=\"{}\" \"{}\"".format(
|
||||
video_filepath, audio_filepath, video_title, output_path)
|
||||
else:
|
||||
command = "nice -n 7 ffmpeg -y -i \"{}\" -i \"{}\" -acodec copy -vcodec copy -fflags +bitexact -map_metadata -1 -metadata title=\"{}\" \"{}\"".format(
|
||||
command = "nice -n 7 ffmpeg -nostdin -loglevel error -y -i \"{}\" -i \"{}\" -acodec copy -vcodec copy -fflags +bitexact -map_metadata -1 -metadata title=\"{}\" \"{}\"".format(
|
||||
video_filepath, audio_filepath, video_title, output_path)
|
||||
|
||||
process = subprocess.Popen(
|
||||
command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
command, shell=True)
|
||||
log_subprocess_output("FFMPEG-STDOUT", process.stdout)
|
||||
log_subprocess_output("FFMPEG-STDERR", process.stderr)
|
||||
ret_code = process.wait()
|
||||
@ -1112,7 +1113,7 @@ def decrypt(kid, in_filepath, out_filepath):
|
||||
command = f"nice -n 7 shaka-packager --enable_raw_key_decryption --keys key_id={kid}:key={key} input=\"{in_filepath}\",stream_selector=\"0\",output=\"{out_filepath}\""
|
||||
|
||||
process = subprocess.Popen(
|
||||
command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
command, shell=True)
|
||||
log_subprocess_output("SHAKA-STDOUT", process.stdout)
|
||||
log_subprocess_output("SHAKA-STDERR", process.stderr)
|
||||
ret_code = process.wait()
|
||||
@ -1147,7 +1148,7 @@ def handle_segments(url, format_id, video_title,
|
||||
args.append("--downloader-args")
|
||||
args.append("aria2c:\"--disable-ipv6\"")
|
||||
process = subprocess.Popen(
|
||||
args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
args)
|
||||
log_subprocess_output("YTDLP-STDOUT", process.stdout)
|
||||
log_subprocess_output("YTDLP-STDERR", process.stderr)
|
||||
ret_code = process.wait()
|
||||
|
Loading…
x
Reference in New Issue
Block a user