mirror of
https://git.sr.ht/~cadence/NewLeaf
synced 2024-10-31 21:37:30 +00:00
12 lines
365 B
Python
12 lines
365 B
Python
|
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)))
|
||
|
|
||
|
def clean_up_temp_files(id):
|
||
|
created_files = get_created_files(id)
|
||
|
for file in created_files:
|
||
|
os.unlink(file)
|