Spaces:
Paused
Paused
Update app_parallel.py
Browse files- app_parallel.py +7 -4
app_parallel.py
CHANGED
@@ -388,15 +388,18 @@ async def get_concatenated_playlist(playlist: str):
|
|
388 |
Returns:
|
389 |
FileResponse: The concatenated playlist file.
|
390 |
"""
|
391 |
-
|
|
|
|
|
|
|
392 |
if not os.path.exists(playlist_path):
|
393 |
return jsonify({'status': 'error', "msg":"Playlist not found"}), 404
|
394 |
|
395 |
return send_file(playlist_path, mimetype='application/vnd.apple.mpegurl')
|
396 |
|
397 |
-
@app.route("/live_stream/<string:filename>", methods=["GET"])
|
398 |
-
def live_stream(filename):
|
399 |
-
|
400 |
|
401 |
@app.route("/health", methods=["GET"])
|
402 |
def health_status():
|
|
|
388 |
Returns:
|
389 |
FileResponse: The concatenated playlist file.
|
390 |
"""
|
391 |
+
if playlist.endswith('.ts'):
|
392 |
+
playlist_path = os.path.join('hls_videos', playlist)
|
393 |
+
else:
|
394 |
+
playlist_path = os.path.join('lives', playlist)
|
395 |
if not os.path.exists(playlist_path):
|
396 |
return jsonify({'status': 'error', "msg":"Playlist not found"}), 404
|
397 |
|
398 |
return send_file(playlist_path, mimetype='application/vnd.apple.mpegurl')
|
399 |
|
400 |
+
# @app.route("/live_stream/<string:filename>", methods=["GET"])
|
401 |
+
# def live_stream(filename):
|
402 |
+
# return send_from_directory(directory="hls_videos", filename=filename)
|
403 |
|
404 |
@app.route("/health", methods=["GET"])
|
405 |
def health_status():
|