diff --git a/download_server.py b/download_server.py index 87b921921feacc25b72444cc12fc55427c9a27d3..7c2d2b5fc4549d9ab86740c378f48a0237e5dbc8 100644 --- a/download_server.py +++ b/download_server.py @@ -12,7 +12,7 @@ from credentials import KEY caracteres = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_=+\';!?$%&#~<> " -remplacements = {"(":"-" , ")": "-" , "\"" : "\'","�":"e","�":"a","�":"e","�":"u","�":"e","�":"a","�":"o","�":"o" ,"�":"o","�":"i","�":"u","�":"U","/":" "} +remplacements = {"(":"-" , ")": "-" , "\"" : "\'","�":"e","�":"a","�":"e","�":"u","�":"e","�":"a","�":"o","�":"o" ,"�":"o","�":"i","�":"u","�":"U","/":" "} def replace(caract,remplacements) : if caract in remplacements.keys() : @@ -43,21 +43,21 @@ def addplaylist(playlistid): with open("playlistinfo.json",'r') as f : data = load(f) - if not playlistid in [x['id'] for x in data] : + if not playlistid in [x['id'] for x in data] : data.append({'id':playlistid,'name':playlistname}) - with open("playlistinfo.json",'w') as f : + with open("playlistinfo.json",'w') as f : f.write(dumps(data)) with open("playlists.json",'r') as f : data = load(f) - if not playlistid in data: + if not playlistid in data: data.append(playlistid) - with open("playlists.json",'w') as f : + with open("playlists.json",'w') as f : f.write(dumps(data)) @@ -95,9 +95,9 @@ while True : os.chdir("../..") - #A supprimer lorsque tout le code aura �t� fait proprement + #A supprimer lorsque tout le code aura �t� fait proprement if "seen_names.json" not in os.listdir("musics/"+playlist): - print("seen_names.json n\'est pas dans le r�pertoire de la playlist") + print("seen_names.json n\'est pas dans le r�pertoire de la playlist") with open("musics/"+playlist+"/seen_names.json",'w') as f : f.write("[]")