From 0f877b06bc3c57064514c3b476f1b8fe52c37fc7 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Sun, 28 Mar 2021 23:58:54 +1300 Subject: [PATCH] Fix temporary file removal --- tools/files.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)