From 8a13868db71e46b3c282e9bfb4a6f64511ceac75 Mon Sep 17 00:00:00 2001 From: Lomanic Date: Thu, 11 Nov 2021 18:35:05 +0100 Subject: [PATCH] Fix recommended videos extraction on some remaining IDs Example: https://www.youtube.com/watch?v=-_GDl6cBebQ https://github.com/yt-dlp/yt-dlp/blob/2e9a445bc34e79182f900909d727ba87f8487522/yt_dlp/extractor/common.py#L816 Amends f22decbb --- tools/files.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/files.py b/tools/files.py index 896531b..a69c4bf 100644 --- a/tools/files.py +++ b/tools/files.py @@ -3,12 +3,12 @@ import yt_dlp.utils def get_created_files(id): # youtube-dl transforms filenames when saving, for example changing - to _ at the start to presumbly not trigger switches in shell, but also in other strange ways too - sanitized_id = yt_dlp.utils.sanitize_filename(id) + sanitized_id = yt_dlp.utils.sanitize_filename(id, restricted=True) # all file names then have an underscore before the converted URL id += "_" sanitized_id += "_" - return (f for f in os.listdir() if f.startswith(id) or f.startswith(sanitized_id)) + return (f for f in os.listdir() if f.startswith(sanitized_id) or f.startswith(id)) def clean_up_temp_files(id): created_files = get_created_files(id)