fix: 播放分开的音轨,避免只有画面没有声音
This commit is contained in:
@@ -75,6 +75,16 @@ def play_segment(url: str):
|
||||
return StreamingResponse(chunks(), media_type=media)
|
||||
|
||||
|
||||
@router.get("/media")
|
||||
def play_media(url: str):
|
||||
target = _public_url(url)
|
||||
try:
|
||||
text = playlists.media_playlist(target)
|
||||
except RuntimeError as exc:
|
||||
raise HTTPException(status_code=502, detail=str(exc)) from exc
|
||||
return Response(text, media_type="application/vnd.apple.mpegurl", headers={"Cache-Control": "no-store"})
|
||||
|
||||
|
||||
@router.get("/{vid}/{cid}/index.m3u8")
|
||||
def episode_playlist(vid: int, cid: int):
|
||||
token = sessions.active_token()
|
||||
|
||||
Reference in New Issue
Block a user