mirror of
https://github.com/NohamR/AM-Exporter.git
synced 2026-05-24 19:58:34 +00:00
clean + script + .env
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -130,3 +130,6 @@ node_modules/
|
||||
|
||||
back/.users
|
||||
user/.env
|
||||
user/cmd
|
||||
user/exemple.plist
|
||||
user/test2.applescript
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||

|
||||

|
||||
|
||||

|
||||
|
||||
# To do :
|
||||
- SHA-256
|
||||
- not playing state (js)
|
||||
- readme
|
||||
- make script proper
|
||||
- comment
|
||||
|
||||
tail -f logfile.log
|
||||
@@ -10,6 +10,7 @@ from dotenv import load_dotenv
|
||||
load_dotenv()
|
||||
USER = os.getenv("USER")
|
||||
PASSWORD = os.getenv("PASSWORD")
|
||||
URL_API = os.getenv("URL_API")
|
||||
|
||||
stdout_file = 'logfile.log'
|
||||
stderr_file = 'error_logfile.log'
|
||||
@@ -57,7 +58,7 @@ def post(currentsong):
|
||||
currentsong['password'] = PASSWORD
|
||||
data = json.dumps(currentsong)
|
||||
try:
|
||||
r = requests.post(url+'/music/set', data=data, headers=headers)
|
||||
r = requests.post(URL_API+'/music/set', data=data, headers=headers)
|
||||
if r.status_code != 200:
|
||||
return r.status_code
|
||||
else :
|
||||
@@ -65,10 +66,6 @@ def post(currentsong):
|
||||
except Exception as e:
|
||||
print(f"An error occurred: {str(e)}", file=sys.stderr)
|
||||
|
||||
url = "https://api.noh.am" #RUN WEB
|
||||
url = "http://127.0.0.1:5000" #DEV
|
||||
url = "http://0.0.0.0:3005"
|
||||
|
||||
headers = {'Content-Type': 'application/json'}
|
||||
|
||||
def main():
|
||||
|
||||
Reference in New Issue
Block a user