diff --git a/_function.php b/_function.php index 914c81d..5f4aef6 100644 --- a/_function.php +++ b/_function.php @@ -11,9 +11,6 @@ } public function WEBParsing($url, $cookie=NULL, $headershow=TRUE, $postparam=NULL, $otherheader=NULL) { - $uri = parse_url($url); - if (!isset($uri['port'])) $uri['port'] = 80; - if (!isset($uri['path'])) $uri['path'] = "/"; $ch = curl_init(); $opts = array(CURLOPT_RETURNTRANSFER => true, CURLOPT_URL => $url, @@ -44,8 +41,9 @@ * 소스 : http://cafe.naver.com/gogoomas/337647 * @param string $result 쿠키 string 입력 * @return strring 쿠키 데이터 출력 + * 사용하지 않음. */ - public function sucuri($result) + /*public function sucuri($result) { if(strpos($result, 'sucuri_cloudproxy_js') !== false) { @@ -174,7 +172,7 @@ // String Output return $cp_cnam_string."=".$cp_cval_string; } - } + }*/ public function FileRead($filename=NULL) { $filename = ($filename) ? $filename : $this->fname; @@ -195,17 +193,16 @@ } public function GetCookie() { - $data = $this->WEBParsing('http://www.yuncomics.com/archives/'); + /*$data = $this->WEBParsing('http://wasabisyrup.com/archives/'); $cookie = $this->splits($data, ''); - $cookie = $this->sucuri($cookie); - $data = $this->WEBParsing('http://www.yuncomics.com/wp-login.php?action=postpass', $cookie, true, 'post_password=qndxkr&Submit=Submit', + $cookie = $this->sucuri($cookie);*/ + $data = $this->WEBParsing('http://wasabisyrup.com/archives/455742', $cookie, true, 'pass=qndxkr', array( - 'Referer: http://www.yuncomics.com/' + 'Referer: http://wasabisyrup.com/' ) ); - $cookie2 = $this->splits($data, 'Set-Cookie: wp-postpass_', ';'); - $cookie2 = ';wp-postpass_'.$cookie2.';wordpress_test_cookie=WP+Cookie+check;_mcnc=1;'; - $cookie .= $cookie2; + $cookie = $this->splits($data, 'Set-Cookie: PHPSESSID=', ';'); + $cookie = 'PHPSESSID=' . $cookie . ';'; if(!$cookie) return false; else return $cookie; } public function ErrorEcho($num,$err=NULL) @@ -217,7 +214,7 @@ switch($num) { case 0: - $err='Connect Error (yuncomics 403 or other error)'; + $err='Connect Error (wasabisyrup 403 or other error)'; break; case 1: $err='Cookie Send Error (Not applied sucuri cookie data)'; diff --git a/app.js b/app.js index 2838f02..b79e5a3 100644 --- a/app.js +++ b/app.js @@ -278,7 +278,7 @@ var EpisodePage = function (_React$Component) { }, { key: '_convertUrl', value: function _convertUrl(url) { - if (url.toLowerCase().indexOf("yuncomic") > -1) { + if (url.toLowerCase().indexOf("wasabisyrup") > -1) { //var comps = url.split('/').slice(3); //return config.apiUrl + "/image_parse.php?url=" + url; //return config.apiUrl + "/image/" + comps.join("/"); diff --git a/index.php b/index.php index 7b9c446..2a00c2a 100644 --- a/index.php +++ b/index.php @@ -3,22 +3,22 @@ $marumaru = new Marumaru(); $num = $_GET['num']; $image = $_GET['image']; - if(!is_numeric($num) || strpos($num, '.')) + if(!isset($num)) { ?> -Yuncomics(marumaru.in) Image URL Parser API +wasabisyrup(marumaru.in) Image URL Parser API -

Yuncomics(marumaru.in) Image URL Parser API

-

Using: /api/{yuncomics number}/{1 or 0(null)}
+

wasabisyrup(marumaru.in) Image URL Parser API

+

Using: /api/{wasabisyrup number}/{1 or 0(null)}
Use only application/web/other developers.

Example

-

no json - /api/553645 (Gochuumon wa Usagi desuka?)
-json - /api/553645/1 (Gochuumon wa Usagi desuka?)
+

no json - /api/93 (Himouto Umaru-Chan)
+json - /api/93/1 (Himouto Umaru-Chan?)
fmaru php porting by hakase - /fmaru
-image direct view - /img/553645 (Gochuumon wa Usagi desuka?)

+image direct view - /img/93 (Himouto Umaru-Chan)

JSON Type

title : Manga Subject
url : Image URL
@@ -30,7 +30,7 @@ prevnext : Next Episode / Prev Episode (if not data, show null value)

First Line : Manga Subject
Other Line : Image URL

Error Message

-

Number 0 : Connect Error (yuncomics 403 or other error)
+

Number 0 : Connect Error (wasabisyrup 403 or other error)
Number 1 : Cookie Send Error (Not applied sucuri cookie data)
Number 2 : Cookie Get Error
Number 3 : Password Error (Protected archive) - Retry 10 minutes after view or retry about 3 times)
@@ -62,7 +62,7 @@ cookieget: startdata: $caches++; - $data = $marumaru->WEBParsing('http://www.yuncomics.com/archives/'.$num, $cookie); + $data = $marumaru->WEBParsing('http://wasabisyrup.com/archives/'.$num, $cookie); /*if(stripos($data, 'HTTP/1.1 301 Moved Permanently') !== false) { $num = explode('/', $marumaru->splits($data, 'Location: ', PHP_EOL))[4]; @@ -73,7 +73,7 @@ startdata: $marumaru->ErrorEcho(4); if(stripos($data, 'HTTP/1.1 200 OK') === false) $marumaru->ErrorEcho(0); - if(stripos($data, 'This content is password protected.') !== false) + if(stripos($data, '

Protected

') !== false) if($caches > 5) $marumaru->ErrorEcho(3); else @@ -81,25 +81,27 @@ startdata: $tmp2++; goto startdata; } - if(stripos($data, 'You are being redirected...') !== false) + /*if(stripos($data, 'You are being redirected...') !== false) if($caches > 2) $marumaru->ErrorEcho(1); else { $tmp++; goto cookieget; - } + }*/ $jsonon = ($_GET['json'] == 1) ? true : false; $aaa = explode('data-src="', $data); $title = $marumaru->splits($aaa[0], '', ''); $title = trim(explode(' | ', $title)[0]); - $data2 = explode('', explode('">', $data2[$i+1])[1])[0]); + $nextid = trim(explode('" >', $data2[$i+1])[0]); + $nextname = trim(explode('', explode('" >', $data2[$i+1])[1])[0]); } if($i != 1) { - $previd = trim(explode('">', $data2[$i-1])[0]); - $prevname = trim(explode('', explode('">', $data2[$i-1])[1])[0]); + $previd = trim(explode('" >', $data2[$i-1])[0]); + $prevname = trim(explode('', explode('" >', $data2[$i-1])[1])[0]); } continue; } - $aac[] = [trim(explode('">', $data2[$i])[0]) => trim(explode('', explode('">', $data2[$i])[1])[0])]; + $aac[] = [trim(explode('" >', $data2[$i])[0]) => trim(explode('', explode('" >', $data2[$i])[1])[0])]; } if($previd || $nextid) {