From caed0646b52d60706cb5fb3700f6ace598b699db Mon Sep 17 00:00:00 2001 From: Cyberes Date: Sat, 6 May 2023 14:38:40 -0600 Subject: [PATCH] also remove / character from video filenames --- process/threads.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/process/threads.py b/process/threads.py index d6ce2d4..56ad0e6 100644 --- a/process/threads.py +++ b/process/threads.py @@ -113,7 +113,7 @@ def download_video(args) -> dict: video['title'] = unidecode(video['title']) video['uploader'] = unidecode(video['uploader']) video_filename = ydl.get_output_templ(video_id=video['id'], title=video['title'], uploader=video['uploader'], uploader_id=video['uploader_id'], include_ext=False) - base_path = str(Path(kwargs['output_dir'], video_filename)) + base_path = remove_special_chars_linux(str(Path(kwargs['output_dir'], video_filename)), special_chars=['/']) kwargs['ydl_opts']['outtmpl'] = f"{base_path}.%(ext)s" # try: @@ -122,7 +122,7 @@ def download_video(args) -> dict: # # Sometimes we won't be able to pull the video info so just use the video's ID. # base_path = kwargs['output_dir'] / video['id'] - ylogger = ytdl_logger(setup_file_logger(video['id'], remove_special_chars_linux(base_path, special_chars=['/']) + '.log')) + ylogger = ytdl_logger(setup_file_logger(video['id'], base_path + '.log')) kwargs['ydl_opts']['logger'] = ylogger yt_dlp = ydl.YDL(kwargs['ydl_opts']) # recreate the object with the correct logging path error_code = yt_dlp(video['url']) # Do the download