123456789101112131415161718192021222324 |
- <?php
- require_once("../config.php");
- $url = htmlspecialchars($_GET["url"]);
- if (explode("/", $url)[0] != "i.pximg.net" && explode("/", $url)[0] != "s.pximg.net") die("不正なURL");
- // ファイル類
- $ext = explode(".", $url);
- $ext = $ext[array_key_last($ext)];
- if ($ext == "jpg") $ext = "jpeg";
- // ファイル名
- $fname = explode("/", $url);
- $fname = $fname[array_key_last($fname)];
- header("Content-type: image/".$ext);
- header("Content-Disposition: filename=\"".$fname."\"");
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "https://".$url);
- curl_setopt($ch, CURLOPT_REFERER, "https://www.pixiv.net/");
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_exec($ch);
- curl_close($ch);
- ?>
|