2022-06-27 14:00:22 -07:00
|
|
|
<?php
|
|
|
|
|
2022-07-08 12:52:26 -07:00
|
|
|
$config = require "config.php";
|
|
|
|
require "misc/tools.php";
|
2022-06-27 14:00:22 -07:00
|
|
|
|
2022-08-28 11:41:33 -07:00
|
|
|
$url = $_REQUEST["url"];
|
2023-01-27 09:17:57 -08:00
|
|
|
$requested_root_domain = get_root_domain($url);
|
2022-07-08 12:52:26 -07:00
|
|
|
|
2023-01-27 09:17:57 -08:00
|
|
|
$allowed_domains = array("qwant.com", "wikimedia.org", get_root_domain($config->invidious_instance_for_video_results));
|
2022-09-03 10:45:47 -07:00
|
|
|
|
2023-01-27 09:17:57 -08:00
|
|
|
if (in_array($requested_root_domain, $allowed_domains))
|
2022-08-28 11:41:33 -07:00
|
|
|
{
|
|
|
|
$image = $url;
|
|
|
|
$image_src = request($image);
|
|
|
|
|
2023-02-05 00:55:28 -08:00
|
|
|
header("Content-Type: image/png");
|
2022-08-28 11:41:33 -07:00
|
|
|
echo $image_src;
|
|
|
|
}
|
2022-06-27 14:00:22 -07:00
|
|
|
?>
|