Fix HLS proxy fallback and avoid overwriting invalid config

This commit is contained in:
Johnnybegood90
2026-03-14 13:16:09 +01:00
parent 90679e9221
commit fc608ee0e0
2 changed files with 23 additions and 16 deletions
+5
View File
@@ -166,7 +166,12 @@ if ($is_segment) {
if (ob_get_level()) ob_end_clean();
// Resolve redirects with HEAD first so we do not download the segment twice.
// Some HLS/CDN servers reject HEAD on media objects even when GET works.
[$code, , , $final_url] = fetch_with_checked_redirects($url, $allowed_hosts, true);
if ($code === 403 || $code === 405) {
[, , , $final_url] = fetch_with_checked_redirects($url, $allowed_hosts, false);
$code = 200;
}
if ($code >= 400) { http_response_code($code); die(); }