From df0b01cb99ebd0e6e1cf0590e826e13d4d3f2ab9 Mon Sep 17 00:00:00 2001 From: BuildTools <unconfigured@null.spigotmc.org> Date: Fri, 11 Nov 2022 18:58:05 +0100 Subject: [PATCH] =?UTF-8?q?am=C3=A9lioration=20de=20download=5Fserver?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- download_server.py | 16 ++++++++-------- start.sh | 11 ++++++++++- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/download_server.py b/download_server.py index acbccb6..87b9219 100644 --- a/download_server.py +++ b/download_server.py @@ -11,8 +11,8 @@ from credentials import KEY #commande test : "yt-dlp -f 'ba' -x --audio-format mp3 https://www.youtube.com/watch?v=zA2YBT9z6pA -o '%(id)s.mp3' " -caracteres = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_=+\';,:!?$%&#~<> " -remplacements = {"(":"-" , ")": "-" , "\"" : "\'","�":"e","�":"a","�":"e","�":"u","�":"e","�":"a","�":"o","�":"i","�":"u","�":"U","/":" "} +caracteres = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_=+\';!?$%&#~<> " +remplacements = {"(":"-" , ")": "-" , "\"" : "\'","�":"e","�":"a","�":"e","�":"u","�":"e","�":"a","�":"o","�":"o" ,"�":"o","�":"i","�":"u","�":"U","/":" "} def replace(caract,remplacements) : if caract in remplacements.keys() : @@ -42,23 +42,23 @@ def addplaylist(playlistid): with open("playlistinfo.json",'r') as f : data = load(f) - + if not playlistid in [x['id'] for x in data] : - data.append({'id':playlistid,'name':playlistname}) + data.append({'id':playlistid,'name':playlistname}) with open("playlistinfo.json",'w') as f : - f.write(dumps(data)) + f.write(dumps(data)) with open("playlists.json",'r') as f : data = load(f) if not playlistid in data: - data.append(playlistid) + data.append(playlistid) with open("playlists.json",'w') as f : - f.write(dumps(data)) + f.write(dumps(data)) @@ -81,7 +81,7 @@ while True : for playlist in data : if playlist not in os.listdir("musics"): - print("La playlist " + playlist + " n\'est pas dans le r�pertoire" ) + print("La playlist " + playlist + " n\'est pas dans le repertoire" ) os.chdir("musics") os.mkdir(playlist) diff --git a/start.sh b/start.sh index d605625..73edc1a 100755 --- a/start.sh +++ b/start.sh @@ -1,4 +1,13 @@ #!/bin/bash -screen -S music_downloading python download_server.py +### BEGIN INIT INFO +# Provides: bleezrstart +# Required-Start: $all +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: +# Short-Description: Begins bleezr server and service +### END INIT INFO + +screen -dmS music_downloading python3 /home/pi/bleezr/bleezr/download_server.py -- GitLab