mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-20 00:32:16 +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():
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user