Config reorg
This commit is contained in:
2024-04-17 10:52:47 +01:00
committed by migatu
parent 8293b3a69c
commit f3e690f395
2 changed files with 17 additions and 1 deletions
+16
View File
@@ -183,6 +183,22 @@ def remove_characters(string, character):
return string.replace(character, "")
@app.route("/stream", methods=["GET"])
async def stream_music():
"""
The function `get_music_list` returns a JSON object containing a list of music files.
:return: A JSON response containing a key "music_file_list" with the value of the variable
`music_file_list`.
"""
try:
m3u8 = Path("/tmp/hls/stream.m3u8")
r = Response(m3u8)
r.headers["Content-Type"] = "application/mpegURL"
return r, 200
except FileNotFoundError:
return jsonify({"error": "No stream available"}), 404
@app.route("/mp3", methods=["GET"])
def get_music_list():
"""
+1 -1
View File
@@ -4,7 +4,7 @@ After=multi-user.target
[Service]
Type=simple
ExecStart=/home/pi/Conjurer-service/conjurer/file_webservice/bin/python3 /home/pi/Conjurer-service/conjurer/file_webservice/conjurer_musician.py
ExecStart=/home/pi/Conjurer/env/bin/python3 /home/pi/Conjurer/conjurer_musician.py
Restart=on-abort
[Install]