feat(media): implement provider-specific streaming configuration

Introduces dynamic header injection and proxy enforcement for ashdi.vip
streams to maintain compatibility with their content delivery requirements.
The implementation detects the provider domain and automatically applies
necessary HTTP headers alongside mandatory proxy routing.

BREAKING CHANGE: HostStreamProxy now accepts optional headers and
force_streamproxy parameters to support enhanced streaming configurations
This commit is contained in:
baliasnyifeliks 2026-01-13 11:19:35 +02:00
parent cc91635a05
commit 011ecb2451

View File

@ -53,8 +53,23 @@ namespace CikavaIdeya.Controllers
if (playResult.streams != null && playResult.streams.Count > 0)
{
OnLog($"Controller: redirecting to stream URL: {playResult.streams.First().link}");
return Redirect(HostStreamProxy(init, accsArgs(playResult.streams.First().link)));
string streamLink = playResult.streams.First().link;
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);
OnLog($"Controller: redirecting to stream URL: {streamUrl}");
return Redirect(streamUrl);
}
if (!string.IsNullOrEmpty(playResult.iframe_url))
@ -381,4 +396,4 @@ namespace CikavaIdeya.Controllers
return result;
}
}
}
}