Compare commits

..

2 Commits

Author SHA1 Message Date
Felix
af865b9373 fix: remove redundant code block and duplicate initialization logic in Controller.cs 2026-04-12 11:27:17 +03:00
Felix
543aa5f047 refactor: replace dots with underscores in module route paths and identifiers
- Updated all HTTP route paths from "lite/lme.module" to "lite/lme_module" across LME.AnimeON, LME.Bamboo, LME.JackTor, LME.KlonFUN, LME.Makhno, LME.Mikai, LME.NMoonAnime, LME.StarLight, LME.UafilmME, LME.Uaflix, and LME.Unimay controllers
- Standardized error messages, log prefixes, cache keys, and other string identifiers to use underscores instead of dots for consistency with naming conventions
- Applied changes to ModInit.cs, OnlineApi.cs, and invoke classes to maintain uniformity in module references
2026-04-12 11:14:26 +03:00
38 changed files with 264 additions and 263 deletions

View File

@ -27,7 +27,7 @@ namespace LME.AnimeON.Controllers
}
[HttpGet]
[Route("lite/lme.animeon")]
[Route("lite/lme_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, bool checksearch = false)
{
await UpdateService.ConnectAsync(host);
@ -42,13 +42,13 @@ namespace LME.AnimeON.Controllers
if (checksearch)
{
if (!IsCheckOnlineSearchEnabled())
return OnError("lme.animeon", refresh_proxy: true);
return OnError("lme_animeon", refresh_proxy: true);
var checkSeasons = await invoke.Search(imdb_id, kinopoisk_id, title, original_title, year, serial);
if (checkSeasons != null && checkSeasons.Count > 0)
return Content("data-json=", "text/plain; charset=utf-8");
return OnError("lme.animeon", refresh_proxy: true);
return OnError("lme_animeon", refresh_proxy: true);
}
OnLog($"AnimeON Index: title={title}, original_title={original_title}, serial={serial}, s={s}, t={t}, year={year}, imdb_id={imdb_id}, kp={kinopoisk_id}");
@ -56,7 +56,7 @@ namespace LME.AnimeON.Controllers
var seasons = await invoke.Search(imdb_id, kinopoisk_id, title, original_title, year, serial);
OnLog($"AnimeON: search results = {seasons?.Count ?? 0}");
if (seasons == null || seasons.Count == 0)
return OnError("lme.animeon", refresh_proxy: true);
return OnError("lme_animeon", refresh_proxy: true);
// [Refactoring] Використовується агрегована структура (AggregateSerialStructure) — попередній збір allOptions не потрібний
@ -82,7 +82,7 @@ namespace LME.AnimeON.Controllers
foreach (var item in seasonItems)
{
string seasonName = item.SeasonNumber.ToString();
string link = $"{host}/lite/lme.animeon?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&s={item.SeasonNumber}";
string link = $"{host}/lite/lme_animeon?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&s={item.SeasonNumber}";
season_tpl.Append(seasonName, link, seasonName);
}
OnLog($"AnimeON: return seasons count={seasonItems.Count}");
@ -107,13 +107,13 @@ namespace LME.AnimeON.Controllers
selected = new { Anime = seasons[s], Index = s, SeasonNumber = seasons[s].Season > 0 ? seasons[s].Season : s + 1 };
if (selected == null)
return OnError("lme.animeon", refresh_proxy: true);
return OnError("lme_animeon", refresh_proxy: true);
var selectedAnime = selected.Anime;
int selectedSeasonNumber = selected.SeasonNumber;
var structure = await invoke.AggregateSerialStructure(selectedAnime.Id, selectedSeasonNumber);
if (structure == null || !structure.Voices.Any())
return OnError("lme.animeon", refresh_proxy: true);
return OnError("lme_animeon", refresh_proxy: true);
OnLog($"AnimeON: voices found = {structure.Voices.Count}");
var voiceItems = structure.Voices
@ -136,14 +136,14 @@ namespace LME.AnimeON.Controllers
var voice_tpl = new VoiceTpl();
foreach (var voice in voiceItems)
{
string voiceLink = $"{host}/lite/lme.animeon?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&s={s}&t={HttpUtility.UrlEncode(voice.Key)}";
string voiceLink = $"{host}/lite/lme_animeon?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&s={s}&t={HttpUtility.UrlEncode(voice.Key)}";
bool isActive = voice.Key == t;
voice_tpl.Append(voice.Display, isActive, voiceLink);
}
// Перевірка вибраної озвучки
if (!structure.Voices.ContainsKey(t))
return OnError("lme.animeon", refresh_proxy: true);
return OnError("lme_animeon", refresh_proxy: true);
var episode_tpl = new EpisodeTpl();
var selectedVoiceInfo = structure.Voices[t];
@ -180,7 +180,7 @@ namespace LME.AnimeON.Controllers
if (string.IsNullOrEmpty(streamLink) && ep.EpisodeId > 0)
{
string callUrl = $"{host}/lite/lme.animeon/play?episode_id={ep.EpisodeId}&serial=1";
string callUrl = $"{host}/lite/lme_animeon/play?episode_id={ep.EpisodeId}&serial=1";
episode_tpl.Append(episodeName, title ?? original_title, seasonStr, episodeStr, accsArgs(callUrl), "call");
continue;
}
@ -190,7 +190,7 @@ namespace LME.AnimeON.Controllers
if (needsResolve || streamLink.Contains("moonanime.art") || streamLink.Contains("ashdi.vip/vod"))
{
string callUrl = $"{host}/lite/lme.animeon/play?url={HttpUtility.UrlEncode(streamLink)}&serial=1";
string callUrl = $"{host}/lite/lme_animeon/play?url={HttpUtility.UrlEncode(streamLink)}&serial=1";
episode_tpl.Append(episodeName, title ?? original_title, seasonStr, episodeStr, accsArgs(callUrl), "call");
}
else
@ -213,12 +213,12 @@ namespace LME.AnimeON.Controllers
{
var firstAnime = seasons.FirstOrDefault();
if (firstAnime == null)
return OnError("lme.animeon", refresh_proxy: true);
return OnError("lme_animeon", refresh_proxy: true);
var fundubs = await invoke.GetFundubs(firstAnime.Id);
OnLog($"AnimeON: movie fundubs count = {fundubs?.Count ?? 0}");
if (fundubs == null || fundubs.Count == 0)
return OnError("lme.animeon", refresh_proxy: true);
return OnError("lme_animeon", refresh_proxy: true);
var tpl = new MovieTpl(title, original_title);
@ -252,7 +252,7 @@ namespace LME.AnimeON.Controllers
foreach (var ashdiStream in ashdiStreams)
{
string optionName = $"{translationName} {ashdiStream.title}";
string callUrl = $"{host}/lite/lme.animeon/play?url={HttpUtility.UrlEncode(ashdiStream.link)}";
string callUrl = $"{host}/lite/lme_animeon/play?url={HttpUtility.UrlEncode(ashdiStream.link)}";
tpl.Append(optionName, accsArgs(callUrl), "call");
}
continue;
@ -261,7 +261,7 @@ namespace LME.AnimeON.Controllers
if (needsResolve || streamLink.Contains("moonanime.art/iframe/") || streamLink.Contains("ashdi.vip/vod"))
{
string callUrl = $"{host}/lite/lme.animeon/play?url={HttpUtility.UrlEncode(streamLink)}";
string callUrl = $"{host}/lite/lme_animeon/play?url={HttpUtility.UrlEncode(streamLink)}";
tpl.Append(translationName, accsArgs(callUrl), "call");
}
else
@ -273,7 +273,7 @@ namespace LME.AnimeON.Controllers
// Якщо не зібрали жодної опції — повертаємо помилку
if (tpl.data == null || tpl.data.Count == 0)
return OnError("lme.animeon", refresh_proxy: true);
return OnError("lme_animeon", refresh_proxy: true);
OnLog("AnimeON: return movie options");
return rjson ? Content(tpl.ToJson(), "application/json; charset=utf-8") : Content(tpl.ToHtml(), "text/html; charset=utf-8");
@ -374,7 +374,7 @@ namespace LME.AnimeON.Controllers
return null;
}
[HttpGet("lite/lme.animeon/play")]
[HttpGet("lite/lme_animeon/play")]
public async Task<ActionResult> Play(string url, int episode_id = 0, string title = null, int serial = 0)
{
await UpdateService.ConnectAsync(host);
@ -400,13 +400,13 @@ namespace LME.AnimeON.Controllers
else
{
OnLog("AnimeON Play: empty url");
return OnError("lme.animeon", refresh_proxy: true);
return OnError("lme_animeon", refresh_proxy: true);
}
if (string.IsNullOrEmpty(streamLink))
{
OnLog("AnimeON Play: cannot extract stream");
return OnError("lme.animeon", refresh_proxy: true);
return OnError("lme_animeon", refresh_proxy: true);
}
List<HeadersModel> streamHeaders = null;

View File

@ -85,7 +85,7 @@ namespace LME.AnimeON
}
// Виводити "уточнити пошук"
RegisterWithSearch("lme.animeon");
RegisterWithSearch("lme_animeon");
}
private static void RegisterWithSearch(string plugin)

View File

@ -30,7 +30,7 @@ namespace LME.AnimeON
if (UpdateService.IsDisconnected())
init.overridehost = null;
online.Add(new ModuleOnlineItem(init, "lme.animeon"));
online.Add(new ModuleOnlineItem(init, "lme_animeon"));
}
return online;

View File

@ -23,7 +23,7 @@ namespace LME.Bamboo.Controllers
}
[HttpGet]
[Route("lite/lme.bamboo")]
[Route("lite/lme_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, bool checksearch = false)
{
await UpdateService.ConnectAsync(host);
@ -37,13 +37,13 @@ namespace LME.Bamboo.Controllers
if (checksearch)
{
if (!IsCheckOnlineSearchEnabled())
return OnError("lme.bamboo", refresh_proxy: true);
return OnError("lme_bamboo", refresh_proxy: true);
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("lme.bamboo", refresh_proxy: true);
return OnError("lme_bamboo", refresh_proxy: true);
}
string itemUrl = href;
@ -51,14 +51,14 @@ namespace LME.Bamboo.Controllers
{
var searchResults = await invoke.Search(title, original_title);
if (searchResults == null || searchResults.Count == 0)
return OnError("lme.bamboo", refresh_proxy: true);
return OnError("lme_bamboo", refresh_proxy: true);
if (searchResults.Count > 1)
{
var similar_tpl = new SimilarTpl(searchResults.Count);
foreach (var res in searchResults)
{
string link = $"{host}/lite/lme.bamboo?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial={serial}&href={HttpUtility.UrlEncode(res.Url)}";
string link = $"{host}/lite/lme_bamboo?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial={serial}&href={HttpUtility.UrlEncode(res.Url)}";
similar_tpl.Append(res.Title, string.Empty, string.Empty, link, res.Poster);
}
@ -72,7 +72,7 @@ namespace LME.Bamboo.Controllers
{
var series = await invoke.GetSeriesEpisodes(itemUrl);
if (series == null || (series.Sub.Count == 0 && series.Dub.Count == 0))
return OnError("lme.bamboo", refresh_proxy: true);
return OnError("lme_bamboo", refresh_proxy: true);
var voice_tpl = new VoiceTpl();
var episode_tpl = new EpisodeTpl();
@ -88,13 +88,13 @@ namespace LME.Bamboo.Controllers
foreach (var voice in availableVoices)
{
string voiceLink = $"{host}/lite/lme.bamboo?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&t={voice.key}&href={HttpUtility.UrlEncode(itemUrl)}";
string voiceLink = $"{host}/lite/lme_bamboo?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&t={voice.key}&href={HttpUtility.UrlEncode(itemUrl)}";
voice_tpl.Append(voice.name, voice.key == t, voiceLink);
}
var selected = availableVoices.FirstOrDefault(v => v.key == t);
if (selected.episodes == null || selected.episodes.Count == 0)
return OnError("lme.bamboo", refresh_proxy: true);
return OnError("lme_bamboo", refresh_proxy: true);
int index = 1;
foreach (var ep in selected.episodes.OrderBy(e => e.Episode ?? int.MaxValue))
@ -116,7 +116,7 @@ namespace LME.Bamboo.Controllers
{
var streams = await invoke.GetMovieStreams(itemUrl);
if (streams == null || streams.Count == 0)
return OnError("lme.bamboo", refresh_proxy: true);
return OnError("lme_bamboo", refresh_proxy: true);
var movie_tpl = new MovieTpl(title, original_title);
for (int i = 0; i < streams.Count; i++)

View File

@ -76,7 +76,7 @@ namespace LME.Bamboo
}
// Виводити "уточнити пошук"
RegisterWithSearch("lme.bamboo");
RegisterWithSearch("lme_bamboo");
}
private static void RegisterWithSearch(string plugin)

View File

@ -33,7 +33,7 @@ namespace LME.Bamboo
if (UpdateService.IsDisconnected())
init.overridehost = null;
online.Add(new ModuleOnlineItem(init, "lme.bamboo"));
online.Add(new ModuleOnlineItem(init, "lme_bamboo"));
}
return online;

View File

@ -26,7 +26,7 @@ namespace LME.JackTor.Controllers
}
[HttpGet]
[Route("lite/lme.jacktor")]
[Route("lite/lme_jacktor")]
async public Task<ActionResult> Index(
long id,
string imdb_id,
@ -57,20 +57,20 @@ namespace LME.JackTor.Controllers
if (checksearch)
{
if (!IsCheckOnlineSearchEnabled())
return OnError("lme.jacktor", refresh_proxy: true);
return OnError("lme_jacktor", refresh_proxy: true);
var check = await invoke.Search(title, original_title, year, serial, original_language);
if (check.Count > 0)
return Content("data-json=", "text/plain; charset=utf-8");
return OnError("lme.jacktor", refresh_proxy: true);
return OnError("lme_jacktor", refresh_proxy: true);
}
var torrents = await invoke.Search(title, original_title, year, serial, original_language);
if (torrents == null || torrents.Count == 0)
{
string debugInfo = $"title={title}\noriginal_title={original_title}\nyear={year}\nserial={serial}\njackett={MaskSensitiveUrl(init.jackett)}\nmin_sid={init.min_sid}\nmin_peers={init.min_peers}";
return OnError("lme.jacktor", refresh_proxy: true, weblog: debugInfo);
return OnError("lme_jacktor", refresh_proxy: true, weblog: debugInfo);
}
if (serial == 1)
@ -97,7 +97,7 @@ namespace LME.JackTor.Controllers
{
seasonTpl.Append(
$"{season} сезон",
$"{host}/lite/lme.jacktor?rjson={rjson}&title={enTitle}&original_title={enOriginal}&year={year}&original_language={original_language}&serial=1&s={season}",
$"{host}/lite/lme_jacktor?rjson={rjson}&title={enTitle}&original_title={enOriginal}&year={year}&original_language={original_language}&serial=1&s={season}",
season);
}
@ -126,7 +126,7 @@ namespace LME.JackTor.Controllers
: $"{seasonLabel} • {torrent.Voice}";
string qualityInfo = $"{torrent.Tracker} / {torrent.QualityLabel} / {torrent.MediaInfo} / ↑{torrent.Seeders}";
string releaseLink = accsArgs($"{host}/lite/lme.jacktor/serial/{torrent.Rid}?rjson={rjson}&title={enTitle}&original_title={enOriginal}&s={targetSeason}");
string releaseLink = accsArgs($"{host}/lite/lme_jacktor/serial/{torrent.Rid}?rjson={rjson}&title={enTitle}&original_title={enOriginal}&s={targetSeason}");
similarTpl.Append(releaseName, null, qualityInfo, releaseLink);
}
@ -146,7 +146,7 @@ namespace LME.JackTor.Controllers
: torrent.Voice;
string voiceName = $"{torrent.QualityLabel} / {torrent.MediaInfo} / ↑{torrent.Seeders}";
string streamLink = accsArgs($"{host}/lite/lme.jacktor/s{torrent.Rid}");
string streamLink = accsArgs($"{host}/lite/lme_jacktor/s{torrent.Rid}");
movieTpl.Append(
voice,
@ -162,7 +162,7 @@ namespace LME.JackTor.Controllers
}
[HttpGet]
[Route("lite/lme.jacktor/serial/{rid}")]
[Route("lite/lme_jacktor/serial/{rid}")]
async public ValueTask<ActionResult> Serial(string rid, string account_email, string title, string original_title, int s = 1, bool rjson = false)
{
var init = loadKit(ModInit.Settings);
@ -174,9 +174,9 @@ namespace LME.JackTor.Controllers
var invoke = new JackTorInvoke(init, hybridCache, OnLog, proxyManager);
if (!invoke.TryGetSource(rid, out JackTorSourceCache source))
return OnError("lme.jacktor", refresh_proxy: true);
return OnError("lme_jacktor", refresh_proxy: true);
string memKey = $"lme.jacktor:serial:{rid}";
string memKey = $"lme_jacktor:serial:{rid}";
return await InvkSemaphore(memKey, null, async () =>
{
@ -184,7 +184,7 @@ namespace LME.JackTor.Controllers
{
var ts = ResolveProbeTorrentServer(init, account_email);
if (string.IsNullOrWhiteSpace(ts.host))
return OnError("lme.jacktor", refresh_proxy: true);
return OnError("lme_jacktor", refresh_proxy: true);
string hashResponse = await httpHydra.Post(
$"{ts.host}/torrents",
@ -194,7 +194,7 @@ namespace LME.JackTor.Controllers
string hash = ExtractHash(hashResponse);
if (string.IsNullOrWhiteSpace(hash))
return OnError("lme.jacktor", refresh_proxy: true);
return OnError("lme_jacktor", refresh_proxy: true);
Stat stat = null;
DateTime deadline = DateTime.Now.AddSeconds(20);
@ -213,7 +213,7 @@ namespace LME.JackTor.Controllers
if (DateTime.Now > deadline)
{
_ = httpHydra.Post($"{ts.host}/torrents", BuildRemovePayload(hash), statusCodeOK: false, newheaders: ts.headers);
return OnError("lme.jacktor", refresh_proxy: true);
return OnError("lme_jacktor", refresh_proxy: true);
}
await Task.Delay(250);
@ -226,7 +226,7 @@ namespace LME.JackTor.Controllers
}
if (fileStats == null || fileStats.Length == 0)
return OnError("lme.jacktor", refresh_proxy: true);
return OnError("lme_jacktor", refresh_proxy: true);
var episodeTpl = new EpisodeTpl();
int appended = 0;
@ -241,13 +241,13 @@ namespace LME.JackTor.Controllers
title ?? original_title,
s.ToString(),
file.Id.ToString(),
accsArgs($"{host}/lite/lme.jacktor/s{rid}?tsid={file.Id}"));
accsArgs($"{host}/lite/lme_jacktor/s{rid}?tsid={file.Id}"));
appended++;
}
if (appended == 0)
return OnError("lme.jacktor", refresh_proxy: true);
return OnError("lme_jacktor", refresh_proxy: true);
return rjson
? Content(episodeTpl.ToJson(), "application/json; charset=utf-8")
@ -256,7 +256,7 @@ namespace LME.JackTor.Controllers
}
[HttpGet]
[Route("lite/lme.jacktor/s{rid}")]
[Route("lite/lme_jacktor/s{rid}")]
async public ValueTask<ActionResult> Stream(string rid, int tsid = -1, string account_email = null)
{
var init = loadKit(ModInit.Settings);
@ -268,14 +268,14 @@ namespace LME.JackTor.Controllers
var invoke = new JackTorInvoke(init, hybridCache, OnLog, proxyManager);
if (!invoke.TryGetSource(rid, out JackTorSourceCache source))
return OnError("lme.jacktor", refresh_proxy: true);
return OnError("lme_jacktor", refresh_proxy: true);
int index = tsid != -1 ? tsid : 1;
string country = requestInfo.Country;
async ValueTask<ActionResult> AuthStream(string tsHost, string login, string passwd, string uhost = null, Dictionary<string, string> addheaders = null)
{
string memKey = $"lme.jacktor:auth_stream:{rid}:{uhost ?? tsHost}";
string memKey = $"lme_jacktor:auth_stream:{rid}:{uhost ?? tsHost}";
if (!hybridCache.TryGetValue(memKey, out string hash))
{
login = (login ?? string.Empty).Replace("{account_email}", account_email ?? string.Empty);
@ -291,7 +291,7 @@ namespace LME.JackTor.Controllers
hash = ExtractHash(response);
if (string.IsNullOrWhiteSpace(hash))
return OnError("lme.jacktor", refresh_proxy: true);
return OnError("lme_jacktor", refresh_proxy: true);
hybridCache.Set(memKey, hash, DateTime.Now.AddMinutes(1));
}
@ -315,7 +315,7 @@ namespace LME.JackTor.Controllers
if (init.auth_torrs != null && init.auth_torrs.Count > 0)
{
string tsKey = $"lme.jacktor:ts2:{rid}:{requestInfo.IP}";
string tsKey = $"lme_jacktor:ts2:{rid}:{requestInfo.IP}";
if (!hybridCache.TryGetValue(tsKey, out PidTorAuthTS ts))
{
var servers = init.auth_torrs.Where(i => i.enable).ToList();
@ -328,7 +328,7 @@ namespace LME.JackTor.Controllers
}
if (servers.Count == 0)
return OnError("lme.jacktor", refresh_proxy: true);
return OnError("lme_jacktor", refresh_proxy: true);
ts = servers[Random.Shared.Next(0, servers.Count)];
hybridCache.Set(tsKey, ts, DateTime.Now.AddHours(4));
@ -341,9 +341,9 @@ namespace LME.JackTor.Controllers
if (init.base_auth != null && init.base_auth.enable)
{
if (init.torrs == null || init.torrs.Length == 0)
return OnError("lme.jacktor", refresh_proxy: true);
return OnError("lme_jacktor", refresh_proxy: true);
string tsKey = $"lme.jacktor:ts3:{rid}:{requestInfo.IP}";
string tsKey = $"lme_jacktor:ts3:{rid}:{requestInfo.IP}";
if (!hybridCache.TryGetValue(tsKey, out string tsHost))
{
tsHost = init.torrs[Random.Shared.Next(0, init.torrs.Length)];
@ -354,9 +354,9 @@ namespace LME.JackTor.Controllers
}
if (init.torrs == null || init.torrs.Length == 0)
return OnError("lme.jacktor", refresh_proxy: true);
return OnError("lme_jacktor", refresh_proxy: true);
string key = $"lme.jacktor:ts4:{rid}:{requestInfo.IP}";
string key = $"lme_jacktor:ts4:{rid}:{requestInfo.IP}";
if (!hybridCache.TryGetValue(key, out string torrentHost))
{
torrentHost = init.torrs[Random.Shared.Next(0, init.torrs.Length)];

View File

@ -45,7 +45,7 @@ namespace LME.JackTor
public async Task<List<JackTorParsedResult>> Search(string title, string originalTitle, int year, int serial, string originalLanguage)
{
string memKey = $"lme.jacktor:search:{serial}:{year}:{(title ?? string.Empty).Trim().ToLowerInvariant()}:{(originalTitle ?? string.Empty).Trim().ToLowerInvariant()}";
string memKey = $"lme_jacktor:search:{serial}:{year}:{(title ?? string.Empty).Trim().ToLowerInvariant()}:{(originalTitle ?? string.Empty).Trim().ToLowerInvariant()}";
if (_hybridCache.TryGetValue(memKey, out List<JackTorParsedResult> cached))
return cached;
@ -83,7 +83,7 @@ namespace LME.JackTor
public bool TryGetSource(string rid, out JackTorSourceCache source)
{
return _hybridCache.TryGetValue($"lme.jacktor:source:{rid}", out source);
return _hybridCache.TryGetValue($"lme_jacktor:source:{rid}", out source);
}
private async Task<List<JackettResult>> SearchRaw(string query, int categoryId)
@ -731,7 +731,7 @@ namespace LME.JackTor
Seasons = item.Seasons
};
_hybridCache.Set($"lme.jacktor:source:{item.Rid}", cacheItem, expires);
_hybridCache.Set($"lme_jacktor:source:{item.Rid}", cacheItem, expires);
}
}
}

View File

@ -78,7 +78,7 @@ namespace LME.JackTor
JackTor.host = JackTor.jackett;
// Показувати «уточнити пошук».
RegisterWithSearch("lme.jacktor");
RegisterWithSearch("lme_jacktor");
}
private static void RegisterWithSearch(string plugin)

View File

@ -26,7 +26,7 @@ namespace LME.JackTor
if (UpdateService.IsDisconnected())
init.overridehost = null;
online.Add(new ModuleOnlineItem(init, "lme.jacktor"));
online.Add(new ModuleOnlineItem(init, "lme_jacktor"));
}
return online;

View File

@ -22,7 +22,7 @@ namespace LME.KlonFUN.Controllers
}
[HttpGet]
[Route("lite/lme.klonfun")]
[Route("lite/lme_klonfun")]
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);
@ -38,13 +38,13 @@ namespace LME.KlonFUN.Controllers
if (checksearch)
{
if (!IsCheckOnlineSearchEnabled())
return OnError("lme.klonfun", refresh_proxy: true);
return OnError("lme_klonfun", refresh_proxy: true);
var checkResults = await invoke.Search(imdb_id, title, original_title);
if (checkResults != null && checkResults.Count > 0)
return Content("data-json=", "text/plain; charset=utf-8");
return OnError("lme.klonfun", refresh_proxy: true);
return OnError("lme_klonfun", refresh_proxy: true);
}
string itemUrl = href;
@ -52,14 +52,14 @@ namespace LME.KlonFUN.Controllers
{
var searchResults = await invoke.Search(imdb_id, title, original_title);
if (searchResults == null || searchResults.Count == 0)
return OnError("lme.klonfun", refresh_proxy: true);
return OnError("lme_klonfun", refresh_proxy: true);
if (searchResults.Count > 1)
{
var similarTpl = new SimilarTpl(searchResults.Count);
foreach (SearchResult result in searchResults)
{
string link = $"{host}/lite/lme.klonfun?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial={serial}&href={HttpUtility.UrlEncode(result.Url)}";
string link = $"{host}/lite/lme_klonfun?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial={serial}&href={HttpUtility.UrlEncode(result.Url)}";
similarTpl.Append(result.Title, result.Year > 0 ? result.Year.ToString() : string.Empty, string.Empty, link, result.Poster);
}
@ -75,7 +75,7 @@ namespace LME.KlonFUN.Controllers
if (item == null || string.IsNullOrWhiteSpace(item.PlayerUrl))
{
OnLog($"KlonFUN: не знайдено iframe-плеєр для {itemUrl}");
return OnError("lme.klonfun", refresh_proxy: true);
return OnError("lme_klonfun", refresh_proxy: true);
}
string contentTitle = !string.IsNullOrWhiteSpace(title) ? title : item.Title;
@ -89,7 +89,7 @@ namespace LME.KlonFUN.Controllers
{
var serialStructure = await invoke.GetSerialStructure(item.PlayerUrl);
if (serialStructure == null || serialStructure.Voices.Count == 0)
return OnError("lme.klonfun", refresh_proxy: true);
return OnError("lme_klonfun", refresh_proxy: true);
if (s == -1)
{
@ -120,12 +120,12 @@ namespace LME.KlonFUN.Controllers
}
if (seasons.Count == 0)
return OnError("lme.klonfun", refresh_proxy: true);
return OnError("lme_klonfun", refresh_proxy: true);
var seasonTpl = new SeasonTpl(seasons.Count);
foreach (int seasonNumber in seasons)
{
string link = $"{host}/lite/lme.klonfun?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&s={seasonNumber}&href={HttpUtility.UrlEncode(itemUrl)}";
string link = $"{host}/lite/lme_klonfun?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&s={seasonNumber}&href={HttpUtility.UrlEncode(itemUrl)}";
if (!string.IsNullOrWhiteSpace(t))
link += $"&t={HttpUtility.UrlEncode(t)}";
@ -142,7 +142,7 @@ namespace LME.KlonFUN.Controllers
.ToList();
if (voicesForSeason.Count == 0)
return OnError("lme.klonfun", refresh_proxy: true);
return OnError("lme_klonfun", refresh_proxy: true);
var selectedVoiceForSeason = voicesForSeason
.FirstOrDefault(v => !string.IsNullOrWhiteSpace(t) && v.Key.Equals(t, StringComparison.OrdinalIgnoreCase))
@ -151,12 +151,12 @@ namespace LME.KlonFUN.Controllers
var voiceTpl = new VoiceTpl(voicesForSeason.Count);
foreach (var voice in voicesForSeason)
{
string voiceLink = $"{host}/lite/lme.klonfun?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&s={s}&t={HttpUtility.UrlEncode(voice.Key)}&href={HttpUtility.UrlEncode(itemUrl)}";
string voiceLink = $"{host}/lite/lme_klonfun?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&s={s}&t={HttpUtility.UrlEncode(voice.Key)}&href={HttpUtility.UrlEncode(itemUrl)}";
voiceTpl.Append(voice.DisplayName, voice.Key.Equals(selectedVoiceForSeason.Key, StringComparison.OrdinalIgnoreCase), voiceLink);
}
if (!selectedVoiceForSeason.Seasons.TryGetValue(s, out List<SerialEpisode> episodes) || episodes.Count == 0)
return OnError("lme.klonfun", refresh_proxy: true);
return OnError("lme_klonfun", refresh_proxy: true);
var episodeTpl = new EpisodeTpl(episodes.Count);
foreach (SerialEpisode episode in episodes.OrderBy(e => e.Number))
@ -179,7 +179,7 @@ namespace LME.KlonFUN.Controllers
{
var streams = await invoke.GetMovieStreams(item.PlayerUrl);
if (streams == null || streams.Count == 0)
return OnError("lme.klonfun", refresh_proxy: true);
return OnError("lme_klonfun", refresh_proxy: true);
var movieTpl = new MovieTpl(contentTitle, contentOriginalTitle, streams.Count);
for (int i = 0; i < streams.Count; i++)

View File

@ -41,7 +41,7 @@ namespace LME.KlonFUN
EventListener.UpdateInitFile += UpdateConfig;
// Додаємо підтримку "уточнити пошук".
RegisterWithSearch("lme.klonfun");
RegisterWithSearch("lme_klonfun");
}
private void UpdateConfig()

View File

@ -26,7 +26,7 @@ namespace LME.KlonFUN
if (UpdateService.IsDisconnected())
init.overridehost = null;
online.Add(new ModuleOnlineItem(init, "lme.klonfun"));
online.Add(new ModuleOnlineItem(init, "lme_klonfun"));
}
return online;

View File

@ -13,7 +13,7 @@ using LME.Makhno.Models;
namespace LME.Makhno
{
[Route("lite/lme.makhno")]
[Route("lite/lme_makhno")]
public class MakhnoController : BaseOnlineController
{
private readonly ProxyManager proxyManager;
@ -42,7 +42,7 @@ namespace LME.Makhno
TryEnableMagicApn(init);
Initialization(init);
OnLog($"lme.makhno: {title} (serial={serial}, s={s}, season={season}, t={t})");
OnLog($"lme_makhno: {title} (serial={serial}, s={s}, season={season}, t={t})");
var invoke = new MakhnoInvoke(init, hybridCache, OnLog, proxyManager, httpHydra);
@ -75,14 +75,14 @@ namespace LME.Makhno
if (resolved == null || string.IsNullOrEmpty(resolved.PlayUrl))
return OnError();
var playerData = await InvokeCache<PlayerData>($"lme.makhno:player:{resolved.PlayUrl}", TimeSpan.FromMinutes(10), async () =>
var playerData = await InvokeCache<PlayerData>($"lme_makhno:player:{resolved.PlayUrl}", TimeSpan.FromMinutes(10), async () =>
{
return await invoke.GetPlayerData(resolved.PlayUrl);
});
if (playerData?.Voices == null || !playerData.Voices.Any())
{
OnLog("lme.makhno Play: no voices parsed");
OnLog("lme_makhno Play: no voices parsed");
return OnError();
}
@ -99,7 +99,7 @@ namespace LME.Makhno
{
if (episode.Id == episodeId && !string.IsNullOrEmpty(episode.File))
{
OnLog($"lme.makhno Play: Found episode {episode.Title}, stream: {episode.File}");
OnLog($"lme_makhno Play: Found episode {episode.Title}, stream: {episode.File}");
string streamUrl = BuildStreamUrl(init, episode.File);
string episodeTitle = $"{title ?? original_title} - {episode.Title}";
@ -111,7 +111,7 @@ namespace LME.Makhno
}
}
OnLog("lme.makhno Play: Episode not found");
OnLog("lme_makhno Play: Episode not found");
return OnError();
}
@ -127,21 +127,21 @@ namespace LME.Makhno
TryEnableMagicApn(init);
Initialization(init);
OnLog($"lme.makhno PlayMovie: {title} ({year}) play={play}");
OnLog($"lme_makhno PlayMovie: {title} ({year}) play={play}");
var invoke = new MakhnoInvoke(init, hybridCache, OnLog, proxyManager, httpHydra);
var resolved = await ResolvePlaySource(imdb_id, serial: 0, invoke);
if (resolved == null || string.IsNullOrEmpty(resolved.PlayUrl))
return OnError();
var playerData = await InvokeCache<PlayerData>($"lme.makhno:player:{resolved.PlayUrl}", TimeSpan.FromMinutes(10), async () =>
var playerData = await InvokeCache<PlayerData>($"lme_makhno:player:{resolved.PlayUrl}", TimeSpan.FromMinutes(10), async () =>
{
return await invoke.GetPlayerData(resolved.PlayUrl);
});
if (playerData?.File == null)
{
OnLog("lme.makhno PlayMovie: no file parsed");
OnLog("lme_makhno PlayMovie: no file parsed");
return OnError();
}
@ -156,7 +156,7 @@ namespace LME.Makhno
private async Task<ActionResult> HandleMovie(string playUrl, string imdb_id, string title, string original_title, int year, bool rjson, MakhnoInvoke invoke)
{
var init = ModInit.Makhno;
var playerData = await InvokeCache<PlayerData>($"lme.makhno:player:{playUrl}", TimeSpan.FromMinutes(10), async () =>
var playerData = await InvokeCache<PlayerData>($"lme_makhno:player:{playUrl}", TimeSpan.FromMinutes(10), async () =>
{
return await invoke.GetPlayerData(playUrl);
});
@ -177,7 +177,7 @@ namespace LME.Makhno
if (movieStreams.Count == 0)
{
OnLog("lme.makhno HandleMovie: no file parsed");
OnLog("lme_makhno HandleMovie: no file parsed");
return OnError();
}
@ -200,14 +200,14 @@ namespace LME.Makhno
{
var init = ModInit.Makhno;
var playerData = await InvokeCache<PlayerData>($"lme.makhno:player:{playUrl}", TimeSpan.FromMinutes(10), async () =>
var playerData = await InvokeCache<PlayerData>($"lme_makhno:player:{playUrl}", TimeSpan.FromMinutes(10), async () =>
{
return await invoke.GetPlayerData(playUrl);
});
if (playerData?.Voices == null || !playerData.Voices.Any())
{
OnLog("lme.makhno HandleSerial: no voices parsed");
OnLog("lme_makhno HandleSerial: no voices parsed");
return OnError();
}
@ -270,7 +270,7 @@ namespace LME.Makhno
string voiceParam = seasonVoiceIndex.HasValue ? $"&t={seasonVoiceIndex.Value}" : string.Empty;
string seasonName = seasonItem.HasValue ? seasonItem.Value.Season?.Title ?? $"Сезон {seasonNumber}" : $"Сезон {seasonNumber}";
string link = $"{host}/lite/lme.makhno?imdb_id={imdb_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&season={seasonNumber}{voiceParam}";
string link = $"{host}/lite/lme_makhno?imdb_id={imdb_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&season={seasonNumber}{voiceParam}";
season_tpl.Append(seasonName, link, seasonNumber.ToString());
}
@ -340,7 +340,7 @@ namespace LME.Makhno
string voiceParam = seasonVoiceIndexForTpl.HasValue ? $"&t={seasonVoiceIndexForTpl.Value}" : string.Empty;
string seasonName = seasonItem.HasValue ? seasonItem.Value.Season?.Title ?? $"Сезон {seasonNumber}" : $"Сезон {seasonNumber}";
string link = $"{host}/lite/lme.makhno?imdb_id={imdb_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&season={seasonNumber}{voiceParam}";
string link = $"{host}/lite/lme_makhno?imdb_id={imdb_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&season={seasonNumber}{voiceParam}";
seasonTplForVoice.Append(seasonName, link, seasonNumber.ToString());
}
@ -357,11 +357,11 @@ namespace LME.Makhno
bool sameSeasonSet = seasonsForVoice.Select(s => s.Number).ToHashSet().SetEquals(selectedVoiceSeasonSet);
if (hasRequestedSeason && sameSeasonSet)
{
voiceLink = $"{host}/lite/lme.makhno?imdb_id={imdb_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&season={requestedSeason}&t={i}";
voiceLink = $"{host}/lite/lme_makhno?imdb_id={imdb_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&season={requestedSeason}&t={i}";
}
else
{
voiceLink = $"{host}/lite/lme.makhno?imdb_id={imdb_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&season=-1&t={i}";
voiceLink = $"{host}/lite/lme_makhno?imdb_id={imdb_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&season=-1&t={i}";
}
bool isActive = selectedVoice == i.ToString();
@ -377,7 +377,7 @@ namespace LME.Makhno
bool hasRequestedSeason = seasonsForVoice.Any(s => s.Number == requestedSeason);
if (!hasRequestedSeason)
{
string redirectUrl = $"{host}/lite/lme.makhno?imdb_id={imdb_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&season=-1&t={voiceIndex}";
string redirectUrl = $"{host}/lite/lme_makhno?imdb_id={imdb_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&season=-1&t={voiceIndex}";
return UpdateService.Validate(Redirect(redirectUrl));
}
@ -448,7 +448,7 @@ namespace LME.Makhno
if (string.IsNullOrWhiteSpace(imdbId))
return null;
string cacheKey = $"lme.makhno:wormhole:{imdbId}";
string cacheKey = $"lme_makhno:wormhole:{imdbId}";
string playUrl = await InvokeCache<string>(cacheKey, TimeSpan.FromMinutes(5), async () =>
{
return await invoke.GetWormholePlay(imdbId);
@ -456,6 +456,7 @@ namespace LME.Makhno
if (!string.IsNullOrEmpty(playUrl))
{
OnLog($"lme_makhno: resolved playUrl for {imdbId}");
return new ResolveResult
{
PlayUrl = playUrl,
@ -530,7 +531,7 @@ namespace LME.Makhno
return;
ApnHelper.ApplyInitConf(true, ModInit.MagicApnAshdiHost, init);
OnLog($"lme.makhno: увімкнено magic_apn для Ashdi (player={player ?? "unknown"}).");
OnLog($"lme_makhno: увімкнено magic_apn для Ashdi (player={player ?? "unknown"}).");
}
private class ResolveResult

View File

@ -57,7 +57,7 @@ namespace LME.Makhno
}
catch (Exception ex)
{
_onLog($"lme.makhno wormhole error: {ex.Message}");
_onLog($"lme_makhno wormhole error: {ex.Message}");
return null;
}
}
@ -84,7 +84,7 @@ namespace LME.Makhno
if (ApnHelper.IsAshdiUrl(sourceUrl) && ApnHelper.IsEnabled(_init) && string.IsNullOrWhiteSpace(_init.webcorshost))
requestUrl = ApnHelper.WrapUrl(_init, sourceUrl);
_onLog($"lme.makhno getting player data from: {requestUrl}");
_onLog($"lme_makhno getting player data from: {requestUrl}");
var response = await HttpGet(requestUrl, headers);
if (string.IsNullOrEmpty(response))
@ -133,14 +133,14 @@ namespace LME.Makhno
string jsonData = ExtractPlayerJson(html);
if (jsonData == null)
_onLog("lme.makhno ParsePlayerData: file array not found");
_onLog("lme_makhno ParsePlayerData: file array not found");
else
_onLog($"lme.makhno ParsePlayerData: file array length={jsonData.Length}");
_onLog($"lme_makhno ParsePlayerData: file array length={jsonData.Length}");
if (!string.IsNullOrEmpty(jsonData))
{
var voices = ParseVoicesJson(jsonData);
var movies = ParseMovieVariantsJson(jsonData);
_onLog($"lme.makhno ParsePlayerData: voices={voices?.Count ?? 0}");
_onLog($"lme_makhno ParsePlayerData: voices={voices?.Count ?? 0}");
return new PlayerData
{
File = movies.FirstOrDefault()?.File,
@ -153,7 +153,7 @@ namespace LME.Makhno
var m3u8Match = Regex.Match(html, @"(https?://[^""'\s>]+\.m3u8[^""'\s>]*)", RegexOptions.IgnoreCase);
if (m3u8Match.Success)
{
_onLog("lme.makhno ParsePlayerData: fallback m3u8 match");
_onLog("lme_makhno ParsePlayerData: fallback m3u8 match");
return new PlayerData
{
File = m3u8Match.Groups[1].Value,
@ -174,7 +174,7 @@ namespace LME.Makhno
var sourceMatch = Regex.Match(html, @"<source[^>]*src=[""']([^""']+)[""']", RegexOptions.IgnoreCase);
if (sourceMatch.Success)
{
_onLog("lme.makhno ParsePlayerData: fallback source match");
_onLog("lme_makhno ParsePlayerData: fallback source match");
return new PlayerData
{
File = sourceMatch.Groups[1].Value,
@ -196,7 +196,7 @@ namespace LME.Makhno
}
catch (Exception ex)
{
_onLog($"lme.makhno ParsePlayerData error: {ex.Message}");
_onLog($"lme_makhno ParsePlayerData error: {ex.Message}");
return null;
}
}
@ -263,7 +263,7 @@ namespace LME.Makhno
}
catch (Exception ex)
{
_onLog($"lme.makhno ParseVoicesJson error: {ex.Message}");
_onLog($"lme_makhno ParseVoicesJson error: {ex.Message}");
return new List<Voice>();
}
}
@ -298,7 +298,7 @@ namespace LME.Makhno
}
catch (Exception ex)
{
_onLog($"lme.makhno ParseMovieVariantsJson error: {ex.Message}");
_onLog($"lme_makhno ParseMovieVariantsJson error: {ex.Message}");
return new List<MovieVariant>();
}
}

View File

@ -84,7 +84,7 @@ namespace LME.Makhno
}
// Виводити "уточнити пошук"
RegisterWithSearch("lme.makhno");
RegisterWithSearch("lme_makhno");
}
private static void RegisterWithSearch(string plugin)

View File

@ -26,7 +26,7 @@ namespace LME.Makhno
if (UpdateService.IsDisconnected())
init.overridehost = null;
online.Add(new ModuleOnlineItem(init, "lme.makhno"));
online.Add(new ModuleOnlineItem(init, "lme_makhno"));
}
return online;

View File

@ -23,7 +23,7 @@ namespace LME.Mikai.Controllers
}
[HttpGet]
[Route("lite/lme.mikai")]
[Route("lite/lme_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, bool checksearch = false)
{
await UpdateService.ConnectAsync(host);
@ -38,34 +38,34 @@ namespace LME.Mikai.Controllers
if (checksearch)
{
if (!IsCheckOnlineSearchEnabled())
return OnError("lme.mikai", refresh_proxy: true);
return OnError("lme_mikai", refresh_proxy: true);
var checkResults = await invoke.Search(title, original_title, year);
if (checkResults != null && checkResults.Count > 0)
return Content("data-json=", "text/plain; charset=utf-8");
return OnError("lme.mikai", refresh_proxy: true);
return OnError("lme_mikai", refresh_proxy: true);
}
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);
if (searchResults == null || searchResults.Count == 0)
return OnError("lme.mikai", refresh_proxy: true);
return OnError("lme_mikai", refresh_proxy: true);
var selected = searchResults.FirstOrDefault();
if (selected == null)
return OnError("lme.mikai", refresh_proxy: true);
return OnError("lme_mikai", refresh_proxy: true);
var details = await invoke.GetDetails(selected.Id);
if (details == null || details.Players == null || details.Players.Count == 0)
return OnError("lme.mikai", refresh_proxy: true);
return OnError("lme_mikai", refresh_proxy: true);
bool isSerial = serial == 1 || (serial == -1 && !string.Equals(details.Format, "movie", StringComparison.OrdinalIgnoreCase));
var seasonDetails = await CollectSeasonDetails(details, invoke);
var voices = BuildVoices(seasonDetails);
if (voices.Count == 0)
return OnError("lme.mikai", refresh_proxy: true);
return OnError("lme_mikai", refresh_proxy: true);
string displayTitle = title ?? details.Details?.Names?.Name ?? original_title;
@ -82,14 +82,14 @@ namespace LME.Mikai.Controllers
.ToList();
if (seasonNumbers.Count == 0)
return OnError("lme.mikai", refresh_proxy: true);
return OnError("lme_mikai", refresh_proxy: true);
if (s == -1)
{
var seasonTpl = new SeasonTpl(seasonNumbers.Count);
foreach (var seasonNumber in seasonNumbers)
{
string link = $"{host}/lite/lme.mikai?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&s={seasonNumber}";
string link = $"{host}/lite/lme_mikai?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&s={seasonNumber}";
if (restrictByVoice)
link += $"&t={HttpUtility.UrlEncode(t)}";
seasonTpl.Append($"{seasonNumber}", link, seasonNumber.ToString());
@ -105,7 +105,7 @@ namespace LME.Mikai.Controllers
.ToList();
if (!voicesForSeason.Any())
return OnError("lme.mikai", refresh_proxy: true);
return OnError("lme_mikai", refresh_proxy: true);
if (string.IsNullOrEmpty(t))
t = voicesForSeason[0].Key;
@ -119,7 +119,7 @@ namespace LME.Mikai.Controllers
{
var targetSeasonSet = GetSeasonSet(voice.Value);
bool sameSeasonSet = targetSeasonSet.SetEquals(selectedSeasonSet);
string voiceLink = $"{host}/lite/lme.mikai?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1";
string voiceLink = $"{host}/lite/lme_mikai?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1";
if (sameSeasonSet)
voiceLink += $"&s={s}&t={HttpUtility.UrlEncode(voice.Key)}";
else
@ -129,7 +129,7 @@ namespace LME.Mikai.Controllers
if (!voices.ContainsKey(t) || !voices[t].Seasons.ContainsKey(s))
{
string redirectUrl = $"{host}/lite/lme.mikai?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&s=-1&t={HttpUtility.UrlEncode(t)}";
string redirectUrl = $"{host}/lite/lme_mikai?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&s=-1&t={HttpUtility.UrlEncode(t)}";
return Redirect(redirectUrl);
}
@ -144,7 +144,7 @@ namespace LME.Mikai.Controllers
if (NeedsResolve(voices[t].ProviderName, streamLink))
{
string callUrl = $"{host}/lite/lme.mikai/play?url={HttpUtility.UrlEncode(streamLink)}&title={HttpUtility.UrlEncode(displayTitle)}&serial=1";
string callUrl = $"{host}/lite/lme_mikai/play?url={HttpUtility.UrlEncode(streamLink)}&title={HttpUtility.UrlEncode(displayTitle)}&serial=1";
episodeTpl.Append(episodeName, displayTitle, s.ToString(), ep.Number.ToString(), accsArgs(callUrl), "call");
}
else
@ -178,14 +178,14 @@ namespace LME.Mikai.Controllers
foreach (var ashdiStream in ashdiStreams)
{
string optionName = $"{voice.DisplayName} {ashdiStream.title}";
string ashdiCallUrl = $"{host}/lite/lme.mikai/play?url={HttpUtility.UrlEncode(ashdiStream.link)}&title={HttpUtility.UrlEncode(displayTitle)}";
string ashdiCallUrl = $"{host}/lite/lme_mikai/play?url={HttpUtility.UrlEncode(ashdiStream.link)}&title={HttpUtility.UrlEncode(displayTitle)}";
movieTpl.Append(optionName, accsArgs(ashdiCallUrl), "call");
}
continue;
}
}
string callUrl = $"{host}/lite/lme.mikai/play?url={HttpUtility.UrlEncode(episode.Url)}&title={HttpUtility.UrlEncode(displayTitle)}";
string callUrl = $"{host}/lite/lme_mikai/play?url={HttpUtility.UrlEncode(episode.Url)}&title={HttpUtility.UrlEncode(displayTitle)}";
movieTpl.Append(voice.DisplayName, accsArgs(callUrl), "call");
}
else
@ -196,14 +196,14 @@ namespace LME.Mikai.Controllers
}
if (movieTpl.data == null || movieTpl.data.Count == 0)
return OnError("lme.mikai", refresh_proxy: true);
return OnError("lme_mikai", refresh_proxy: true);
return rjson
? Content(movieTpl.ToJson(), "application/json; charset=utf-8")
: Content(movieTpl.ToHtml(), "text/html; charset=utf-8");
}
[HttpGet("lite/lme.mikai/play")]
[HttpGet("lite/lme_mikai/play")]
public async Task<ActionResult> Play(string url, string title = null, int serial = 0)
{
await UpdateService.ConnectAsync(host);
@ -214,14 +214,14 @@ namespace LME.Mikai.Controllers
TryEnableMagicApn(init);
if (string.IsNullOrEmpty(url))
return OnError("lme.mikai", refresh_proxy: true);
return OnError("lme_mikai", refresh_proxy: true);
var invoke = new MikaiInvoke(init, hybridCache, OnLog, _proxyManager, httpHydra);
OnLog($"Mikai Play: url={url}, serial={serial}");
string streamLink = await invoke.ResolveVideoUrl(url, serial == 1);
if (string.IsNullOrEmpty(streamLink))
return OnError("lme.mikai", refresh_proxy: true);
return OnError("lme_mikai", refresh_proxy: true);
List<HeadersModel> streamHeaders = null;
bool forceProxy = false;

View File

@ -86,7 +86,7 @@ namespace LME.Mikai
}
// Виводити "уточнити пошук"
RegisterWithSearch("lme.mikai");
RegisterWithSearch("lme_mikai");
}
private static void RegisterWithSearch(string plugin)

View File

@ -30,7 +30,7 @@ namespace LME.Mikai
if (UpdateService.IsDisconnected())
init.overridehost = null;
online.Add(new ModuleOnlineItem(init, "lme.mikai"));
online.Add(new ModuleOnlineItem(init, "lme_mikai"));
}
return online;

View File

@ -25,7 +25,7 @@ namespace LME.NMoonAnime.Controllers
}
[HttpGet]
[Route("lite/lme.nmoonanime")]
[Route("lite/lme_nmoonanime")]
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 mal_id, string t, int s = -1, bool rjson = false, bool checksearch = false)
{
await UpdateService.ConnectAsync(host);
@ -40,20 +40,20 @@ namespace LME.NMoonAnime.Controllers
if (checksearch)
{
if (!IsCheckOnlineSearchEnabled())
return OnError("lme.nmoonanime", refresh_proxy: true);
return OnError("lme_nmoonanime", refresh_proxy: true);
var checkResults = await invoke.Search(imdb_id, effectiveMalId, title, year);
if (checkResults != null && checkResults.Count > 0)
return Content("data-json=", "text/plain; charset=utf-8");
return OnError("lme.nmoonanime", refresh_proxy: true);
return OnError("lme_nmoonanime", refresh_proxy: true);
}
OnLog($"NMoonAnime: назва={title}, source={source}, imdb={imdb_id}, kinopoisk_id(як mal_id)={kinopoisk_id}, mal_id_ефективний={effectiveMalId}, рік={year}, серіал={serial}, сезон={s}, озвучка={t}");
var seasons = await invoke.Search(imdb_id, effectiveMalId, title, year);
if (seasons == null || seasons.Count == 0)
return OnError("lme.nmoonanime", refresh_proxy: true);
return OnError("lme_nmoonanime", refresh_proxy: true);
bool isSeries = serial == 1;
NMoonAnimeSeasonContent firstSeasonData = null;
@ -62,7 +62,7 @@ namespace LME.NMoonAnime.Controllers
{
firstSeasonData = await invoke.GetSeasonContent(seasons[0]);
if (firstSeasonData == null || firstSeasonData.Voices.Count == 0)
return OnError("lme.nmoonanime", refresh_proxy: true);
return OnError("lme_nmoonanime", refresh_proxy: true);
isSeries = firstSeasonData.IsSeries;
}
@ -75,7 +75,7 @@ namespace LME.NMoonAnime.Controllers
return await RenderMovie(invoke, seasons, title, original_title, firstSeasonData, rjson);
}
[HttpGet("lite/lme.nmoonanime/play")]
[HttpGet("lite/lme_nmoonanime/play")]
public async Task<ActionResult> Play(string file, string title = null)
{
await UpdateService.ConnectAsync(host);
@ -85,12 +85,12 @@ namespace LME.NMoonAnime.Controllers
return Forbid();
if (string.IsNullOrWhiteSpace(file))
return OnError("lme.nmoonanime", refresh_proxy: true);
return OnError("lme_nmoonanime", refresh_proxy: true);
var invoke = new NMoonAnimeInvoke(init, hybridCache, OnLog, proxyManager, httpHydra);
var streams = invoke.ParseStreams(file);
if (streams == null || streams.Count == 0)
return OnError("lme.nmoonanime", refresh_proxy: true);
return OnError("lme_nmoonanime", refresh_proxy: true);
if (streams.Count == 1)
{
@ -107,7 +107,7 @@ namespace LME.NMoonAnime.Controllers
}
if (!streamQuality.Any())
return OnError("lme.nmoonanime", refresh_proxy: true);
return OnError("lme_nmoonanime", refresh_proxy: true);
var first = streamQuality.Firts();
string json = VideoTpl.ToJson("play", first.link, title ?? string.Empty, streamquality: streamQuality);
@ -133,7 +133,7 @@ namespace LME.NMoonAnime.Controllers
.ToList();
if (orderedSeasons.Count == 0)
return OnError("lme.nmoonanime", refresh_proxy: true);
return OnError("lme_nmoonanime", refresh_proxy: true);
if (selectedSeason == -1)
{
@ -154,14 +154,14 @@ namespace LME.NMoonAnime.Controllers
var currentSeason = orderedSeasons.FirstOrDefault(s => s.SeasonNumber == selectedSeason) ?? orderedSeasons[0];
var seasonData = await invoke.GetSeasonContent(currentSeason);
if (seasonData == null)
return OnError("lme.nmoonanime", refresh_proxy: true);
return OnError("lme_nmoonanime", refresh_proxy: true);
var voices = seasonData.Voices
.Where(v => v != null && v.Episodes != null && v.Episodes.Count > 0)
.ToList();
if (voices.Count == 0)
return OnError("lme.nmoonanime", refresh_proxy: true);
return OnError("lme_nmoonanime", refresh_proxy: true);
int activeVoiceIndex = ParseVoiceIndex(selectedVoice, voices.Count);
var voiceTpl = new VoiceTpl(voices.Count);
@ -180,7 +180,7 @@ namespace LME.NMoonAnime.Controllers
.ToList();
if (episodes.Count == 0)
return OnError("lme.nmoonanime", refresh_proxy: true);
return OnError("lme_nmoonanime", refresh_proxy: true);
string displayTitle = !string.IsNullOrWhiteSpace(title)
? title
@ -193,7 +193,7 @@ namespace LME.NMoonAnime.Controllers
{
int episodeNumber = episode.Number <= 0 ? 1 : episode.Number;
string episodeName = string.IsNullOrWhiteSpace(episode.Name) ? $"Епізод {episodeNumber}" : episode.Name;
string callUrl = $"{host}/lite/lme.nmoonanime/play?file={HttpUtility.UrlEncode(episode.File)}&title={HttpUtility.UrlEncode(displayTitle)}";
string callUrl = $"{host}/lite/lme_nmoonanime/play?file={HttpUtility.UrlEncode(episode.File)}&title={HttpUtility.UrlEncode(displayTitle)}";
episodeTpl.Append(episodeName, displayTitle, currentSeason.SeasonNumber.ToString(), episodeNumber.ToString(), accsArgs(callUrl), "call");
}
@ -218,14 +218,14 @@ namespace LME.NMoonAnime.Controllers
.FirstOrDefault();
if (currentSeason == null)
return OnError("lme.nmoonanime", refresh_proxy: true);
return OnError("lme_nmoonanime", refresh_proxy: true);
NMoonAnimeSeasonContent seasonData = firstSeasonData;
if (seasonData == null || !string.Equals(seasonData.Url, currentSeason.Url, StringComparison.OrdinalIgnoreCase))
seasonData = await invoke.GetSeasonContent(currentSeason);
if (seasonData == null || seasonData.Voices.Count == 0)
return OnError("lme.nmoonanime", refresh_proxy: true);
return OnError("lme_nmoonanime", refresh_proxy: true);
string displayTitle = !string.IsNullOrWhiteSpace(title)
? title
@ -249,13 +249,13 @@ namespace LME.NMoonAnime.Controllers
continue;
string voiceName = string.IsNullOrWhiteSpace(voice.Name) ? $"Озвучка {fallbackIndex}" : voice.Name;
string callUrl = $"{host}/lite/lme.nmoonanime/play?file={HttpUtility.UrlEncode(file)}&title={HttpUtility.UrlEncode(displayTitle)}";
string callUrl = $"{host}/lite/lme_nmoonanime/play?file={HttpUtility.UrlEncode(file)}&title={HttpUtility.UrlEncode(displayTitle)}";
movieTpl.Append(voiceName, accsArgs(callUrl), "call");
fallbackIndex++;
}
if (movieTpl.IsEmpty)
return OnError("lme.nmoonanime", refresh_proxy: true);
return OnError("lme_nmoonanime", refresh_proxy: true);
return rjson
? Content(movieTpl.ToJson(), "application/json; charset=utf-8")
@ -265,7 +265,7 @@ namespace LME.NMoonAnime.Controllers
private string BuildIndexUrl(string imdbId, long kinopoiskId, string title, string originalTitle, int year, int serial, string malId, int season, string voice)
{
var url = new StringBuilder();
url.Append($"{host}/lite/lme.nmoonanime?imdb_id={HttpUtility.UrlEncode(imdbId)}");
url.Append($"{host}/lite/lme_nmoonanime?imdb_id={HttpUtility.UrlEncode(imdbId)}");
url.Append($"&kinopoisk_id={kinopoiskId}");
url.Append($"&title={HttpUtility.UrlEncode(title)}");
url.Append($"&original_title={HttpUtility.UrlEncode(originalTitle)}");

View File

@ -71,7 +71,7 @@ namespace LME.NMoonAnime
NMoonAnime.apn = null;
}
RegisterWithSearch("lme.nmoonanime");
RegisterWithSearch("lme_nmoonanime");
}
private static void RegisterWithSearch(string plugin)

View File

@ -30,7 +30,7 @@ namespace LME.NMoonAnime
if (UpdateService.IsDisconnected())
init.overridehost = null;
online.Add(new ModuleOnlineItem(init, "lme.nmoonanime"));
online.Add(new ModuleOnlineItem(init, "lme_nmoonanime"));
}
return online;

View File

@ -24,7 +24,7 @@ namespace LME.StarLight.Controllers
}
[HttpGet]
[Route("lite/lme.starlight")]
[Route("lite/lme_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, bool checksearch = false)
{
await UpdateService.ConnectAsync(host);
@ -38,13 +38,13 @@ namespace LME.StarLight.Controllers
if (checksearch)
{
if (!IsCheckOnlineSearchEnabled())
return OnError("lme.starlight", refresh_proxy: true);
return OnError("lme_starlight", refresh_proxy: true);
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("lme.starlight", refresh_proxy: true);
return OnError("lme_starlight", refresh_proxy: true);
}
string itemUrl = href;
@ -52,14 +52,14 @@ namespace LME.StarLight.Controllers
{
var searchResults = await invoke.Search(title, original_title);
if (searchResults == null || searchResults.Count == 0)
return OnError("lme.starlight", refresh_proxy: true);
return OnError("lme_starlight", refresh_proxy: true);
if (searchResults.Count > 1)
{
var similar_tpl = new SimilarTpl(searchResults.Count);
foreach (var res in searchResults)
{
string link = $"{host}/lite/lme.starlight?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial={serial}&href={HttpUtility.UrlEncode(res.Href)}";
string link = $"{host}/lite/lme_starlight?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial={serial}&href={HttpUtility.UrlEncode(res.Href)}";
similar_tpl.Append(res.Title, string.Empty, string.Empty, link, string.Empty);
}
@ -71,7 +71,7 @@ namespace LME.StarLight.Controllers
var project = await invoke.GetProject(itemUrl);
if (project == null)
return OnError("lme.starlight", refresh_proxy: true);
return OnError("lme_starlight", refresh_proxy: true);
if (serial == 1 && project.Seasons.Count > 0)
{
@ -82,7 +82,7 @@ namespace LME.StarLight.Controllers
{
var seasonInfo = project.Seasons[i];
string seasonName = string.IsNullOrEmpty(seasonInfo.Title) ? $"Сезон {i + 1}" : seasonInfo.Title;
string link = $"{host}/lite/lme.starlight?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&s={i}&href={HttpUtility.UrlEncode(itemUrl)}";
string link = $"{host}/lite/lme_starlight?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&s={i}&href={HttpUtility.UrlEncode(itemUrl)}";
season_tpl.Append(seasonName, link, i.ToString());
}
@ -90,13 +90,13 @@ namespace LME.StarLight.Controllers
}
if (s < 0 || s >= project.Seasons.Count)
return OnError("lme.starlight", refresh_proxy: true);
return OnError("lme_starlight", refresh_proxy: true);
var season = project.Seasons[s];
string seasonSlug = season.Slug;
var episodes = invoke.GetEpisodes(project, seasonSlug);
if (episodes == null || episodes.Count == 0)
return OnError("lme.starlight", refresh_proxy: true);
return OnError("lme_starlight", refresh_proxy: true);
var episode_tpl = new EpisodeTpl();
int index = 1;
@ -114,7 +114,7 @@ namespace LME.StarLight.Controllers
continue;
string episodeName = string.IsNullOrEmpty(ep.Title) ? $"Епізод {index}" : ep.Title;
string callUrl = $"{host}/lite/lme.starlight/play?hash={HttpUtility.UrlEncode(ep.Hash)}&title={HttpUtility.UrlEncode(title ?? original_title)}";
string callUrl = $"{host}/lite/lme_starlight/play?hash={HttpUtility.UrlEncode(ep.Hash)}&title={HttpUtility.UrlEncode(title ?? original_title)}";
episode_tpl.Append(episodeName, title ?? original_title, seasonNumber, index.ToString("D2"), accsArgs(callUrl), "call");
index++;
}
@ -128,9 +128,9 @@ namespace LME.StarLight.Controllers
hash = project.Episodes.FirstOrDefault(e => !string.IsNullOrEmpty(e.Hash))?.Hash;
if (string.IsNullOrEmpty(hash))
return OnError("lme.starlight", refresh_proxy: true);
return OnError("lme_starlight", refresh_proxy: true);
string callUrl = $"{host}/lite/lme.starlight/play?hash={HttpUtility.UrlEncode(hash)}&title={HttpUtility.UrlEncode(title ?? original_title)}";
string callUrl = $"{host}/lite/lme_starlight/play?hash={HttpUtility.UrlEncode(hash)}&title={HttpUtility.UrlEncode(title ?? original_title)}";
var movie_tpl = new MovieTpl(title, original_title, 1);
movie_tpl.Append(string.IsNullOrEmpty(title) ? "StarLight" : title, accsArgs(callUrl), "call");
@ -139,13 +139,13 @@ namespace LME.StarLight.Controllers
}
[HttpGet]
[Route("lite/lme.starlight/play")]
[Route("lite/lme_starlight/play")]
async public Task<ActionResult> Play(string hash, string title)
{
await UpdateService.ConnectAsync(host);
if (string.IsNullOrEmpty(hash))
return OnError("lme.starlight", refresh_proxy: true);
return OnError("lme_starlight", refresh_proxy: true);
var init = loadKit(ModInit.StarLight);
if (!init.enable)
@ -154,7 +154,7 @@ namespace LME.StarLight.Controllers
var invoke = new StarLightInvoke(init, hybridCache, OnLog, proxyManager, httpHydra);
var result = await invoke.ResolveStream(hash);
if (result == null || string.IsNullOrEmpty(result.Stream))
return OnError("lme.starlight", refresh_proxy: true);
return OnError("lme_starlight", refresh_proxy: true);
string videoTitle = title ?? result.Name ?? "";

View File

@ -76,7 +76,7 @@ namespace LME.StarLight
}
// Виводити "уточнити пошук"
RegisterWithSearch("lme.starlight");
RegisterWithSearch("lme_starlight");
}
private static void RegisterWithSearch(string plugin)

View File

@ -30,7 +30,7 @@ namespace LME.StarLight
if (UpdateService.IsDisconnected())
init.overridehost = null;
online.Add(new ModuleOnlineItem(init, "lme.starlight"));
online.Add(new ModuleOnlineItem(init, "lme_starlight"));
}
return online;

View File

@ -23,7 +23,7 @@ namespace LME.UafilmME.Controllers
}
[HttpGet]
[Route("lite/lme.uafilmme")]
[Route("lite/lme_uafilmme")]
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);
@ -37,13 +37,13 @@ namespace LME.UafilmME.Controllers
if (checksearch)
{
if (!IsCheckOnlineSearchEnabled())
return OnError("lme.uafilmme", refresh_proxy: true);
return OnError("lme_uafilmme", refresh_proxy: true);
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("lme.uafilmme", refresh_proxy: true);
return OnError("lme_uafilmme", refresh_proxy: true);
}
long titleId = 0;
@ -54,8 +54,8 @@ namespace LME.UafilmME.Controllers
var searchResults = await invoke.Search(title, original_title, year);
if (searchResults == null || searchResults.Count == 0)
{
OnLog("lme.uafilmme: пошук нічого не повернув.");
return OnError("lme.uafilmme", refresh_proxy: true);
OnLog("lme_uafilmme: пошук нічого не повернув.");
return OnError("lme_uafilmme", refresh_proxy: true);
}
var best = invoke.SelectBestSearchResult(searchResults, id, imdb_id, title, original_title, year, serial);
@ -72,11 +72,11 @@ namespace LME.UafilmME.Controllers
{
string details = item.IsSeries ? "Серіал" : "Фільм";
string itemYear = item.Year > 1900 ? item.Year.ToString() : string.Empty;
string link = $"{host}/lite/lme.uafilmme?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial={serial}&href={item.Id}";
string link = $"{host}/lite/lme_uafilmme?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial={serial}&href={item.Id}";
similarTpl.Append(item.Name, itemYear, details, link, item.Poster);
}
OnLog($"lme.uafilmme: кілька схожих збігів, повертаю SimilarTpl ({ordered.Count}).");
OnLog($"lme_uafilmme: кілька схожих збігів, повертаю SimilarTpl ({ordered.Count}).");
return rjson
? Content(similarTpl.ToJson(), "application/json; charset=utf-8")
: Content(similarTpl.ToHtml(), "text/html; charset=utf-8");
@ -87,8 +87,8 @@ namespace LME.UafilmME.Controllers
if (titleId <= 0)
{
OnLog("lme.uafilmme: не вдалося визначити title_id.");
return OnError("lme.uafilmme", refresh_proxy: true);
OnLog("lme_uafilmme: не вдалося визначити title_id.");
return OnError("lme_uafilmme", refresh_proxy: true);
}
if (serial == 1)
@ -98,8 +98,8 @@ namespace LME.UafilmME.Controllers
var seasons = await invoke.GetAllSeasons(titleId);
if (seasons == null || seasons.Count == 0)
{
OnLog($"lme.uafilmme: сезони не знайдено для title_id={titleId}.");
return OnError("lme.uafilmme", refresh_proxy: true);
OnLog($"lme_uafilmme: сезони не знайдено для title_id={titleId}.");
return OnError("lme_uafilmme", refresh_proxy: true);
}
var seasonTpl = new SeasonTpl(seasons.Count);
@ -109,7 +109,7 @@ namespace LME.UafilmME.Controllers
? $"Сезон {season.Number} ({season.EpisodesCount} еп.)"
: $"Сезон {season.Number}";
string link = $"{host}/lite/lme.uafilmme?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&s={season.Number}&href={titleId}";
string link = $"{host}/lite/lme_uafilmme?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&s={season.Number}&href={titleId}";
seasonTpl.Append(seasonName, link, season.Number.ToString());
}
@ -120,15 +120,15 @@ namespace LME.UafilmME.Controllers
if (s <= 0)
{
OnLog($"lme.uafilmme: некоректний номер сезону s={s}.");
return OnError("lme.uafilmme", refresh_proxy: true);
OnLog($"lme_uafilmme: некоректний номер сезону s={s}.");
return OnError("lme_uafilmme", refresh_proxy: true);
}
var episodes = await invoke.GetSeasonEpisodes(titleId, s);
if (episodes == null || episodes.Count == 0)
{
OnLog($"lme.uafilmme: епізоди не знайдено для title_id={titleId}, season={s}.");
return OnError("lme.uafilmme", refresh_proxy: true);
OnLog($"lme_uafilmme: епізоди не знайдено для title_id={titleId}, season={s}.");
return OnError("lme_uafilmme", refresh_proxy: true);
}
var episodeTpl = new EpisodeTpl();
@ -145,7 +145,7 @@ namespace LME.UafilmME.Controllers
? episode.Name
: $"Епізод {episodeNumber}";
string callUrl = $"{host}/lite/lme.uafilmme/play?video_id={episode.PrimaryVideoId}&title_id={titleId}&s={s}&e={episodeNumber}&title={HttpUtility.UrlEncode(title ?? original_title)}";
string callUrl = $"{host}/lite/lme_uafilmme/play?video_id={episode.PrimaryVideoId}&title_id={titleId}&s={s}&e={episodeNumber}&title={HttpUtility.UrlEncode(title ?? original_title)}";
episodeTpl.Append(episodeName, title ?? original_title, s.ToString(), episodeNumber.ToString("D2"), accsArgs(callUrl), "call");
fallbackEpisodeNumber = Math.Max(fallbackEpisodeNumber, episodeNumber + 1);
@ -154,8 +154,8 @@ namespace LME.UafilmME.Controllers
if (appended == 0)
{
OnLog($"lme.uafilmme: у сезоні {s} немає епізодів з playable video_id.");
return OnError("lme.uafilmme", refresh_proxy: true);
OnLog($"lme_uafilmme: у сезоні {s} немає епізодів з playable video_id.");
return OnError("lme_uafilmme", refresh_proxy: true);
}
return rjson
@ -167,8 +167,8 @@ namespace LME.UafilmME.Controllers
var videos = await invoke.GetMovieVideos(titleId);
if (videos == null || videos.Count == 0)
{
OnLog($"lme.uafilmme: не знайдено відео для фільму title_id={titleId}.");
return OnError("lme.uafilmme", refresh_proxy: true);
OnLog($"lme_uafilmme: не знайдено відео для фільму title_id={titleId}.");
return OnError("lme_uafilmme", refresh_proxy: true);
}
var movieTpl = new MovieTpl(title, original_title, videos.Count);
@ -176,7 +176,7 @@ namespace LME.UafilmME.Controllers
foreach (var video in videos)
{
string label = BuildVideoLabel(video, index);
string callUrl = $"{host}/lite/lme.uafilmme/play?video_id={video.Id}&title_id={titleId}&title={HttpUtility.UrlEncode(title ?? original_title)}";
string callUrl = $"{host}/lite/lme_uafilmme/play?video_id={video.Id}&title_id={titleId}&title={HttpUtility.UrlEncode(title ?? original_title)}";
movieTpl.Append(label, accsArgs(callUrl), "call");
index++;
}
@ -188,13 +188,13 @@ namespace LME.UafilmME.Controllers
}
[HttpGet]
[Route("lite/lme.uafilmme/play")]
[Route("lite/lme_uafilmme/play")]
async public Task<ActionResult> Play(long video_id, long title_id = 0, int s = 0, int e = 0, string title = null)
{
await UpdateService.ConnectAsync(host);
if (video_id <= 0)
return OnError("lme.uafilmme", refresh_proxy: true);
return OnError("lme_uafilmme", refresh_proxy: true);
var init = loadKit(ModInit.UafilmME);
if (!init.enable)
@ -205,8 +205,8 @@ namespace LME.UafilmME.Controllers
var videos = invoke.CollectPlayableVideos(watch);
if (videos == null || videos.Count == 0)
{
OnLog($"lme.uafilmme Play: watch/{video_id} не повернув playable stream.");
return OnError("lme.uafilmme", refresh_proxy: true);
OnLog($"lme_uafilmme Play: watch/{video_id} не повернув playable stream.");
return OnError("lme_uafilmme", refresh_proxy: true);
}
var headers = new List<HeadersModel>()
@ -229,8 +229,8 @@ namespace LME.UafilmME.Controllers
var first = streamQuality.Firts();
if (string.IsNullOrWhiteSpace(first.link))
{
OnLog($"lme.uafilmme Play: не вдалося зібрати streamquality для video_id={video_id}.");
return OnError("lme.uafilmme", refresh_proxy: true);
OnLog($"lme_uafilmme Play: не вдалося зібрати streamquality для video_id={video_id}.");
return OnError("lme_uafilmme", refresh_proxy: true);
}
string videoTitle = !string.IsNullOrWhiteSpace(title)

View File

@ -69,7 +69,7 @@ namespace LME.UafilmME
UafilmME.apn = null;
}
RegisterWithSearch("lme.uafilmme");
RegisterWithSearch("lme_uafilmme");
}
private static void RegisterWithSearch(string plugin)

View File

@ -24,7 +24,7 @@ namespace LME.UafilmME
if (UpdateService.IsDisconnected())
init.overridehost = null;
online.Add(new ModuleOnlineItem(init, "lme.uafilmme"));
online.Add(new ModuleOnlineItem(init, "lme_uafilmme"));
}
return online;

View File

@ -28,7 +28,7 @@ namespace LME.Uaflix.Controllers
}
[HttpGet]
[Route("lite/lme.uaflix")]
[Route("lite/lme_uaflix")]
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, string href = null, bool checksearch = false)
{
await UpdateService.ConnectAsync(host);
@ -38,10 +38,10 @@ namespace LME.Uaflix.Controllers
var init = this.init;
TryEnableMagicApn(init);
OnLog($"lme.uaflix: === UAFLIX INDEX START ===");
OnLog($"lme.uaflix: Index: title={title}, serial={serial}, s={s}, play={play}, href={href}, checksearch={checksearch}");
OnLog($"lme.uaflix: Index: kinopoisk_id={kinopoisk_id}, imdb_id={imdb_id}, id={id}");
OnLog($"lme.uaflix: Index: year={year}, source={source}, t={t}, e={e}, rjson={rjson}");
OnLog($"lme_uaflix: === UAFLIX INDEX START ===");
OnLog($"lme_uaflix: Index: title={title}, serial={serial}, s={s}, play={play}, href={href}, checksearch={checksearch}");
OnLog($"lme_uaflix: Index: kinopoisk_id={kinopoisk_id}, imdb_id={imdb_id}, id={id}");
OnLog($"lme_uaflix: Index: year={year}, source={source}, t={t}, e={e}, rjson={rjson}");
var auth = new UaflixAuth(init, memoryCache, OnLog, proxyManager);
var invoke = new UaflixInvoke(init, hybridCache, OnLog, proxyManager, auth, httpHydra);
@ -50,7 +50,7 @@ namespace LME.Uaflix.Controllers
if (checksearch)
{
if (!IsCheckOnlineSearchEnabled())
return OnError("lme.uaflix", refresh_proxy: true);
return OnError("lme_uaflix", refresh_proxy: true);
try
{
@ -64,13 +64,13 @@ namespace LME.Uaflix.Controllers
OnLog("checksearch: Контент не знайдено");
OnLog("=== RETURN: checksearch OnError ===");
return OnError("lme.uaflix", refresh_proxy: true);
return OnError("lme_uaflix", refresh_proxy: true);
}
catch (Exception ex)
{
OnLog($"checksearch: помилка - {ex.Message}");
OnLog("=== RETURN: checksearch exception OnError ===");
return OnError("lme.uaflix", refresh_proxy: true);
return OnError("lme_uaflix", refresh_proxy: true);
}
}
@ -81,7 +81,7 @@ namespace LME.Uaflix.Controllers
if (string.IsNullOrWhiteSpace(urlToParse))
{
OnLog("=== RETURN: play missing url OnError ===");
return OnError("lme.uaflix", refresh_proxy: true);
return OnError("lme_uaflix", refresh_proxy: true);
}
var playResult = await invoke.ParseEpisode(urlToParse);
@ -92,9 +92,9 @@ namespace LME.Uaflix.Controllers
}
OnLog("=== RETURN: play no streams ===");
return OnError("lme.uaflix", refresh_proxy: true);
return OnError("lme_uaflix", refresh_proxy: true);
}
// Якщо є episode_url але немає play=true, це виклик для отримання інформації про стрім (для method: 'call')
string episodeUrl = Request.Query["episode_url"];
if (!string.IsNullOrEmpty(episodeUrl))
@ -108,9 +108,9 @@ namespace LME.Uaflix.Controllers
OnLog($"=== RETURN: call method JSON for episode_url ===");
return UpdateService.Validate(Content(jsonResult, "application/json; charset=utf-8"));
}
OnLog("=== RETURN: call method no streams ===");
return OnError("lme.uaflix", refresh_proxy: true);
return OnError("lme_uaflix", refresh_proxy: true);
}
string filmUrl = href;
@ -122,7 +122,7 @@ namespace LME.Uaflix.Controllers
{
OnLog("No search results found");
OnLog("=== RETURN: no search results OnError ===");
return OnError("lme.uaflix", refresh_proxy: true);
return OnError("lme_uaflix", refresh_proxy: true);
}
var selectedResult = invoke.SelectBestSearchResult(searchResults, title, original_title, year);
@ -143,7 +143,7 @@ namespace LME.Uaflix.Controllers
var similar_tpl = new SimilarTpl(orderedResults.Count);
foreach (var res in orderedResults)
{
string link = $"{host}/lite/lme.uaflix?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial={serial}&href={HttpUtility.UrlEncode(res.Url)}";
string link = $"{host}/lite/lme_uaflix?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial={serial}&href={HttpUtility.UrlEncode(res.Url)}";
string y = res.Year > 0 ? res.Year.ToString() : string.Empty;
string details = res.Category switch
{
@ -176,13 +176,13 @@ namespace LME.Uaflix.Controllers
{
OnLog("No seasons found in season index");
OnLog("=== RETURN: no seasons OnError ===");
return OnError("lme.uaflix", refresh_proxy: true);
return OnError("lme_uaflix", refresh_proxy: true);
}
var season_tpl = new SeasonTpl(seasons.Count);
foreach (int season in seasons)
{
string link = $"{host}/lite/lme.uaflix?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&s={season}&href={HttpUtility.UrlEncode(filmUrl)}";
string link = $"{host}/lite/lme_uaflix?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&s={season}&href={HttpUtility.UrlEncode(filmUrl)}";
if (!string.IsNullOrWhiteSpace(t))
link += $"&t={HttpUtility.UrlEncode(t)}";
@ -204,7 +204,7 @@ namespace LME.Uaflix.Controllers
{
OnLog($"No voices found for season {s}");
OnLog("=== RETURN: no voices for season OnError ===");
return OnError("lme.uaflix", refresh_proxy: true);
return OnError("lme_uaflix", refresh_proxy: true);
}
var voicesForSeason = structure.Voices
.Select(v => new { DisplayName = v.Key, Info = v.Value })
@ -214,7 +214,7 @@ namespace LME.Uaflix.Controllers
{
OnLog($"No voices found for season {s}");
OnLog("=== RETURN: no voices for season OnError ===");
return OnError("lme.uaflix", refresh_proxy: true);
return OnError("lme_uaflix", refresh_proxy: true);
}
// Автоматично вибираємо першу озвучку якщо не вказана
@ -249,7 +249,7 @@ namespace LME.Uaflix.Controllers
var voice_tpl = new VoiceTpl();
foreach (var voice in voicesForSeason)
{
string voiceLink = $"{host}/lite/lme.uaflix?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&href={HttpUtility.UrlEncode(filmUrl)}";
string voiceLink = $"{host}/lite/lme_uaflix?imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial=1&href={HttpUtility.UrlEncode(filmUrl)}";
voiceLink += $"&s={s}&t={HttpUtility.UrlEncode(voice.DisplayName)}";
bool isActive = voice.DisplayName == t;
@ -276,7 +276,7 @@ namespace LME.Uaflix.Controllers
{
// Для zetvideo-vod та ashdi-vod використовуємо URL епізоду для виклику
// Потрібно передати URL епізоду в інший параметр, щоб не плутати з play=true
string callUrl = $"{host}/lite/lme.uaflix?episode_url={HttpUtility.UrlEncode(ep.File)}&imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial={serial}&s={s}&e={ep.Number}";
string callUrl = $"{host}/lite/lme_uaflix?episode_url={HttpUtility.UrlEncode(ep.File)}&imdb_id={imdb_id}&kinopoisk_id={kinopoisk_id}&title={HttpUtility.UrlEncode(title)}&original_title={HttpUtility.UrlEncode(original_title)}&year={year}&serial={serial}&s={s}&e={ep.Number}";
episode_tpl.Append(
name: episodeTitle,
title: title,
@ -307,7 +307,7 @@ namespace LME.Uaflix.Controllers
{
OnLog($"No valid episodes after filtering for season {s}, voice {t}");
OnLog("=== RETURN: no valid episodes OnError ===");
return OnError("lme.uaflix", refresh_proxy: true);
return OnError("lme_uaflix", refresh_proxy: true);
}
OnLog($"Created EpisodeTpl with {appendedEpisodes} episodes");
@ -329,7 +329,7 @@ namespace LME.Uaflix.Controllers
// Fallback: якщо жоден з умов не виконався
OnLog($"Fallback: s={s}, t={t}");
OnLog("=== RETURN: fallback OnError ===");
return OnError("lme.uaflix", refresh_proxy: true);
return OnError("lme_uaflix", refresh_proxy: true);
}
else // Фільм
{
@ -337,7 +337,7 @@ namespace LME.Uaflix.Controllers
if (playResult?.streams == null || playResult.streams.Count == 0)
{
OnLog("=== RETURN: movie no streams ===");
return OnError("lme.uaflix", refresh_proxy: true);
return OnError("lme_uaflix", refresh_proxy: true);
}
var tpl = new MovieTpl(title, original_title, playResult.streams.Count);
@ -358,7 +358,7 @@ namespace LME.Uaflix.Controllers
if (tpl.data == null || tpl.data.Count == 0)
{
OnLog("=== RETURN: movie template empty ===");
return OnError("lme.uaflix", refresh_proxy: true);
return OnError("lme_uaflix", refresh_proxy: true);
}
OnLog("=== RETURN: movie template ===");
@ -401,7 +401,7 @@ namespace LME.Uaflix.Controllers
return;
ApnHelper.ApplyInitConf(true, ModInit.MagicApnAshdiHost, init);
OnLog($"lme.uaflix: увімкнено magic_apn для Ashdi (player={player ?? "unknown"}).");
OnLog($"lme_uaflix: увімкнено magic_apn для Ashdi (player={player ?? "unknown"}).");
}
private static string StripLampacArgs(string url)

View File

@ -85,7 +85,7 @@ namespace LME.Uaflix
}
// Показувати «уточнити пошук».
RegisterWithSearch("lme.uaflix");
RegisterWithSearch("lme_uaflix");
}
private static void RegisterWithSearch(string plugin)

View File

@ -26,7 +26,7 @@ namespace LME.Uaflix
if (UpdateService.IsDisconnected())
init.overridehost = null;
online.Add(new ModuleOnlineItem(init, "lme.uaflix"));
online.Add(new ModuleOnlineItem(init, "lme_uaflix"));
}
return online;

View File

@ -44,7 +44,7 @@ namespace LME.Uaflix
}
catch
{
_onLog("lme.uaflix: Auth: некоректний host у конфігурації");
_onLog("lme_uaflix: Auth: некоректний host у конфігурації");
return null;
}
@ -83,7 +83,7 @@ namespace LME.Uaflix
if (!CanUseCredentials)
return null;
string loginThrottleKey = $"lme.uaflix:login:{_init.host}:{_init.login}";
string loginThrottleKey = $"lme_uaflix:login:{_init.host}:{_init.login}";
if (!forceRefresh && _memoryCache.TryGetValue(loginThrottleKey, out _))
return null;
@ -141,7 +141,7 @@ namespace LME.Uaflix
if (response.response == null)
{
_onLog("lme.uaflix: Auth: логін не вдався, немає HTTP-відповіді");
_onLog("lme_uaflix: Auth: логін не вдався, немає HTTP-відповіді");
return (false, null, null);
}
@ -176,16 +176,16 @@ namespace LME.Uaflix
if (hasAuthError || !hasSession || !hasDleAuthCookie)
{
_onLog($"lme.uaflix: Auth: авторизація неуспішна, status={(int)response.response.StatusCode}");
_onLog($"lme_uaflix: Auth: авторизація неуспішна, status={(int)response.response.StatusCode}");
return (false, null, null);
}
_onLog("lme.uaflix: Auth: авторизація успішна");
_onLog("lme_uaflix: Auth: авторизація успішна");
return (true, cookie, container);
}
catch (Exception ex)
{
_onLog($"lme.uaflix: Auth: помилка авторизації - {ex.Message}");
_onLog($"lme_uaflix: Auth: помилка авторизації - {ex.Message}");
return (false, null, null);
}
}

View File

@ -97,7 +97,7 @@ namespace LME.Uaflix
&& _auth != null
&& _auth.CanUseCredentials)
{
_onLog($"lme.uaflix: Auth: порожня відповідь для {url}, виконую повторну авторизацію");
_onLog($"lme_uaflix: Auth: порожня відповідь для {url}, виконую повторну авторизацію");
string refreshedCookie = await _auth.GetCookieHeaderAsync(forceRefresh: true);
_auth.ApplyCookieHeader(requestHeaders, refreshedCookie);
content = await _httpHydra.Get(url, newheaders: requestHeaders, statusCodeOK: false);
@ -119,7 +119,7 @@ namespace LME.Uaflix
&& _auth != null
&& _auth.CanUseCredentials)
{
_onLog($"lme.uaflix: Auth: отримано 403 для {url}, виконую повторну авторизацію");
_onLog($"lme_uaflix: Auth: отримано 403 для {url}, виконую повторну авторизацію");
string refreshedCookie = await _auth.GetCookieHeaderAsync(forceRefresh: true);
_auth.ApplyCookieHeader(requestHeaders, refreshedCookie);
@ -133,7 +133,7 @@ namespace LME.Uaflix
if (response.response?.StatusCode != HttpStatusCode.OK)
{
if (response.response != null)
_onLog($"lme.uaflix: HTTP {(int)response.response.StatusCode} для {url}");
_onLog($"lme_uaflix: HTTP {(int)response.response.StatusCode} для {url}");
return null;
}
@ -246,7 +246,7 @@ namespace LME.Uaflix
if (string.IsNullOrWhiteSpace(pageUrl))
return (null, null);
string memKey = $"lme.uaflix:episode-player:{pageUrl}";
string memKey = $"lme_uaflix:episode-player:{pageUrl}";
if (_hybridCache.TryGetValue(memKey, out EpisodePlayerInfo cached))
return (cached?.IframeUrl, cached?.PlayerType);
@ -644,7 +644,7 @@ namespace LME.Uaflix
/// </summary>
public async Task<SerialAggregatedStructure> AggregateSerialStructure(string serialUrl)
{
string memKey = $"lme.uaflix:aggregated:{serialUrl}";
string memKey = $"lme_uaflix:aggregated:{serialUrl}";
if (_hybridCache.TryGetValue(memKey, out SerialAggregatedStructure cached))
{
_onLog($"AggregateSerialStructure: Using cached structure for {serialUrl}");
@ -825,7 +825,7 @@ namespace LME.Uaflix
public async Task<PaginationInfo> GetSeasonIndex(string serialUrl)
{
string memKey = $"lme.uaflix:season-index:{serialUrl}";
string memKey = $"lme_uaflix:season-index:{serialUrl}";
if (_hybridCache.TryGetValue(memKey, out PaginationInfo cached))
return cached;
@ -912,7 +912,7 @@ namespace LME.Uaflix
if (season < 0)
return new List<EpisodeLinkInfo>();
string memKey = $"lme.uaflix:season-episodes:{serialUrl}:{season}";
string memKey = $"lme_uaflix:season-episodes:{serialUrl}:{season}";
if (_hybridCache.TryGetValue(memKey, out List<EpisodeLinkInfo> cached))
return cached;
@ -1026,7 +1026,7 @@ namespace LME.Uaflix
if (season < 0)
return null;
string memKey = $"lme.uaflix:season-structure:{serialUrl}:{season}";
string memKey = $"lme_uaflix:season-structure:{serialUrl}:{season}";
if (_hybridCache.TryGetValue(memKey, out SerialAggregatedStructure cached))
{
_onLog($"GetSeasonStructure: Using cached structure for season={season}, url={serialUrl}");
@ -1121,7 +1121,7 @@ namespace LME.Uaflix
async Task<List<VoiceInfo>> ParseMultiEpisodePlayerCached(string iframeUrl, string playerType)
{
string serialKey = NormalizeSerialPlayerKey(playerType, iframeUrl);
string memKey = $"lme.uaflix:player-voices:{playerType}:{serialKey}";
string memKey = $"lme_uaflix:player-voices:{playerType}:{serialKey}";
if (_hybridCache.TryGetValue(memKey, out List<VoiceInfo> cached))
return CloneVoices(cached);
@ -1258,7 +1258,7 @@ namespace LME.Uaflix
public async Task<List<SearchResult>> Search(string imdb_id, long kinopoisk_id, string title, string original_title, int year, int serial, string original_language, string source, string search_query)
{
bool allowAnime = IsAnimeRequest(title, original_title, original_language, source);
string memKey = $"lme.uaflix:search:{kinopoisk_id}:{imdb_id}:{serial}:{year}:{allowAnime}:{title}:{original_title}:{search_query}";
string memKey = $"lme_uaflix:search:{kinopoisk_id}:{imdb_id}:{serial}:{year}:{allowAnime}:{title}:{original_title}:{search_query}";
if (_hybridCache.TryGetValue(memKey, out List<SearchResult> cached))
return cached;
@ -1376,7 +1376,7 @@ namespace LME.Uaflix
}
catch (Exception ex)
{
_onLog($"lme.uaflix: search error: {ex.Message}");
_onLog($"lme_uaflix: search error: {ex.Message}");
return null;
}
}
@ -1456,7 +1456,7 @@ namespace LME.Uaflix
private async Task<SearchMeta> LoadSearchMeta(string url)
{
string memKey = $"lme.uaflix:searchmeta:{url}";
string memKey = $"lme_uaflix:searchmeta:{url}";
if (_hybridCache.TryGetValue(memKey, out SearchMeta cached))
return cached;
@ -1693,7 +1693,7 @@ namespace LME.Uaflix
public async Task<FilmInfo> GetFilmInfo(string filmUrl)
{
string memKey = $"lme.uaflix:filminfo:{filmUrl}";
string memKey = $"lme_uaflix:filminfo:{filmUrl}";
if (_hybridCache.TryGetValue(memKey, out FilmInfo res))
return res;
@ -1761,14 +1761,14 @@ namespace LME.Uaflix
}
catch (Exception ex)
{
_onLog($"lme.uaflix: GetFilmInfo error: {ex.Message}");
_onLog($"lme_uaflix: GetFilmInfo error: {ex.Message}");
}
return null;
}
public async Task<PaginationInfo> GetPaginationInfo(string filmUrl)
{
string memKey = $"lme.uaflix:pagination:{filmUrl}";
string memKey = $"lme_uaflix:pagination:{filmUrl}";
if (_hybridCache.TryGetValue(memKey, out PaginationInfo res))
return res;
@ -1864,7 +1864,7 @@ namespace LME.Uaflix
}
catch (Exception ex)
{
_onLog($"lme.uaflix: GetPaginationInfo error: {ex.Message}");
_onLog($"lme_uaflix: GetPaginationInfo error: {ex.Message}");
}
return null;
}

View File

@ -22,7 +22,7 @@ namespace LME.Unimay.Controllers
}
[HttpGet]
[Route("lite/lme.unimay")]
[Route("lite/lme_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, bool checksearch = false)
{
await UpdateService.ConnectAsync(host);
@ -36,13 +36,13 @@ namespace LME.Unimay.Controllers
if (checksearch)
{
if (!IsCheckOnlineSearchEnabled())
return OnError("lme.unimay");
return OnError("lme_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("lme.unimay");
return OnError("lme_unimay");
}
if (!string.IsNullOrEmpty(code))
@ -59,7 +59,7 @@ namespace LME.Unimay.Controllers
async ValueTask<ActionResult> Search(UnimayInvoke invoke, OnlinesSettings init, string title, string original_title, int serial, bool rjson)
{
string memKey = $"lme.unimay:search:{title}:{original_title}:{serial}";
string memKey = $"lme_unimay:search:{title}:{original_title}:{serial}";
return await InvkSemaphore(memKey, async () =>
{
@ -81,7 +81,7 @@ namespace LME.Unimay.Controllers
async ValueTask<ActionResult> Release(UnimayInvoke invoke, OnlinesSettings init, string code, string title, string original_title, int serial, int s, int e, bool play, bool rjson)
{
string memKey = $"lme.unimay:release:{code}";
string memKey = $"lme_unimay:release:{code}";
return await InvkSemaphore(memKey, async () =>
{
@ -200,7 +200,7 @@ namespace LME.Unimay.Controllers
private static void OnLog(string message)
{
System.Console.WriteLine($"lme.unimay: {message}");
System.Console.WriteLine($"lme_unimay: {message}");
}
}
}

View File

@ -54,7 +54,7 @@ namespace LME.Unimay
Unimay = ModuleInvoke.Init("LME.Unimay", defaults).ToObject<OnlinesSettings>();
// Виводити "уточнити пошук"
RegisterWithSearch("lme.unimay");
RegisterWithSearch("lme_unimay");
}
private static void RegisterWithSearch(string plugin)

View File

@ -30,7 +30,7 @@ namespace LME.Unimay
if (UpdateService.IsDisconnected())
init.overridehost = null;
online.Add(new ModuleOnlineItem(init, "lme.unimay"));
online.Add(new ModuleOnlineItem(init, "lme_unimay"));
}
return online;

View File

@ -30,7 +30,7 @@ namespace LME.Unimay
public async Task<SearchResponse> Search(string title, string original_title, int serial)
{
string memKey = $"lme.unimay:search:{title}:{original_title}:{serial}";
string memKey = $"lme_unimay:search:{title}:{original_title}:{serial}";
if (_hybridCache.TryGetValue(memKey, out SearchResponse searchResults))
return searchResults;
@ -61,7 +61,7 @@ namespace LME.Unimay
public async Task<ReleaseResponse> Release(string code)
{
string memKey = $"lme.unimay:release:{code}";
string memKey = $"lme_unimay:release:{code}";
if (_hybridCache.TryGetValue(memKey, out ReleaseResponse releaseDetail))
return releaseDetail;
@ -104,7 +104,7 @@ namespace LME.Unimay
}
string itemTitle = item.Names?.Ukr ?? item.Names?.Eng ?? item.Title;
string releaseUrl = $"{host}/lite/lme.unimay?code={item.Code}&title={System.Web.HttpUtility.UrlEncode(itemTitle)}&original_title={System.Web.HttpUtility.UrlEncode(original_title ?? "")}&serial={serial}";
string releaseUrl = $"{host}/lite/lme_unimay?code={item.Code}&title={System.Web.HttpUtility.UrlEncode(itemTitle)}&original_title={System.Web.HttpUtility.UrlEncode(original_title ?? "")}&serial={serial}";
results.Add((itemTitle, item.Year, item.Type, releaseUrl));
}
@ -117,7 +117,7 @@ namespace LME.Unimay
return (null, null);
var movieEpisode = releaseDetail.Playlist[0];
string movieLink = $"{host}/lite/lme.unimay?code={releaseDetail.Code}&title={System.Web.HttpUtility.UrlEncode(title)}&original_title={System.Web.HttpUtility.UrlEncode(original_title ?? "")}&serial=0&play=true";
string movieLink = $"{host}/lite/lme_unimay?code={releaseDetail.Code}&title={System.Web.HttpUtility.UrlEncode(title)}&original_title={System.Web.HttpUtility.UrlEncode(original_title ?? "")}&serial=0&play=true";
string movieTitle = movieEpisode.Title ?? title;
return (movieTitle, movieLink);
@ -125,7 +125,7 @@ namespace LME.Unimay
public (string seasonName, string seasonUrl, string seasonId) GetSeasonInfo(string host, string code, string title, string original_title)
{
string seasonUrl = $"{host}/lite/lme.unimay?code={code}&title={System.Web.HttpUtility.UrlEncode(title)}&original_title={System.Web.HttpUtility.UrlEncode(original_title ?? "")}&serial=1&s=1";
string seasonUrl = $"{host}/lite/lme_unimay?code={code}&title={System.Web.HttpUtility.UrlEncode(title)}&original_title={System.Web.HttpUtility.UrlEncode(original_title ?? "")}&serial=1&s=1";
return ("Сезон 1", seasonUrl, "1");
}
@ -139,7 +139,7 @@ namespace LME.Unimay
foreach (var ep in releaseDetail.Playlist.Where(ep => ep.Number >= 1 && ep.Number <= 24).OrderBy(ep => ep.Number))
{
string epTitle = ep.Title ?? $"Епізод {ep.Number}";
string epLink = $"{host}/lite/lme.unimay?code={releaseDetail.Code}&title={System.Web.HttpUtility.UrlEncode(title)}&original_title={System.Web.HttpUtility.UrlEncode(original_title ?? "")}&serial=1&s=1&e={ep.Number}&play=true";
string epLink = $"{host}/lite/lme_unimay?code={releaseDetail.Code}&title={System.Web.HttpUtility.UrlEncode(title)}&original_title={System.Web.HttpUtility.UrlEncode(original_title ?? "")}&serial=1&s=1&e={ep.Number}&play=true";
episodes.Add((epTitle, epLink));
}