mirror of
https://github.com/lampame/lampac-ukraine.git
synced 2026-04-16 17:32:20 +00:00
feat(animeon): return JSON response for play endpoint
The Play endpoint now returns a JSON response containing the stream URL and title
instead of redirecting directly. This allows for better client-side handling and
provides additional metadata to the frontend.
The response format is:
{
"method": "play",
"url": "<stream_url>",
"title": "<anime_title>"
}
This commit is contained in:
parent
0b1bd40a8f
commit
5bac03ad13
@ -279,7 +279,7 @@ namespace AnimeON.Controllers
|
||||
}
|
||||
|
||||
[HttpGet("animeon/play")]
|
||||
public async Task<ActionResult> Play(string url, int episode_id = 0)
|
||||
public async Task<ActionResult> Play(string url, int episode_id = 0, string title = null)
|
||||
{
|
||||
var init = await loadKit(ModInit.AnimeON);
|
||||
if (!init.enable)
|
||||
@ -309,8 +309,10 @@ namespace AnimeON.Controllers
|
||||
return OnError("animeon", proxyManager);
|
||||
}
|
||||
|
||||
OnLog("AnimeON Play: redirect to proxied stream");
|
||||
return Redirect(HostStreamProxy(init, accsArgs(streamLink)));
|
||||
string streamUrl = HostStreamProxy(init, accsArgs(streamLink));
|
||||
string jsonResult = $"{{\"method\":\"play\",\"url\":\"{streamUrl}\",\"title\":\"{title ?? string.Empty}\"}}";
|
||||
OnLog("AnimeON Play: return call JSON");
|
||||
return Content(jsonResult, "application/json; charset=utf-8");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user