mirror of
https://github.com/lampame/lampac-ukraine.git
synced 2026-04-16 17:32:20 +00:00
fix(media): update referer header and stream handling for ashdi.vip
- Change referer header from dynamic host to fixed ashdi.vip URL - Update regex pattern to handle both single and double quotes in file attribute - Add conditional stream header and proxy forcing for ashdi.vip links
This commit is contained in:
parent
011ecb2451
commit
7451df2c27
@ -157,7 +157,7 @@ namespace AnimeON
|
|||||||
var headers = new List<HeadersModel>()
|
var headers = new List<HeadersModel>()
|
||||||
{
|
{
|
||||||
new HeadersModel("User-Agent", "Mozilla/5.0"),
|
new HeadersModel("User-Agent", "Mozilla/5.0"),
|
||||||
new HeadersModel("Referer", _init.host)
|
new HeadersModel("Referer", "https://ashdi.vip/")
|
||||||
};
|
};
|
||||||
|
|
||||||
_onLog($"AnimeON: using proxy {_proxyManager.CurrentProxyIp} for {url}");
|
_onLog($"AnimeON: using proxy {_proxyManager.CurrentProxyIp} for {url}");
|
||||||
@ -165,7 +165,7 @@ namespace AnimeON
|
|||||||
if (string.IsNullOrEmpty(html))
|
if (string.IsNullOrEmpty(html))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var match = System.Text.RegularExpressions.Regex.Match(html, @"file:\s*""([^""]+)""");
|
var match = System.Text.RegularExpressions.Regex.Match(html, @"file\s*:\s*['""]([^'""]+)['""]");
|
||||||
if (match.Success)
|
if (match.Success)
|
||||||
{
|
{
|
||||||
return match.Groups[1].Value;
|
return match.Groups[1].Value;
|
||||||
|
|||||||
@ -309,7 +309,19 @@ namespace AnimeON.Controllers
|
|||||||
return OnError("animeon", proxyManager);
|
return OnError("animeon", proxyManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
string streamUrl = HostStreamProxy(init, accsArgs(streamLink));
|
List<HeadersModel> streamHeaders = null;
|
||||||
|
bool forceProxy = false;
|
||||||
|
if (streamLink.Contains("ashdi.vip", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
streamHeaders = new List<HeadersModel>()
|
||||||
|
{
|
||||||
|
new HeadersModel("User-Agent", "Mozilla/5.0"),
|
||||||
|
new HeadersModel("Referer", "https://ashdi.vip/")
|
||||||
|
};
|
||||||
|
forceProxy = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
string streamUrl = HostStreamProxy(init, accsArgs(streamLink), headers: streamHeaders, force_streamproxy: forceProxy);
|
||||||
string jsonResult = $"{{\"method\":\"play\",\"url\":\"{streamUrl}\",\"title\":\"{title ?? string.Empty}\"}}";
|
string jsonResult = $"{{\"method\":\"play\",\"url\":\"{streamUrl}\",\"title\":\"{title ?? string.Empty}\"}}";
|
||||||
OnLog("AnimeON Play: return call JSON");
|
OnLog("AnimeON Play: return call JSON");
|
||||||
return Content(jsonResult, "application/json; charset=utf-8");
|
return Content(jsonResult, "application/json; charset=utf-8");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user