use os.path.join
This commit is contained in:
parent
a41f88d6b6
commit
bd7d25ff97
@ -38,7 +38,7 @@ def download(path, file):
|
||||
)
|
||||
except subprocess.CalledProcessError:
|
||||
print(f"Removing {path}/{file}")
|
||||
os.remove(f"{path}/{file}")
|
||||
os.remove(os.path.join(path, file))
|
||||
print("Waiting for 10 minutes ...")
|
||||
time.sleep(10 * 60)
|
||||
download(path, file)
|
||||
@ -78,11 +78,11 @@ def remove(path):
|
||||
to_remove = []
|
||||
|
||||
for name in os.listdir(path):
|
||||
if os.path.isfile(f"{path}/{name}"):
|
||||
if os.path.isfile(os.path.join(path, name)):
|
||||
id = get_title_shortid(name)
|
||||
|
||||
if not id:
|
||||
to_remove.append(f"{path}/{name}")
|
||||
to_remove.append(os.path.join(path, name))
|
||||
|
||||
if len(to_remove) > 100:
|
||||
print("Too much to delete:")
|
||||
|
Loading…
Reference in New Issue
Block a user