mirror of
https://github.com/NohamR/AM-Exporter.git
synced 2026-11-25 23:05:18 +00:00
test
This commit is contained in:
1 parent
ed71e77b1c
commit
961ff7439f
2 files changed
+7
-3
No files matched your search
+5
-2
@@ -8,8 +8,6 @@ CORS(app, resources={r"/music/*": {"origins": "http://*"}})
|
|||||||
with open('.users', 'r') as file:
|
with open('.users', 'r') as file:
|
||||||
users = json.load(file)
|
users = json.load(file)
|
||||||
|
|
||||||
print(users)
|
|
||||||
|
|
||||||
@app.route('/music/set', methods=['POST'])
|
@app.route('/music/set', methods=['POST'])
|
||||||
def set_content():
|
def set_content():
|
||||||
global cache
|
global cache
|
||||||
@@ -18,12 +16,17 @@ def set_content():
|
|||||||
for key in ['user', 'password']:
|
for key in ['user', 'password']:
|
||||||
if key in cache:
|
if key in cache:
|
||||||
del cache[key]
|
del cache[key]
|
||||||
|
# with open('cache.txt', 'w') as f:
|
||||||
|
# f.write(str(cache))
|
||||||
return jsonify({'message': 'Content set successfully.'})
|
return jsonify({'message': 'Content set successfully.'})
|
||||||
else:
|
else:
|
||||||
return jsonify({'message': 'Invalid user or password.'})
|
return jsonify({'message': 'Invalid user or password.'})
|
||||||
|
|
||||||
@app.route('/music/get', methods=['GET'])
|
@app.route('/music/get', methods=['GET'])
|
||||||
def display_content():
|
def display_content():
|
||||||
|
global cache
|
||||||
|
# with open('cache.txt', 'r') as f:
|
||||||
|
# cache = f.read()
|
||||||
return jsonify(cache)
|
return jsonify(cache)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
+2
-1
@@ -43,7 +43,8 @@ def post(currentsong):
|
|||||||
else :
|
else :
|
||||||
return r.text
|
return r.text
|
||||||
|
|
||||||
url = "http://192.168.1.58:3005"
|
url = "http://192.168.1.58:3005" #RUN
|
||||||
|
url = "http://127.0.0.1:5000" #DEV
|
||||||
headers = {'Content-Type': 'application/json'}
|
headers = {'Content-Type': 'application/json'}
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
Reference in new issue
Block a user