mirror of
https://github.com/lampame/lampac-ukraine.git
synced 2026-04-16 09:22:21 +00:00
feat(controllers): add checksearch parameter support across all streaming service controllers
Add checksearch functionality to validate online search availability for multiple streaming services including AnimeON, Bamboo, CikavaIdeya, Makhno, Mikai, StarLight, UAKino, UaTUT, Uaflix, and Unimay controllers. Each controller now supports a checksearch parameter that returns appropriate responses when online search validation is enabled.
This commit is contained in:
parent
6ea1a5febe
commit
371a54f759
@ -28,7 +28,7 @@ namespace AnimeON.Controllers
|
||||
|
||||
[HttpGet]
|
||||
[Route("animeon")]
|
||||
async public Task<ActionResult> Index(long id, string imdb_id, long kinopoisk_id, string title, string original_title, string original_language, int year, string source, int serial, string account_email, string t, int s = -1, bool rjson = false)
|
||||
async public Task<ActionResult> Index(long id, string imdb_id, long kinopoisk_id, string title, string original_title, string original_language, int year, string source, int serial, string account_email, string t, int s = -1, bool rjson = false, bool checksearch = false)
|
||||
{
|
||||
await UpdateService.ConnectAsync(host);
|
||||
|
||||
@ -37,6 +37,19 @@ namespace AnimeON.Controllers
|
||||
return Forbid();
|
||||
|
||||
var invoke = new AnimeONInvoke(init, hybridCache, OnLog, proxyManager);
|
||||
|
||||
if (checksearch)
|
||||
{
|
||||
if (AppInit.conf?.online?.checkOnlineSearch != true)
|
||||
return OnError("animeon", proxyManager);
|
||||
|
||||
var seasons = await invoke.Search(imdb_id, kinopoisk_id, title, original_title, year, serial);
|
||||
if (seasons != null && seasons.Count > 0)
|
||||
return Content("data-json=", "text/plain; charset=utf-8");
|
||||
|
||||
return OnError("animeon", proxyManager);
|
||||
}
|
||||
|
||||
OnLog($"AnimeON Index: title={title}, original_title={original_title}, serial={serial}, s={s}, t={t}, year={year}, imdb_id={imdb_id}, kp={kinopoisk_id}");
|
||||
|
||||
var seasons = await invoke.Search(imdb_id, kinopoisk_id, title, original_title, year, serial);
|
||||
|
||||
@ -24,7 +24,7 @@ namespace Bamboo.Controllers
|
||||
|
||||
[HttpGet]
|
||||
[Route("bamboo")]
|
||||
async public Task<ActionResult> Index(long id, string imdb_id, long kinopoisk_id, string title, string original_title, string original_language, int year, string source, int serial, string account_email, string t, int s = -1, bool rjson = false, string href = null)
|
||||
async public Task<ActionResult> Index(long id, string imdb_id, long kinopoisk_id, string title, string original_title, string original_language, int year, string source, int serial, string account_email, string t, int s = -1, bool rjson = false, string href = null, bool checksearch = false)
|
||||
{
|
||||
await UpdateService.ConnectAsync(host);
|
||||
|
||||
@ -34,6 +34,18 @@ namespace Bamboo.Controllers
|
||||
|
||||
var invoke = new BambooInvoke(init, hybridCache, OnLog, proxyManager);
|
||||
|
||||
if (checksearch)
|
||||
{
|
||||
if (AppInit.conf?.online?.checkOnlineSearch != true)
|
||||
return OnError("bamboo", proxyManager);
|
||||
|
||||
var searchResults = await invoke.Search(title, original_title);
|
||||
if (searchResults != null && searchResults.Count > 0)
|
||||
return Content("data-json=", "text/plain; charset=utf-8");
|
||||
|
||||
return OnError("bamboo", proxyManager);
|
||||
}
|
||||
|
||||
string itemUrl = href;
|
||||
if (string.IsNullOrEmpty(itemUrl))
|
||||
{
|
||||
|
||||
@ -27,7 +27,7 @@ namespace CikavaIdeya.Controllers
|
||||
|
||||
[HttpGet]
|
||||
[Route("cikavaideya")]
|
||||
async public Task<ActionResult> Index(long id, string imdb_id, long kinopoisk_id, string title, string original_title, string original_language, int year, string source, int serial, string account_email, string t, int s = -1, int e = -1, bool play = false, bool rjson = false)
|
||||
async public Task<ActionResult> Index(long id, string imdb_id, long kinopoisk_id, string title, string original_title, string original_language, int year, string source, int serial, string account_email, string t, int s = -1, int e = -1, bool play = false, bool rjson = false, bool checksearch = false)
|
||||
{
|
||||
await UpdateService.ConnectAsync(host);
|
||||
|
||||
@ -37,6 +37,18 @@ namespace CikavaIdeya.Controllers
|
||||
|
||||
var invoke = new CikavaIdeyaInvoke(init, hybridCache, OnLog, proxyManager);
|
||||
|
||||
if (checksearch)
|
||||
{
|
||||
if (AppInit.conf?.online?.checkOnlineSearch != true)
|
||||
return OnError("cikavaideya", proxyManager);
|
||||
|
||||
var episodesInfo = await invoke.Search(imdb_id, kinopoisk_id, title, original_title, year, serial == 0);
|
||||
if (episodesInfo != null && episodesInfo.Count > 0)
|
||||
return Content("data-json=", "text/plain; charset=utf-8");
|
||||
|
||||
return OnError("cikavaideya", proxyManager);
|
||||
}
|
||||
|
||||
var episodesInfo = await invoke.Search(imdb_id, kinopoisk_id, title, original_title, year, serial == 0);
|
||||
if (episodesInfo == null)
|
||||
return Content("CikavaIdeya", "text/html; charset=utf-8");
|
||||
|
||||
@ -27,7 +27,12 @@ namespace Makhno
|
||||
public async Task<ActionResult> Index(long id, string imdb_id, long kinopoisk_id, string title, string original_title, string original_language, int year, string source, int serial, string account_email, string t, int s = -1, int season = -1, bool rjson = false, bool checksearch = false)
|
||||
{
|
||||
if (checksearch)
|
||||
return Content("data-json=");
|
||||
{
|
||||
if (AppInit.conf?.online?.checkOnlineSearch != true)
|
||||
return OnError();
|
||||
|
||||
return Content("data-json=", "text/plain; charset=utf-8");
|
||||
}
|
||||
|
||||
await UpdateService.ConnectAsync(host);
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@ namespace Mikai.Controllers
|
||||
|
||||
[HttpGet]
|
||||
[Route("mikai")]
|
||||
public async Task<ActionResult> Index(long id, string imdb_id, long kinopoisk_id, string title, string original_title, string original_language, int year, string source, int serial, string account_email, string t, int s = -1, bool rjson = false)
|
||||
public async Task<ActionResult> Index(long id, string imdb_id, long kinopoisk_id, string title, string original_title, string original_language, int year, string source, int serial, string account_email, string t, int s = -1, bool rjson = false, bool checksearch = false)
|
||||
{
|
||||
await UpdateService.ConnectAsync(host);
|
||||
|
||||
@ -33,6 +33,19 @@ namespace Mikai.Controllers
|
||||
return Forbid();
|
||||
|
||||
var invoke = new MikaiInvoke(init, hybridCache, OnLog, _proxyManager);
|
||||
|
||||
if (checksearch)
|
||||
{
|
||||
if (AppInit.conf?.online?.checkOnlineSearch != true)
|
||||
return OnError("mikai", _proxyManager);
|
||||
|
||||
var searchResults = await invoke.Search(title, original_title, year);
|
||||
if (searchResults != null && searchResults.Count > 0)
|
||||
return Content("data-json=", "text/plain; charset=utf-8");
|
||||
|
||||
return OnError("mikai", _proxyManager);
|
||||
}
|
||||
|
||||
OnLog($"Mikai Index: title={title}, original_title={original_title}, serial={serial}, s={s}, t={t}, year={year}");
|
||||
|
||||
var searchResults = await invoke.Search(title, original_title, year);
|
||||
|
||||
@ -25,7 +25,7 @@ namespace StarLight.Controllers
|
||||
|
||||
[HttpGet]
|
||||
[Route("starlight")]
|
||||
async public Task<ActionResult> Index(long id, string imdb_id, long kinopoisk_id, string title, string original_title, string original_language, int year, string source, int serial, string account_email, int s = -1, bool rjson = false, string href = null)
|
||||
async public Task<ActionResult> Index(long id, string imdb_id, long kinopoisk_id, string title, string original_title, string original_language, int year, string source, int serial, string account_email, int s = -1, bool rjson = false, string href = null, bool checksearch = false)
|
||||
{
|
||||
await UpdateService.ConnectAsync(host);
|
||||
|
||||
@ -35,6 +35,18 @@ namespace StarLight.Controllers
|
||||
|
||||
var invoke = new StarLightInvoke(init, hybridCache, OnLog, proxyManager);
|
||||
|
||||
if (checksearch)
|
||||
{
|
||||
if (AppInit.conf?.online?.checkOnlineSearch != true)
|
||||
return OnError("starlight", proxyManager);
|
||||
|
||||
var searchResults = await invoke.Search(title, original_title);
|
||||
if (searchResults != null && searchResults.Count > 0)
|
||||
return Content("data-json=", "text/plain; charset=utf-8");
|
||||
|
||||
return OnError("starlight", proxyManager);
|
||||
}
|
||||
|
||||
string itemUrl = href;
|
||||
if (string.IsNullOrEmpty(itemUrl))
|
||||
{
|
||||
|
||||
@ -23,7 +23,7 @@ namespace UAKino.Controllers
|
||||
|
||||
[HttpGet]
|
||||
[Route("uakino")]
|
||||
async public Task<ActionResult> Index(long id, string imdb_id, long kinopoisk_id, string title, string original_title, string original_language, int year, string source, int serial, string account_email, string t, bool rjson = false, string href = null)
|
||||
async public Task<ActionResult> Index(long id, string imdb_id, long kinopoisk_id, string title, string original_title, string original_language, int year, string source, int serial, string account_email, string t, bool rjson = false, string href = null, bool checksearch = false)
|
||||
{
|
||||
await UpdateService.ConnectAsync(host);
|
||||
|
||||
@ -33,6 +33,18 @@ namespace UAKino.Controllers
|
||||
|
||||
var invoke = new UAKinoInvoke(init, hybridCache, OnLog, proxyManager);
|
||||
|
||||
if (checksearch)
|
||||
{
|
||||
if (AppInit.conf?.online?.checkOnlineSearch != true)
|
||||
return OnError("uakino", proxyManager);
|
||||
|
||||
var searchResults = await invoke.Search(title, original_title, serial);
|
||||
if (searchResults != null && searchResults.Count > 0)
|
||||
return Content("data-json=", "text/plain; charset=utf-8");
|
||||
|
||||
return OnError("uakino", proxyManager);
|
||||
}
|
||||
|
||||
string itemUrl = href;
|
||||
if (string.IsNullOrEmpty(itemUrl))
|
||||
{
|
||||
|
||||
@ -25,7 +25,7 @@ namespace UaTUT
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
async public Task<ActionResult> Index(long id, string imdb_id, long kinopoisk_id, string title, string original_title, string original_language, int year, string source, int serial, string account_email, string t, int s = -1, int season = -1, bool rjson = false)
|
||||
async public Task<ActionResult> Index(long id, string imdb_id, long kinopoisk_id, string title, string original_title, string original_language, int year, string source, int serial, string account_email, string t, int s = -1, int season = -1, bool rjson = false, bool checksearch = false)
|
||||
{
|
||||
await UpdateService.ConnectAsync(host);
|
||||
|
||||
@ -45,6 +45,17 @@ namespace UaTUT
|
||||
return await invoke.Search(original_title ?? title, imdb_id);
|
||||
});
|
||||
|
||||
if (checksearch)
|
||||
{
|
||||
if (AppInit.conf?.online?.checkOnlineSearch != true)
|
||||
return OnError();
|
||||
|
||||
if (searchResults != null && searchResults.Any())
|
||||
return Content("data-json=", "text/plain; charset=utf-8");
|
||||
|
||||
return OnError();
|
||||
}
|
||||
|
||||
if (searchResults == null || !searchResults.Any())
|
||||
{
|
||||
OnLog("UaTUT: No search results found");
|
||||
|
||||
@ -47,6 +47,9 @@ namespace Uaflix.Controllers
|
||||
// Обробка параметра checksearch - повертаємо спеціальну відповідь для валідації
|
||||
if (checksearch)
|
||||
{
|
||||
if (AppInit.conf?.online?.checkOnlineSearch != true)
|
||||
return OnError("uaflix", proxyManager);
|
||||
|
||||
try
|
||||
{
|
||||
string filmTitle = !string.IsNullOrEmpty(title) ? title : original_title;
|
||||
|
||||
@ -23,7 +23,7 @@ namespace Unimay.Controllers
|
||||
|
||||
[HttpGet]
|
||||
[Route("unimay")]
|
||||
async public ValueTask<ActionResult> Index(string title, string original_title, string code, int serial = -1, int s = -1, int e = -1, bool play = false, bool rjson = false)
|
||||
async public ValueTask<ActionResult> Index(string title, string original_title, string code, int serial = -1, int s = -1, int e = -1, bool play = false, bool rjson = false, bool checksearch = false)
|
||||
{
|
||||
await UpdateService.ConnectAsync(host);
|
||||
|
||||
@ -33,6 +33,18 @@ namespace Unimay.Controllers
|
||||
|
||||
var invoke = new UnimayInvoke(init, hybridCache, OnLog, proxyManager);
|
||||
|
||||
if (checksearch)
|
||||
{
|
||||
if (AppInit.conf?.online?.checkOnlineSearch != true)
|
||||
return OnError("unimay");
|
||||
|
||||
var searchResults = await invoke.Search(title, original_title, serial);
|
||||
if (searchResults?.Content != null && searchResults.Content.Count > 0)
|
||||
return Content("data-json=", "text/plain; charset=utf-8");
|
||||
|
||||
return OnError("unimay");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(code))
|
||||
{
|
||||
// Fetch release details
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user