diff --git a/tools/files.py b/tools/files.py index 9756add..66ae099 100644 --- a/tools/files.py +++ b/tools/files.py @@ -3,7 +3,9 @@ import os def get_created_files(id): if id[0] == "-": id = "_" + id[1:] # youtube-dl changes - to _ at the start, presumably to not accidentally trigger switches with * in shell - return (f for f in os.listdir() if f.startswith("{}_".format(id))) + id += "_" + trim_id = id.lstrip("-_") + return (f for f in os.listdir() if f.startswith(id) or f.startswith(trim_id)) def clean_up_temp_files(id): created_files = get_created_files(id)