bug fix for logging

This commit is contained in:
Puyodead1 2022-01-16 17:24:07 -05:00
parent 4326c4743a
commit 1bdc581c65

16
main.py
View File

@ -1090,9 +1090,7 @@ def mux_process(video_title, video_filepath, audio_filepath, output_path):
process = subprocess.Popen(
command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
with process.stdout:
log_subprocess_output("FFMPEG-STDOUT", process.stdout)
with process.stderr:
log_subprocess_output("FFMPEG-STDERR", process.stderr)
ret_code = process.wait()
if ret_code != 0:
@ -1114,9 +1112,7 @@ def decrypt(kid, in_filepath, out_filepath):
process = subprocess.Popen(
command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
with process.stdout:
log_subprocess_output("SHAKA-STDOUT", process.stdout)
with process.stderr:
log_subprocess_output("SHAKA-STDERR", process.stderr)
ret_code = process.wait()
if ret_code != 0:
@ -1151,9 +1147,7 @@ def handle_segments(url, format_id, video_title,
args.append("aria2c:\"--disable-ipv6\"")
process = subprocess.Popen(
args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
with process.stdout:
log_subprocess_output("YTDLP-STDOUT", process.stdout)
with process.stderr:
log_subprocess_output("YTDLP-STDERR", process.stderr)
ret_code = process.wait()
logger.info("> Lecture Tracks Downloaded")
@ -1291,9 +1285,7 @@ def download_aria(url, file_dir, filename):
if disable_ipv6:
args.append("--disable-ipv6")
process = subprocess.Popen(args)
with process.stdout:
log_subprocess_output("ARIA2-STDOUT", process.stdout)
with process.stderr:
log_subprocess_output("ARIA2-STDERR", process.stderr)
ret_code = process.wait()
if ret_code != 0:
@ -1392,12 +1384,8 @@ def process_lecture(lecture, lecture_path, lecture_file_name, chapter_dir):
args.append("--downloader-args")
args.append("aria2c:\"--disable-ipv6\"")
process = subprocess.Popen(args)
with process.stdout:
log_subprocess_output(
"YTDLP-STDOUT", process.stdout)
with process.stderr:
log_subprocess_output(
"YTDLP-STDERR", process.stderr)
log_subprocess_output("YTDLP-STDOUT", process.stdout)
log_subprocess_output("YTDLP-STDERR", process.stderr)
ret_code = process.wait()
if ret_code == 0:
# os.rename(temp_filepath, lecture_path)