Ajout dans le code de la création du dossier downloads si ce dernier n'existe pas

This commit is contained in:
Gu1llaum-3 2023-01-07 17:17:46 +01:00
parent cfd041495c
commit fab1815e7f

4
app.py
View File

@ -13,6 +13,10 @@ def process_file(urls):
download_param_album = '{artist}/{album}/{artist} - {title}'
download_param_playlist = '{playlist}/{artists}/{album} - {title} {artist}'
# Créer le dossier 'downloads' s'il n'existe pas
if not os.path.exists('downloads'):
os.makedirs('downloads')
os.chdir('downloads')
os.system(f'rm -rf *')