Style 수정

기존의 Tab 에서 Space 로 변경.
스타일 변경만 했으며 소스 수정을 따로 할 필요는 없음.
This commit is contained in:
hakasenyang
2016-11-13 05:38:13 +09:00
parent 36d0d2675e
commit 4d3a62cf32
7 changed files with 395 additions and 395 deletions
+238 -238
View File
@@ -1,241 +1,241 @@
<?php
class Marumaru {
private $httph = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36';
private $fname = 'cookie.txt';
public function splits($data, $first, $end, $num = 1)
{
$temp = @explode($first, $data);
$temp = @explode($end, $temp[$num]);
$temp = $temp[0];
return $temp;
}
public function WEBParsing($url, $cookie=NULL, $headershow=TRUE, $postparam=NULL, $otherheader=NULL)
{
$uri = parse_url($url);
$paramType = strtoupper($paramType);
if (!$uri['port']) $uri['port'] = 80;
if (!$uri['path']) $uri['path'] = "/";
$ch = curl_init();
$opts = array(CURLOPT_RETURNTRANSFER => true,
CURLOPT_URL => $url,
CURLOPT_TIMEOUT => 10,
CURLOPT_CONNECTTIMEOUT => 5,
CURLOPT_SSL_VERIFYPEER => FALSE,
CURLOPT_HEADER => $headershow,
CURLOPT_USERAGENT => $this->httph
);
curl_setopt_array($ch, $opts);
if ($otherheader) curl_setopt($ch, CURLOPT_HTTPHEADER, $otherheader);
if ($cookie) curl_setopt($ch, CURLOPT_COOKIE, $cookie);
if ($postparam)
{
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postparam);
}
class Marumaru {
private $httph = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36';
private $fname = 'cookie.txt';
public function splits($data, $first, $end, $num = 1)
{
$temp = @explode($first, $data);
$temp = @explode($end, $temp[$num]);
$temp = $temp[0];
return $temp;
}
public function WEBParsing($url, $cookie=NULL, $headershow=TRUE, $postparam=NULL, $otherheader=NULL)
{
$uri = parse_url($url);
$paramType = strtoupper($paramType);
if (!$uri['port']) $uri['port'] = 80;
if (!$uri['path']) $uri['path'] = "/";
$ch = curl_init();
$opts = array(CURLOPT_RETURNTRANSFER => true,
CURLOPT_URL => $url,
CURLOPT_TIMEOUT => 10,
CURLOPT_CONNECTTIMEOUT => 5,
CURLOPT_SSL_VERIFYPEER => FALSE,
CURLOPT_HEADER => $headershow,
CURLOPT_USERAGENT => $this->httph
);
curl_setopt_array($ch, $opts);
if ($otherheader) curl_setopt($ch, CURLOPT_HTTPHEADER, $otherheader);
if ($cookie) curl_setopt($ch, CURLOPT_COOKIE, $cookie);
if ($postparam)
{
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postparam);
}
$data = curl_exec($ch);
curl_close($ch);
if ($curl_errno > 0)
$this->ErrorEcho(14, 'Connect Error!!!');
return ($data) ? $data : false;
}
/**
* sucuri - sucuri 프록시 관련 쿠키 우회
* 소스 : https://github.com/organization/cloudflare-bypass
* 소스 : http://cafe.naver.com/gogoomas/337647
* @param string $result 쿠키 string 입력
* @return strring 쿠키 데이터 출력
*/
public function sucuri($result)
{
if(strpos($result, 'sucuri_cloudproxy_js') !== false)
{
$cp_temp1 = explode('S=\'', $result);
$cp_temp2 = explode(';', $cp_temp1[1]);
$cp_script = $cp_temp2[0];
$cp_temp1 = explode('A=\'', $result);
$cp_temp2 = explode('\';', $cp_temp1[1]);
$cp_chlist = $cp_temp2[0];
$cp_charr = array();
for($i = 0; $i < 64; $i++)
$cp_charr[$cp_chlist[$i]] = $i;
$cp_len = strlen($cp_script);
$cp_c = 0;
$cp_u = 0;
$cp_i = 0;
$cp_l = 0;
$cp_a = NULL;
$cp_r = NULL;
for($i = 0; $i < $cp_len; $i++)
{
$cp_c = $cp_charr[$cp_script[$i]];
$cp_u = ($cp_u << 6) + $cp_c;
$cp_l += 6;
while($cp_l >= 8)
(($cp_a = ($cp_u >> ($cp_l -= 8)) & 0xff) || ($cp_i < ($cp_len - 2))) && ($cp_r .= chr($cp_a));
}
$cp_temp1 = explode('document.cookie=', $cp_r);
$cp_temp2 = explode('=', $cp_temp1[1]);
$cp_cnam = str_replace('"', '\'', $cp_temp2[0]);
$cp_cnam_split = explode('+', $cp_cnam);
$cp_cnam_split_cnt = count($cp_cnam_split);
$cp_cnam_string = NULL;
for($i = 0 ; $i < $cp_cnam_split_cnt; $i++)
{
$cp_cnam = trim($cp_cnam_split[$i]);
if(strpos($cp_cnam, 'slice') !== false)
{
$cp_temp1 = explode('\'', $cp_cnam);
$cp_temp2 = explode('(', $cp_cnam);
$cp_temp3 = explode(')', $cp_temp2[1]);
$cp_temp4 = explode(',', $cp_temp3[0]);
$cp_cnam_string .= substr($cp_temp1[1], trim($cp_temp4[0]), (intval(trim($cp_temp4[1])-trim($cp_temp4[0]))));
}
elseif(strpos($cp_cnam, 'charAt') !== false)
{
$cp_temp1 = explode('\'', $cp_cnam);
$cp_temp2 = explode('(', $cp_cnam);
$cp_temp3 = explode(')', $cp_temp2[1]);
$cp_cnam_string .= substr($cp_temp1[1], trim($cp_temp3[0]), 1);
}
elseif(strpos($cp_cnam, 'String.fromCharCode') !== false)
{
$cp_temp1 = explode('(', $cp_cnam);
$cp_temp2 = explode(')', $cp_temp1[1]);
if(strpos($cp_temp2[0], '0x') !== false)
$cp_cnam_string .= chr(hexdec($cp_temp2[0]));
else
$cp_cnam_string .= chr($cp_temp2[0]);
}
elseif(strpos($cp_cnam, 'substr') !== false)
{
$cp_temp1 = explode('\'', $cp_cnam);
$cp_temp2 = explode('(', $cp_cnam);
$cp_temp3 = explode(')', $cp_temp2[1]);
$cp_temp4 = explode(',', $cp_temp3[0]);
$cp_cnam_string .= substr($cp_temp1[1], trim($cp_temp4[0]), trim($cp_temp4[1]));
}
else
$cp_cnam_string .= trim(trim($cp_cnam, '\''));
$cp_cnam_string .= NULL;
}
//$cp_temp1 = explode('=', $cp_r);
$cp_temp1 = strpos($cp_r, '=');
$cp_temp2 = explode(';document.cookie', substr($cp_r, $cp_temp1+1)); //$cp_temp[1]
$cp_cval = str_replace('"', '\'', $cp_temp2[0]);
$cp_cval_split = explode('+', $cp_cval);
$cp_cval_split_cnt = count($cp_cval_split);
$cp_cval_string = null;
for($i = 0 ; $i < $cp_cval_split_cnt; $i++)
{
$cp_nval = trim($cp_cval_split[$i]);
if(strpos($cp_nval, 'slice') !== false)
{
$cp_temp1 = explode('\'', $cp_nval);
$cp_temp2 = explode('(', $cp_nval);
$cp_temp3 = explode(')', $cp_temp2[1]);
$cp_temp4 = explode(',', $cp_temp3[0]);
$cp_cval_string .= substr($cp_temp1[1], trim($cp_temp4[0]), (intval(trim($cp_temp4[1])-trim($cp_temp4[0]))));
}
elseif(strpos($cp_nval, 'charAt') !== false)
{
$cp_temp1 = explode("'", $cp_nval);
$cp_temp2 = explode("(", $cp_nval);
$cp_temp3 = explode(")", $cp_temp2[1]);
$cp_cval_string .= substr($cp_temp1[1], trim($cp_temp3[0]), 1);
}
elseif(strpos($cp_nval, 'String.fromCharCode') !== false)
{
$cp_temp1 = explode('(', $cp_nval);
$cp_temp2 = explode(')', $cp_temp1[1]);
if(strpos($cp_temp2[0], '0x') !== false)
{
$cp_cval_string .= chr(hexdec($cp_temp2[0]));
}
else
{
$cp_cval_string .= chr($cp_temp2[0]);
}
}
elseif(strpos($cp_nval, 'substr') !== false)
{
$cp_temp1 = explode('\'', $cp_nval);
$cp_temp2 = explode('(', $cp_nval);
$cp_temp3 = explode(')', $cp_temp2[1]);
$cp_temp4 = explode(',', $cp_temp3[0]);
$cp_cval_string .= substr($cp_temp1[1], trim($cp_temp4[0]), trim($cp_temp4[1]));
}
else
{
$cp_cval_string .= trim(trim($cp_nval, '\''));
}
$cp_cval_string .= NULL;
}
$data = curl_exec($ch);
curl_close($ch);
if ($curl_errno > 0)
$this->ErrorEcho(14, 'Connect Error!!!');
return ($data) ? $data : false;
}
/**
* sucuri - sucuri 프록시 관련 쿠키 우회
* 소스 : https://github.com/organization/cloudflare-bypass
* 소스 : http://cafe.naver.com/gogoomas/337647
* @param string $result 쿠키 string 입력
* @return strring 쿠키 데이터 출력
*/
public function sucuri($result)
{
if(strpos($result, 'sucuri_cloudproxy_js') !== false)
{
$cp_temp1 = explode('S=\'', $result);
$cp_temp2 = explode(';', $cp_temp1[1]);
$cp_script = $cp_temp2[0];
$cp_temp1 = explode('A=\'', $result);
$cp_temp2 = explode('\';', $cp_temp1[1]);
$cp_chlist = $cp_temp2[0];
$cp_charr = array();
for($i = 0; $i < 64; $i++)
$cp_charr[$cp_chlist[$i]] = $i;
$cp_len = strlen($cp_script);
$cp_c = 0;
$cp_u = 0;
$cp_i = 0;
$cp_l = 0;
$cp_a = NULL;
$cp_r = NULL;
for($i = 0; $i < $cp_len; $i++)
{
$cp_c = $cp_charr[$cp_script[$i]];
$cp_u = ($cp_u << 6) + $cp_c;
$cp_l += 6;
while($cp_l >= 8)
(($cp_a = ($cp_u >> ($cp_l -= 8)) & 0xff) || ($cp_i < ($cp_len - 2))) && ($cp_r .= chr($cp_a));
}
$cp_temp1 = explode('document.cookie=', $cp_r);
$cp_temp2 = explode('=', $cp_temp1[1]);
$cp_cnam = str_replace('"', '\'', $cp_temp2[0]);
$cp_cnam_split = explode('+', $cp_cnam);
$cp_cnam_split_cnt = count($cp_cnam_split);
$cp_cnam_string = NULL;
for($i = 0 ; $i < $cp_cnam_split_cnt; $i++)
{
$cp_cnam = trim($cp_cnam_split[$i]);
if(strpos($cp_cnam, 'slice') !== false)
{
$cp_temp1 = explode('\'', $cp_cnam);
$cp_temp2 = explode('(', $cp_cnam);
$cp_temp3 = explode(')', $cp_temp2[1]);
$cp_temp4 = explode(',', $cp_temp3[0]);
$cp_cnam_string .= substr($cp_temp1[1], trim($cp_temp4[0]), (intval(trim($cp_temp4[1])-trim($cp_temp4[0]))));
}
elseif(strpos($cp_cnam, 'charAt') !== false)
{
$cp_temp1 = explode('\'', $cp_cnam);
$cp_temp2 = explode('(', $cp_cnam);
$cp_temp3 = explode(')', $cp_temp2[1]);
$cp_cnam_string .= substr($cp_temp1[1], trim($cp_temp3[0]), 1);
}
elseif(strpos($cp_cnam, 'String.fromCharCode') !== false)
{
$cp_temp1 = explode('(', $cp_cnam);
$cp_temp2 = explode(')', $cp_temp1[1]);
if(strpos($cp_temp2[0], '0x') !== false)
$cp_cnam_string .= chr(hexdec($cp_temp2[0]));
else
$cp_cnam_string .= chr($cp_temp2[0]);
}
elseif(strpos($cp_cnam, 'substr') !== false)
{
$cp_temp1 = explode('\'', $cp_cnam);
$cp_temp2 = explode('(', $cp_cnam);
$cp_temp3 = explode(')', $cp_temp2[1]);
$cp_temp4 = explode(',', $cp_temp3[0]);
$cp_cnam_string .= substr($cp_temp1[1], trim($cp_temp4[0]), trim($cp_temp4[1]));
}
else
$cp_cnam_string .= trim(trim($cp_cnam, '\''));
$cp_cnam_string .= NULL;
}
//$cp_temp1 = explode('=', $cp_r);
$cp_temp1 = strpos($cp_r, '=');
$cp_temp2 = explode(';document.cookie', substr($cp_r, $cp_temp1+1)); //$cp_temp[1]
$cp_cval = str_replace('"', '\'', $cp_temp2[0]);
$cp_cval_split = explode('+', $cp_cval);
$cp_cval_split_cnt = count($cp_cval_split);
$cp_cval_string = null;
for($i = 0 ; $i < $cp_cval_split_cnt; $i++)
{
$cp_nval = trim($cp_cval_split[$i]);
if(strpos($cp_nval, 'slice') !== false)
{
$cp_temp1 = explode('\'', $cp_nval);
$cp_temp2 = explode('(', $cp_nval);
$cp_temp3 = explode(')', $cp_temp2[1]);
$cp_temp4 = explode(',', $cp_temp3[0]);
$cp_cval_string .= substr($cp_temp1[1], trim($cp_temp4[0]), (intval(trim($cp_temp4[1])-trim($cp_temp4[0]))));
}
elseif(strpos($cp_nval, 'charAt') !== false)
{
$cp_temp1 = explode("'", $cp_nval);
$cp_temp2 = explode("(", $cp_nval);
$cp_temp3 = explode(")", $cp_temp2[1]);
$cp_cval_string .= substr($cp_temp1[1], trim($cp_temp3[0]), 1);
}
elseif(strpos($cp_nval, 'String.fromCharCode') !== false)
{
$cp_temp1 = explode('(', $cp_nval);
$cp_temp2 = explode(')', $cp_temp1[1]);
if(strpos($cp_temp2[0], '0x') !== false)
{
$cp_cval_string .= chr(hexdec($cp_temp2[0]));
}
else
{
$cp_cval_string .= chr($cp_temp2[0]);
}
}
elseif(strpos($cp_nval, 'substr') !== false)
{
$cp_temp1 = explode('\'', $cp_nval);
$cp_temp2 = explode('(', $cp_nval);
$cp_temp3 = explode(')', $cp_temp2[1]);
$cp_temp4 = explode(',', $cp_temp3[0]);
$cp_cval_string .= substr($cp_temp1[1], trim($cp_temp4[0]), trim($cp_temp4[1]));
}
else
{
$cp_cval_string .= trim(trim($cp_nval, '\''));
}
$cp_cval_string .= NULL;
}
// String Output
return $cp_cnam_string."=".$cp_cval_string;
}
}
public function FileRead($filename=NULL)
{
$filename = ($filename) ? $filename : $this->fname;
if(!is_file($filename)) return false;
if(!filesize($filename)) return false;
$fp = fopen($filename, 'r');
$data = fread($fp, filesize($filename));
fclose($fp);
return $data;
}
public function FileWrite($str,$filename=NULL,$time=(60*30))
{
$filename = ($filename) ? $filename : $this->fname;
$fp = fopen($filename, 'w');
// 30분
fwrite($fp, time()+$time.PHP_EOL.$str);
fclose($fp);
}
public function GetCookie()
{
$data = $this->WEBParsing('http://www.yuncomics.com/archives/');
$cookie = $this->splits($data, '<script>', '</script>');
$cookie = $this->sucuri($cookie);
$data = $this->WEBParsing('http://www.yuncomics.com/wp-login.php?action=postpass', $cookie, true, 'post_password=qndxkr&Submit=Submit',
array(
'Referer: http://www.yuncomics.com/'
)
);
$cookie2 = $this->splits($data, 'Set-Cookie: wp-postpass_', ';');
$cookie2 = ';wp-postpass_'.$cookie2.';wordpress_test_cookie=WP+Cookie+check;_mcnc=1;';
$cookie .= $cookie2;
if(!$cookie) return false; else return $cookie;
}
public function ErrorEcho($num,$err=NULL)
{
if($err)
die(json_encode(array('error'=>$num, 'message'=>$err)));
else
{
switch($num)
{
case 0:
$err='Connect Error (yuncomics 403 or other error)';
break;
case 1:
$err='Cookie Send Error (Not applied sucuri cookie data)';
break;
case 2:
$err='Cookie Get Error';
break;
case 3:
$err='Password Error (Protected archive) - Retry 10 minutes after view or retry about 3 times';
break;
case 4:
$err='Not found comics data';
break;
default:
$err='Unknown Error. Please send me an e-mail (contact@hakase.kr)';
}
die(json_encode(array('error'=>$num, 'message'=>$err)));
}
}
}
// String Output
return $cp_cnam_string."=".$cp_cval_string;
}
}
public function FileRead($filename=NULL)
{
$filename = ($filename) ? $filename : $this->fname;
if(!is_file($filename)) return false;
if(!filesize($filename)) return false;
$fp = fopen($filename, 'r');
$data = fread($fp, filesize($filename));
fclose($fp);
return $data;
}
public function FileWrite($str,$filename=NULL,$time=(60*30))
{
$filename = ($filename) ? $filename : $this->fname;
$fp = fopen($filename, 'w');
// 30분
fwrite($fp, time()+$time.PHP_EOL.$str);
fclose($fp);
}
public function GetCookie()
{
$data = $this->WEBParsing('http://www.yuncomics.com/archives/');
$cookie = $this->splits($data, '<script>', '</script>');
$cookie = $this->sucuri($cookie);
$data = $this->WEBParsing('http://www.yuncomics.com/wp-login.php?action=postpass', $cookie, true, 'post_password=qndxkr&Submit=Submit',
array(
'Referer: http://www.yuncomics.com/'
)
);
$cookie2 = $this->splits($data, 'Set-Cookie: wp-postpass_', ';');
$cookie2 = ';wp-postpass_'.$cookie2.';wordpress_test_cookie=WP+Cookie+check;_mcnc=1;';
$cookie .= $cookie2;
if(!$cookie) return false; else return $cookie;
}
public function ErrorEcho($num,$err=NULL)
{
if($err)
die(json_encode(array('error'=>$num, 'message'=>$err)));
else
{
switch($num)
{
case 0:
$err='Connect Error (yuncomics 403 or other error)';
break;
case 1:
$err='Cookie Send Error (Not applied sucuri cookie data)';
break;
case 2:
$err='Cookie Get Error';
break;
case 3:
$err='Password Error (Protected archive) - Retry 10 minutes after view or retry about 3 times';
break;
case 4:
$err='Not found comics data';
break;
default:
$err='Unknown Error. Please send me an e-mail (contact@hakase.kr)';
}
die(json_encode(array('error'=>$num, 'message'=>$err)));
}
}
}
+11 -11
View File
@@ -1,18 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=500, user-scalable=no">
<title>fmaru php porting by hakase</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">
<!--<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">-->
<link href="style.css"
rel="stylesheet">
<meta charset="utf-8">
<meta name="viewport" content="width=500, user-scalable=no">
<title>fmaru php porting by hakase</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">
<!--<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">-->
<link href="style.css"
rel="stylesheet">
</head>
<body style="margin:0px">
<div id="contents"></div>
<script src="config.js"></script>
<script src="app.js"></script>
<div id="contents"></div>
<script src="config.js"></script>
<script src="app.js"></script>
</body>
</html>
+17 -17
View File
@@ -1,21 +1,21 @@
<?php
include '_function.php';
$url = $_GET['url'];
$marumaru = new Marumaru();
include '_function.php';
$url = $_GET['url'];
$marumaru = new Marumaru();
$a = parse_url($url);
switch($a['host'])
{
case 'www.yuncomics.com':
case 'blog.yuncomics.com':
case 'marumaru.in':
break;
default:
exit;
}
$a = parse_url($url);
switch($a['host'])
{
case 'www.yuncomics.com':
case 'blog.yuncomics.com':
case 'marumaru.in':
break;
default:
exit;
}
header('Cache-Control: max-age=86400, public');
header('Expires: '. gmdate('D, d M Y H:i:s \G\M\T', time() + 86400));
header('Content-Type: image/jpeg');
echo $marumaru->WEBParsing($url, NULL, NULL);
header('Cache-Control: max-age=86400, public');
header('Expires: '. gmdate('D, d M Y H:i:s \G\M\T', time() + 86400));
header('Content-Type: image/jpeg');
echo $marumaru->WEBParsing($url, NULL, NULL);
?>
+79 -79
View File
@@ -1,10 +1,10 @@
<?php
include_once '_function.php';
$marumaru = new Marumaru();
$num = $_GET['num'];
$image = $_GET['image'];
if(!is_numeric($num) || strpos($num, '.'))
{
include_once '_function.php';
$marumaru = new Marumaru();
$num = $_GET['num'];
$image = $_GET['image'];
if(!is_numeric($num) || strpos($num, '.'))
{
?>
<!doctype html><html><head><title>Yuncomics(marumaru.in) Image URL Parser API</title><meta charset="UTF-8">
<style>body img { width: auto; height: auto; max-width: 100%;
@@ -46,84 +46,84 @@ Only error / message method use</p>
</body>
</html>
<?php
exit;
}
exit;
}
cookieget:
$dd = $marumaru->FileRead();
if(!$dd || explode(PHP_EOL, $dd)[0] < time())
{
$cookie = $marumaru->GetCookie();
if(!$cookie) $marumaru->ErrorEcho(2);
$marumaru->FileWrite($cookie);
}
else
$cookie = explode(PHP_EOL, $dd)[1];
$dd = $marumaru->FileRead();
if(!$dd || explode(PHP_EOL, $dd)[0] < time())
{
$cookie = $marumaru->GetCookie();
if(!$cookie) $marumaru->ErrorEcho(2);
$marumaru->FileWrite($cookie);
}
else
$cookie = explode(PHP_EOL, $dd)[1];
startdata:
$caches++;
$data = $marumaru->WEBParsing('http://www.yuncomics.com/archives/'.$num, $cookie);
/*if(stripos($data, 'HTTP/1.1 301 Moved Permanently') !== false)
{
$num = explode('/', $marumaru->splits($data, 'Location: ', PHP_EOL))[4];
$data = $marumaru->WEBParsing('http://www.yuncomics.com/archives/'.$num, $cookie.$cookie2);
}*/
if(stripos($data, 'HTTP/1.1 404 Not Found') !== false || stripos($data, 'HTTP/1.1 301 Moved Permanently') !== false) $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($caches > 5) $marumaru->ErrorEcho(3);
else goto startdata;
if(stripos($data, 'You are being redirected...') !== false)
if($caches > 2) $marumaru->ErrorEcho(1);
else goto cookieget;
$caches++;
$data = $marumaru->WEBParsing('http://www.yuncomics.com/archives/'.$num, $cookie);
/*if(stripos($data, 'HTTP/1.1 301 Moved Permanently') !== false)
{
$num = explode('/', $marumaru->splits($data, 'Location: ', PHP_EOL))[4];
$data = $marumaru->WEBParsing('http://www.yuncomics.com/archives/'.$num, $cookie.$cookie2);
}*/
if(stripos($data, 'HTTP/1.1 404 Not Found') !== false || stripos($data, 'HTTP/1.1 301 Moved Permanently') !== false) $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($caches > 5) $marumaru->ErrorEcho(3);
else goto startdata;
if(stripos($data, 'You are being redirected...') !== false)
if($caches > 2) $marumaru->ErrorEcho(1);
else goto cookieget;
$jsonon = ($_GET['json'] == 1) ? true : false;
$aaa = explode('data-src="', $data);
$title = $marumaru->splits($aaa[0], '<title>', '</title>');
$title = trim(explode(' | ', $title)[0]);
$data2 = explode('<option value="', str_replace(' selected>', '>', $data));
$jsonon = ($_GET['json'] == 1) ? true : false;
$aaa = explode('data-src="', $data);
$title = $marumaru->splits($aaa[0], '<title>', '</title>');
$title = trim(explode(' | ', $title)[0]);
$data2 = explode('<option value="', str_replace(' selected>', '>', $data));
if ($image)
{
$jsonon = ($_GET['json'] == 1) ? true : false;
$aaa = explode('data-src="', $data);
if ($image)
{
$jsonon = ($_GET['json'] == 1) ? true : false;
$aaa = explode('data-src="', $data);
for($i=1;$i<count($aaa);$i++)
echo '<img src="'.trim(explode('"', $aaa[$i])[0]).'"><br>';
}
else
{
for($i=1;$i<count($data2);$i++)
{
if($num == trim(explode('">', $data2[$i])[0]))
{
if($i != count($data2) - 1)
{
$nextid = trim(explode('">', $data2[$i+1])[0]);
$nextname = trim(explode('</option>', explode('">', $data2[$i+1])[1])[0]);
}
if($i != 1)
{
$previd = trim(explode('">', $data2[$i-1])[0]);
$prevname = trim(explode('</option>', explode('">', $data2[$i-1])[1])[0]);
}
continue;
}
$aac[] = [trim(explode('">', $data2[$i])[0]) => trim(explode('</option>', explode('">', $data2[$i])[1])[0])];
}
if($previd || $nextid)
{
if($previd) $aad[] = ['prev'=>[$previd=>$prevname]]; else $aad[] = ['prev'=>null];
if($nextid) $aad[] = ['next'=>[$nextid=>$nextname]]; else $aad[] = ['next'=>null];
}
for($i=1;$i<count($aaa);$i++)
$aab[] = trim(explode('"', $aaa[$i])[0]);
for($i=1;$i<count($aaa);$i++)
echo '<img src="'.trim(explode('"', $aaa[$i])[0]).'"><br>';
}
else
{
for($i=1;$i<count($data2);$i++)
{
if($num == trim(explode('">', $data2[$i])[0]))
{
if($i != count($data2) - 1)
{
$nextid = trim(explode('">', $data2[$i+1])[0]);
$nextname = trim(explode('</option>', explode('">', $data2[$i+1])[1])[0]);
}
if($i != 1)
{
$previd = trim(explode('">', $data2[$i-1])[0]);
$prevname = trim(explode('</option>', explode('">', $data2[$i-1])[1])[0]);
}
continue;
}
$aac[] = [trim(explode('">', $data2[$i])[0]) => trim(explode('</option>', explode('">', $data2[$i])[1])[0])];
}
if($previd || $nextid)
{
if($previd) $aad[] = ['prev'=>[$previd=>$prevname]]; else $aad[] = ['prev'=>null];
if($nextid) $aad[] = ['next'=>[$nextid=>$nextname]]; else $aad[] = ['next'=>null];
}
for($i=1;$i<count($aaa);$i++)
$aab[] = trim(explode('"', $aaa[$i])[0]);
if($jsonon)
{
$aaaa = array('title'=>$title, 'url'=>$aab, 'explorer'=>$aac, 'prevnext'=>$aad);
echo json_encode($aaaa);
}
else
echo $title.PHP_EOL.implode(PHP_EOL, $aab);
}
if($jsonon)
{
$aaaa = array('title'=>$title, 'url'=>$aab, 'explorer'=>$aac, 'prevnext'=>$aad);
echo json_encode($aaaa);
}
else
echo $title.PHP_EOL.implode(PHP_EOL, $aab);
}
+14 -14
View File
@@ -1,15 +1,15 @@
<?php
include_once '_function.php';
$marumaru = new Marumaru();
$data = $marumaru->WEBParsing('http://marumaru.in/'.$_GET['href']);
$data = str_replace('class="con_link" ', 'target="_blank" ', $data);
$thumb = $marumaru->splits($data, '<meta property="og:image" content="', '"');
$a = explode('<a target="_blank" href="', $data);
for($i=1;$i<count($a);$i++)
{
$href = explode('/', explode('"', $a[$i])[0])[4];
$title = str_replace('&nbsp;', ' ', strip_tags('<a target="_blank" href="'.explode('</a>', $a[$i])[0]));
if(!$title) continue;
$episodes[] = ['href'=>$href, 'title'=>$title];
}
echo json_encode(array('cover'=>$thumb, 'episodes'=>$episodes));
include_once '_function.php';
$marumaru = new Marumaru();
$data = $marumaru->WEBParsing('http://marumaru.in/'.$_GET['href']);
$data = str_replace('class="con_link" ', 'target="_blank" ', $data);
$thumb = $marumaru->splits($data, '<meta property="og:image" content="', '"');
$a = explode('<a target="_blank" href="', $data);
for($i=1;$i<count($a);$i++)
{
$href = explode('/', explode('"', $a[$i])[0])[4];
$title = str_replace('&nbsp;', ' ', strip_tags('<a target="_blank" href="'.explode('</a>', $a[$i])[0]));
if(!$title) continue;
$episodes[] = ['href'=>$href, 'title'=>$title];
}
echo json_encode(array('cover'=>$thumb, 'episodes'=>$episodes));
+19 -19
View File
@@ -1,20 +1,20 @@
<?php
include_once '_function.php';
$marumaru = new Marumaru();
$file = $marumaru->FileRead('mangalist.txt');
if(!$file || explode(PHP_EOL, $file)[0] < time())
{
$data = $marumaru->WEBParsing('http://marumaru.in/c/1');
$a = explode('" href="/b/manga/', $data);
$b = explode('<div width="200"><', $data);
for($i=1;$i<count($a);$i++)
{
$name = strip_tags('<'.explode('</div>', $b[$i])[0]);
$id = explode('"', $a[$i])[0];
$c[] = ['href'=>'/b/manga/'.$id, 'title'=>$name, 'id'=>$id];
}
$marumaru->FileWrite(json_encode(array('list'=>$c)), 'mangalist.txt');
$file = $marumaru->FileRead('mangalist.txt');
}
echo explode(PHP_EOL, $file)[1];
exit;
include_once '_function.php';
$marumaru = new Marumaru();
$file = $marumaru->FileRead('mangalist.txt');
if(!$file || explode(PHP_EOL, $file)[0] < time())
{
$data = $marumaru->WEBParsing('http://marumaru.in/c/1');
$a = explode('" href="/b/manga/', $data);
$b = explode('<div width="200"><', $data);
for($i=1;$i<count($a);$i++)
{
$name = strip_tags('<'.explode('</div>', $b[$i])[0]);
$id = explode('"', $a[$i])[0];
$c[] = ['href'=>'/b/manga/'.$id, 'title'=>$name, 'id'=>$id];
}
$marumaru->FileWrite(json_encode(array('list'=>$c)), 'mangalist.txt');
$file = $marumaru->FileRead('mangalist.txt');
}
echo explode(PHP_EOL, $file)[1];
exit;
+17 -17
View File
@@ -1,23 +1,23 @@
/* fallback */
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: local('Material Icons'), local('MaterialIcons-Regular'), url(/Material_Icons.woff2) format('woff2'), url(/Material_Icons.woff) format('woff');
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: local('Material Icons'), local('MaterialIcons-Regular'), url(/Material_Icons.woff2) format('woff2'), url(/Material_Icons.woff) format('woff');
}
.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-webkit-font-feature-settings: 'liga';
-webkit-font-smoothing: antialiased;
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-webkit-font-feature-settings: 'liga';
-webkit-font-smoothing: antialiased;
}