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

|

|
||||||

|

|
||||||
|
|
||||||
|

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