image_proxy.php 478 B

12345678910111213141516171819
  1. <?php
  2. $config = require "config.php";
  3. require "misc/tools.php";
  4. $url = $_REQUEST["url"];
  5. $requested_root_domain = get_root_domain($url);
  6. $allowed_domains = array("qwant.com", "wikimedia.org", get_root_domain($config->invidious_instance_for_video_results));
  7. if (in_array($requested_root_domain, $allowed_domains))
  8. {
  9. $image = $url;
  10. $image_src = request($image);
  11. header("Content-Type: image/png");
  12. echo $image_src;
  13. }
  14. ?>