mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
FIx
Config reorg
This commit is contained in:
@@ -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():
|
||||
"""
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user