also remove / character from video filenames

This commit is contained in:
Cyberes 2023-05-06 14:38:40 -06:00
parent 69fe86b1f0
commit caed0646b5
1 changed files with 2 additions and 2 deletions

View File

@ -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