fix: adds download url check for monitors
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after -1m0s

This commit is contained in:
Brock H Caldwell
2026-02-06 19:41:09 -06:00
parent f968e7e622
commit 939b059872

View File

@@ -25,6 +25,10 @@ class DownloadOptionEvaluator
return false;
}
if (false === $this->validateDownloadUrl($result->url)) {
return false;
}
return true;
});
@@ -79,4 +83,18 @@ class DownloadOptionEvaluator
return false;
}
public function validateDownloadUrl(string $downloadUrl)
{
$badFileLocations = [
'https://torrentio.strem.fun/videos/failed_infringement_v2.mp4' => 'Removed for Copyright Infringement.',
];
$headers = get_headers($downloadUrl, true);
if (array_key_exists($headers['Location'], $badFileLocations)) {
return false;
}
return true;
}
}