From 5bac03ad1366c9d17a9b2adfa9a949f5188981c0 Mon Sep 17 00:00:00 2001 From: baliasnyifeliks Date: Tue, 13 Jan 2026 09:49:07 +0200 Subject: [PATCH] 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": "", "title": "" } --- AnimeON/Controller.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/AnimeON/Controller.cs b/AnimeON/Controller.cs index a828598..b376cb1 100644 --- a/AnimeON/Controller.cs +++ b/AnimeON/Controller.cs @@ -279,7 +279,7 @@ namespace AnimeON.Controllers } [HttpGet("animeon/play")] - public async Task Play(string url, int episode_id = 0) + public async Task 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"); } } }