Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
939b059872 |
@@ -25,6 +25,10 @@ class DownloadOptionEvaluator
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (false === $this->validateDownloadUrl($result->url)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -79,4 +83,18 @@ class DownloadOptionEvaluator
|
|||||||
|
|
||||||
return false;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user