From e1bc69e587a3530496fdba7927322ca40ffe197d Mon Sep 17 00:00:00 2001 From: hakasenyang Date: Sat, 7 Jan 2017 08:18:20 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EA=B0=80?= =?UTF-8?q?=EC=A0=B8=EC=98=A4=EA=B8=B0=20=EB=B0=A9=EC=8B=9D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 기존의 일반 wasabisyrup.com 이미지가 아닌 다른 방법으로 뿌려주도록 변경. 속도 느려질 수 있음. --- app.js | 4 ++-- fmaru.php | 4 ++-- index.php | 37 ++++++++++++++++++++++++++++++++++++- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/app.js b/app.js index 796b82b..ace47bb 100644 --- a/app.js +++ b/app.js @@ -280,7 +280,7 @@ var EpisodePage = function (_React$Component) { value: function _convertUrl(url) { if (url.toLowerCase().indexOf("wasabisyrup") > -1) { //var comps = url.split('/').slice(3); - //return config.apiUrl + "/image_parse.php?url=" + url; + return config.apiUrl + "/?imgurl=" + url; //return config.apiUrl + "/image/" + comps.join("/"); } return url; @@ -538,7 +538,7 @@ var MangaItem = function (_React$Component) { if (imageUrl.indexOf("marumaru.in") > -1) { //var comps = imageUrl.split("\/").slice(3); //imageUrl = config.apiUrl + "/preview/" + comps.join("/"); - //imageUrl = config.apiUrl + "/image_parse.php?url=" + imageUrl; + imageUrl = config.apiUrl + "/?imgurl=" + imageUrl; } var content = _react2.default.createElement( diff --git a/fmaru.php b/fmaru.php index 1770738..f68d206 100644 --- a/fmaru.php +++ b/fmaru.php @@ -12,7 +12,7 @@
- - + + diff --git a/index.php b/index.php index f4e305d..5e53d08 100644 --- a/index.php +++ b/index.php @@ -3,6 +3,41 @@ $marumaru = new Marumaru(); $num = $_GET['num']; $image = $_GET['image']; + $imgurl = $_GET['imgurl']; + + if(isset($imgurl)) + { + $a = parse_url($imgurl); + switch($a['host']) + { + case 'www.yuncomics.com': + case 'wasabisyrup.com': + case 'blog.yuncomics.com': + case 'marumaru.in': + case 'www.wasabisyrup.com': + break; + default: + exit; + } + + $last_modified = gmdate('D, d M Y H:i:s', time()) . ' GMT'; + if (array_key_exists('HTTP_IF_MODIFIED_SINCE', $_SERVER)) + { + $if_modified_since = strtotime(preg_replace('/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE'])); + if ($if_modified_since >= $last_modified) + { + header($_SERVER['SERVER_PROTOCOL'].' 304 Not Modified'); + exit(); + } + } + + header('Cache-Control: max-age=86400, public'); + header('Expires: '. gmdate('D, d M Y H:i:s \G\M\T', time() + 86400)); + header('Last-Modified: ' . gmdate('D, d M Y H:i:s',time() + 86400 ) . ' GMT' ); + header('Content-Type: image/jpeg'); + echo $marumaru->WEBParsing($imgurl, NULL, NULL); + exit; + } if(!isset($num)) { ?> @@ -103,7 +138,7 @@ startdata: $jsonon = ($_GET['json'] == 1) ? true : false; for($i=1;$i
'; + echo '
'; } else {