mirror of
https://github.com/NohamR/AM-Exporter.git
synced 2026-05-26 04:07:12 +00:00
test
This commit is contained in:
@@ -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__':
|
||||||
|
|||||||
@@ -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