Browse Source

First commit

마루마루 관련 파일입니다.
pull/4/head
hakasenyang 2 years ago
parent
commit
f222156c55
13 changed files with 71131 additions and 0 deletions
  1. BIN
      Material_Icons.woff
  2. BIN
      Material_Icons.woff2
  3. 241
    0
      _function.php
  4. 70590
    0
      app.js
  5. 3
    0
      config.js
  6. BIN
      favicon.ico
  7. 18
    0
      fmaru.php
  8. 80
    0
      image.php
  9. 21
    0
      image_parse.php
  10. 120
    0
      index.php
  11. 15
    0
      manga.php
  12. 20
    0
      mangalist.php
  13. 23
    0
      style.css

BIN
Material_Icons.woff View File


BIN
Material_Icons.woff2 View File


+ 241
- 0
_function.php View File

@@ -0,0 +1,241 @@
1
+<?php
2
+	class Marumaru {
3
+		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';
4
+		private $fname = 'cookie.txt';
5
+		public function splits($data, $first, $end, $num = 1)
6
+		{
7
+			$temp = @explode($first, $data);
8
+			$temp = @explode($end, $temp[$num]);
9
+			$temp = $temp[0];
10
+			return $temp;
11
+		}
12
+		public function WEBParsing($url, $cookie=NULL, $headershow=TRUE, $postparam=NULL, $otherheader=NULL)
13
+		{
14
+			$uri = parse_url($url);
15
+			$paramType = strtoupper($paramType);
16
+			if (!$uri['port']) $uri['port'] = 80;
17
+			if (!$uri['path']) $uri['path'] = "/";
18
+			$ch = curl_init();
19
+			$opts = array(CURLOPT_RETURNTRANSFER => true,
20
+				CURLOPT_URL => $url,
21
+				CURLOPT_TIMEOUT => 10,
22
+				CURLOPT_CONNECTTIMEOUT => 5,
23
+				CURLOPT_SSL_VERIFYPEER => FALSE,
24
+				CURLOPT_HEADER => $headershow,
25
+				CURLOPT_USERAGENT => $this->httph
26
+				);
27
+			curl_setopt_array($ch, $opts);
28
+			if ($otherheader) curl_setopt($ch, CURLOPT_HTTPHEADER, $otherheader);
29
+			if ($cookie) curl_setopt($ch, CURLOPT_COOKIE, $cookie);
30
+			if ($postparam)
31
+			{
32
+				curl_setopt($ch, CURLOPT_POST, 1);
33
+				curl_setopt($ch, CURLOPT_POSTFIELDS, $postparam);
34
+			}
35
+
36
+			$data = curl_exec($ch);
37
+			curl_close($ch);
38
+			if ($curl_errno > 0)
39
+				$this->ErrorEcho(14, 'Connect Error!!!');
40
+			return ($data) ? $data : false;
41
+		}
42
+		/**
43
+		 * sucuri - sucuri 프록시 관련 쿠키 우회
44
+		 * 소스 : https://github.com/organization/cloudflare-bypass
45
+		 * 소스 : http://cafe.naver.com/gogoomas/337647
46
+		 * @param  string $result 쿠키 string 입력
47
+		 * @return strring         쿠키 데이터 출력
48
+		 */
49
+		public function sucuri($result)
50
+		{
51
+			if(strpos($result, 'sucuri_cloudproxy_js') !== false)
52
+			{
53
+				$cp_temp1 = explode('S=\'', $result);
54
+				$cp_temp2 = explode(';', $cp_temp1[1]);
55
+				$cp_script = $cp_temp2[0];
56
+				$cp_temp1 = explode('A=\'', $result);
57
+				$cp_temp2 = explode('\';', $cp_temp1[1]);
58
+				$cp_chlist = $cp_temp2[0];
59
+				$cp_charr = array();
60
+				for($i = 0; $i < 64; $i++)
61
+					$cp_charr[$cp_chlist[$i]] = $i;
62
+				$cp_len = strlen($cp_script);
63
+				$cp_c = 0;
64
+				$cp_u = 0;
65
+				$cp_i = 0;
66
+				$cp_l = 0;
67
+				$cp_a = NULL;
68
+				$cp_r = NULL;
69
+				for($i = 0; $i < $cp_len; $i++)
70
+				{
71
+					$cp_c = $cp_charr[$cp_script[$i]];
72
+					$cp_u = ($cp_u << 6) + $cp_c;
73
+					$cp_l += 6;
74
+					while($cp_l >= 8)
75
+						(($cp_a = ($cp_u >> ($cp_l -= 8)) & 0xff) || ($cp_i < ($cp_len - 2))) && ($cp_r .= chr($cp_a));
76
+				}
77
+				$cp_temp1 = explode('document.cookie=', $cp_r);
78
+				$cp_temp2 = explode('=', $cp_temp1[1]);
79
+				$cp_cnam = str_replace('"', '\'', $cp_temp2[0]);
80
+				$cp_cnam_split = explode('+', $cp_cnam);
81
+				$cp_cnam_split_cnt = count($cp_cnam_split);
82
+				$cp_cnam_string = NULL;
83
+				for($i = 0 ; $i < $cp_cnam_split_cnt; $i++)
84
+				{
85
+					$cp_cnam = trim($cp_cnam_split[$i]);
86
+					if(strpos($cp_cnam, 'slice') !== false)
87
+					{
88
+						$cp_temp1 = explode('\'', $cp_cnam);
89
+						$cp_temp2 = explode('(', $cp_cnam);
90
+						$cp_temp3 = explode(')', $cp_temp2[1]);
91
+						$cp_temp4 = explode(',', $cp_temp3[0]);
92
+						$cp_cnam_string .= substr($cp_temp1[1], trim($cp_temp4[0]), (intval(trim($cp_temp4[1])-trim($cp_temp4[0]))));
93
+					}
94
+					elseif(strpos($cp_cnam, 'charAt') !== false)
95
+					{
96
+						$cp_temp1 = explode('\'', $cp_cnam);
97
+						$cp_temp2 = explode('(', $cp_cnam);
98
+						$cp_temp3 = explode(')', $cp_temp2[1]);
99
+						$cp_cnam_string .= substr($cp_temp1[1], trim($cp_temp3[0]), 1);
100
+					}
101
+					elseif(strpos($cp_cnam, 'String.fromCharCode') !== false)
102
+					{
103
+						$cp_temp1 = explode('(', $cp_cnam);
104
+						$cp_temp2 = explode(')', $cp_temp1[1]);
105
+						if(strpos($cp_temp2[0], '0x') !== false)
106
+							$cp_cnam_string .= chr(hexdec($cp_temp2[0]));
107
+						else
108
+							$cp_cnam_string .= chr($cp_temp2[0]);
109
+					}
110
+					elseif(strpos($cp_cnam, 'substr') !== false)
111
+					{
112
+						$cp_temp1 = explode('\'', $cp_cnam);
113
+						$cp_temp2 = explode('(', $cp_cnam);
114
+						$cp_temp3 = explode(')', $cp_temp2[1]);
115
+						$cp_temp4 = explode(',', $cp_temp3[0]);
116
+						$cp_cnam_string .= substr($cp_temp1[1], trim($cp_temp4[0]), trim($cp_temp4[1]));
117
+					}
118
+					else
119
+						$cp_cnam_string .= trim(trim($cp_cnam, '\''));
120
+					$cp_cnam_string .= NULL;
121
+				}
122
+				//$cp_temp1 = explode('=', $cp_r);
123
+				$cp_temp1 = strpos($cp_r, '=');
124
+				$cp_temp2 = explode(';document.cookie', substr($cp_r, $cp_temp1+1)); //$cp_temp[1]
125
+				$cp_cval = str_replace('"', '\'', $cp_temp2[0]);
126
+				$cp_cval_split = explode('+', $cp_cval);
127
+				$cp_cval_split_cnt = count($cp_cval_split);
128
+				$cp_cval_string = null;
129
+				for($i = 0 ; $i < $cp_cval_split_cnt; $i++)
130
+				{
131
+					$cp_nval = trim($cp_cval_split[$i]);
132
+					if(strpos($cp_nval, 'slice') !== false)
133
+					{
134
+						$cp_temp1 = explode('\'', $cp_nval);
135
+						$cp_temp2 = explode('(', $cp_nval);
136
+						$cp_temp3 = explode(')', $cp_temp2[1]);
137
+						$cp_temp4 = explode(',', $cp_temp3[0]);
138
+						$cp_cval_string .= substr($cp_temp1[1], trim($cp_temp4[0]), (intval(trim($cp_temp4[1])-trim($cp_temp4[0]))));
139
+					}
140
+					elseif(strpos($cp_nval, 'charAt') !== false)
141
+					{
142
+						$cp_temp1 = explode("'", $cp_nval);
143
+						$cp_temp2 = explode("(", $cp_nval);
144
+						$cp_temp3 = explode(")", $cp_temp2[1]);
145
+						$cp_cval_string .= substr($cp_temp1[1], trim($cp_temp3[0]), 1);
146
+					}
147
+					elseif(strpos($cp_nval, 'String.fromCharCode') !== false)
148
+					{
149
+						$cp_temp1 = explode('(', $cp_nval);
150
+						$cp_temp2 = explode(')', $cp_temp1[1]);
151
+						if(strpos($cp_temp2[0], '0x') !== false)
152
+						{
153
+							$cp_cval_string .= chr(hexdec($cp_temp2[0]));
154
+						}
155
+						else
156
+						{
157
+							$cp_cval_string .= chr($cp_temp2[0]);
158
+						}
159
+					}
160
+					elseif(strpos($cp_nval, 'substr') !== false)
161
+					{
162
+						$cp_temp1 = explode('\'', $cp_nval);
163
+						$cp_temp2 = explode('(', $cp_nval);
164
+						$cp_temp3 = explode(')', $cp_temp2[1]);
165
+						$cp_temp4 = explode(',', $cp_temp3[0]);
166
+						$cp_cval_string .= substr($cp_temp1[1], trim($cp_temp4[0]), trim($cp_temp4[1]));
167
+					}
168
+					else
169
+					{
170
+						$cp_cval_string .= trim(trim($cp_nval, '\''));
171
+					}
172
+					$cp_cval_string .= NULL;
173
+				}
174
+
175
+				// String Output
176
+				return $cp_cnam_string."=".$cp_cval_string;
177
+			}
178
+		}
179
+		public function FileRead($filename=NULL)
180
+		{
181
+			$filename = ($filename) ? $filename : $this->fname;
182
+			if(!is_file($filename)) return false;
183
+			if(!filesize($filename)) return false;
184
+			$fp = fopen($filename, 'r');
185
+			$data = fread($fp, filesize($filename));
186
+			fclose($fp);
187
+			return $data;
188
+		}
189
+		public function FileWrite($str,$filename=NULL,$time=(60*30))
190
+		{
191
+			$filename = ($filename) ? $filename : $this->fname;
192
+			$fp = fopen($filename, 'w');
193
+			// 30분
194
+			fwrite($fp, time()+$time.PHP_EOL.$str);
195
+			fclose($fp);
196
+		}
197
+		public function GetCookie()
198
+		{
199
+			$data = $this->WEBParsing('http://www.yuncomics.com/archives/');
200
+			$cookie = $this->splits($data, '<script>', '</script>');
201
+			$cookie = $this->sucuri($cookie);
202
+			$data = $this->WEBParsing('http://www.yuncomics.com/wp-login.php?action=postpass', $cookie, true, 'post_password=qndxkr&Submit=Submit',
203
+				array(
204
+					'Referer: http://www.yuncomics.com/'
205
+				)
206
+			);
207
+			$cookie2 = $this->splits($data, 'Set-Cookie: wp-postpass_', ';');
208
+			$cookie2 = ';wp-postpass_'.$cookie2.';wordpress_test_cookie=WP+Cookie+check;_mcnc=1;';
209
+			$cookie .= $cookie2;
210
+			if(!$cookie) return false; else 	return $cookie;
211
+		}
212
+		public function ErrorEcho($num,$err=NULL)
213
+		{
214
+			if($err)
215
+				die(json_encode(array('error'=>$num, 'message'=>$err)));
216
+			else
217
+			{
218
+				switch($num)
219
+				{
220
+					case 0:
221
+						$err='Connect Error (yuncomics 403 or other error)';
222
+						break;
223
+					case 1:
224
+						$err='Cookie Send Error (Not applied sucuri cookie data)';
225
+						break;
226
+					case 2:
227
+						$err='Cookie Get Error';
228
+						break;
229
+					case 3:
230
+						$err='Password Error (Protected archive) - Retry 10 minutes after view or retry about 3 times';
231
+						break;
232
+					case 4:
233
+						$err='Not found comics data';
234
+						break;
235
+					default:
236
+						$err='Unknown Error. Please send me an e-mail (contact@hakase.kr)';
237
+				}
238
+				die(json_encode(array('error'=>$num, 'message'=>$err)));
239
+			}
240
+		}
241
+	}

+ 70590
- 0
app.js
File diff suppressed because it is too large
View File


+ 3
- 0
config.js View File

@@ -0,0 +1,3 @@
1
+config = {
2
+  apiUrl: ""
3
+}

BIN
favicon.ico View File


+ 18
- 0
fmaru.php View File

@@ -0,0 +1,18 @@
1
+<!DOCTYPE html>
2
+<html>
3
+<head>
4
+	<meta charset="utf-8">
5
+	<meta name="viewport" content="width=500, user-scalable=no">
6
+	<title>fmaru php porting by hakase</title>
7
+	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">
8
+	<!--<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
9
+	rel="stylesheet">-->
10
+	<link href="style.css"
11
+	rel="stylesheet">
12
+</head>
13
+<body style="margin:0px">
14
+	<div id="contents"></div>
15
+	<script src="config.js"></script>
16
+	<script src="app.js"></script>
17
+</body>
18
+</html>

+ 80
- 0
image.php View File

@@ -0,0 +1,80 @@
1
+<?php
2
+    include_once '_function.php';
3
+    $marumaru = new Marumaru();
4
+    $num = $_GET['num'];
5
+    if(!is_numeric($num) || strpos($num, '.'))
6
+    {
7
+?>
8
+<!doctype html><html><head><title>Yuncomics(marumaru.in) Image URL Parser</title><meta charset="UTF-8">
9
+<style>body img { width: auto; height: auto; max-width: 100%;
10
+}</style>
11
+<link rel="shortcut icon" href="favicon.ico">
12
+</head><body>
13
+<p><strong>Yuncomics(marumaru.in) <u>Image URL</u> Parser</strong><br>Using: /api/{yuncomics number}/{1 or 0(null)}<br>
14
+Use only application/web/other developers.</p>
15
+<p><strong>Example</strong><br>
16
+no json - <a href="/api/553645" target="_blank">/api/553645 (Gochuumon wa Usagi desuka?)</a><br>
17
+json - <a href="/api/553645/1" target="_blank">/api/553645/1 (Gochuumon wa Usagi desuka?)</a></p>
18
+<p><strong>JSON Type</strong><br>
19
+Title : Manga Subject<br>
20
+URL : Image URL<br>
21
+Explorer : Another same cartoon episode (same episode will be ignored) - ID => Name (if not data, replaced with a null value)<br>
22
+PrevNext : Next Episode / Prev Episode - ID => Name (if not data, replaced with a null value)<br>
23
+- Prev : ID => Name (or NULL)<br>
24
+- Next : ID => Name (or NULL)</p>
25
+<p><strong>String Type</strong><br>
26
+First Line : Manga Subject<br>
27
+Other Line : Image URL</p>
28
+<p><strong>Error Message View</strong><br>
29
+Number 0 : Connect Error (yuncomics 403 or other error)<br>
30
+Number 1 : Cookie Send Error (Not applied sucuri cookie data)<br>
31
+Number 2 : Cookie Get Error<br>
32
+Number 3 : Password Error (Protected archive) - Retry 10 minutes after view or retry about 3 times)<br>
33
+Number 4 : Not found comics data<br>
34
+Other error : read the message</p>
35
+<p>Output only JSON (Example) {"Error":1,"Message":"Error Message)"}<br>
36
+Only Error / Message Method use</p>
37
+<p>Domain : <strong>marumaru.hakase.kr</strong></p>
38
+<p><strong><i><u>No Open Source. - I just not want.<br>오픈 소스 계획 없음. - 그냥 하기 싫어.</u></i></strong></p>
39
+<p>Developed by Hakase (contact@hakase.kr)<br>
40
+사용은 자유고 제한 없음. 애초에 제한 있으면 API 인증키를 넣겠지만 귀찮아서 안 넣음.
41
+</p>
42
+</body>
43
+</html>
44
+<?php
45
+        exit;
46
+    }
47
+
48
+cookieget:
49
+    $dd = $marumaru->FileRead();
50
+    if(!$dd || explode(PHP_EOL, $dd)[0] < time())
51
+    {
52
+        $cookie = $marumaru->GetCookie();
53
+        if(!$cookie) $marumaru->ErrorEcho(2);
54
+        $marumaru->FileWrite($cookie);
55
+    }
56
+    else
57
+        $cookie = explode(PHP_EOL, $dd)[1];
58
+
59
+startdata:
60
+    $caches++;
61
+    $data = $marumaru->WEBParsing('http://www.yuncomics.com/archives/'.$num, $cookie);
62
+    /*if(stripos($data, 'HTTP/1.1 301 Moved Permanently') !== false)
63
+    {
64
+        $num = explode('/', $marumaru->splits($data, 'Location: ', PHP_EOL))[4];
65
+        $data = $marumaru->WEBParsing('http://www.yuncomics.com/archives/'.$num, $cookie.$cookie2);
66
+    }*/
67
+    if(stripos($data, 'HTTP/1.1 404 Not Found') !== false || stripos($data, 'HTTP/1.1 301 Moved Permanently') !== false) $marumaru->ErrorEcho(4);
68
+    if(stripos($data, 'HTTP/1.1 200 OK') === false) $marumaru->ErrorEcho(0);
69
+    if(stripos($data, 'This content is password protected.') !== false)
70
+        if($caches > 5) $marumaru->ErrorEcho(3);
71
+        else goto startdata;
72
+    if(stripos($data, 'You are being redirected...') !== false)
73
+        if($caches > 2) $marumaru->ErrorEcho(1);
74
+        else goto cookieget;
75
+
76
+    $jsonon = ($_GET['json'] == 1) ? true : false;
77
+    $aaa = explode('data-src="', $data);
78
+
79
+    for($i=1;$i<count($aaa);$i++)
80
+        echo '<img src="'.trim(explode('"', $aaa[$i])[0]).'"><br>';

+ 21
- 0
image_parse.php View File

@@ -0,0 +1,21 @@
1
+<?php
2
+	include '_function.php';
3
+	$url = $_GET['url'];
4
+	$marumaru = new Marumaru();
5
+
6
+	$a = parse_url($url);
7
+	switch($a['host'])
8
+	{
9
+		case 'www.yuncomics.com':
10
+		case 'blog.yuncomics.com':
11
+		case 'marumaru.in':
12
+			break;
13
+		default:
14
+			exit;
15
+	}
16
+
17
+	header('Cache-Control: max-age=86400, public');
18
+	header('Expires: '. gmdate('D, d M Y H:i:s \G\M\T', time() + 86400));
19
+	header('Content-Type: image/jpeg');
20
+	echo $marumaru->WEBParsing($url, NULL, NULL);
21
+?>

+ 120
- 0
index.php View File

@@ -0,0 +1,120 @@
1
+<?php
2
+	include_once '_function.php';
3
+	$marumaru = new Marumaru();
4
+	$num = $_GET['num'];
5
+	if(!is_numeric($num) || strpos($num, '.'))
6
+	{
7
+?>
8
+<!doctype html><html><head><title>Yuncomics(marumaru.in) Image URL Parser API</title><meta charset="UTF-8">
9
+<style>body img { width: auto; height: auto; max-width: 100%;
10
+}</style>
11
+<link rel="shortcut icon" href="favicon.ico">
12
+</head><body>
13
+<h1>Yuncomics(marumaru.in) <u>Image URL</u> Parser API</h1>
14
+<p>Using: /api/{yuncomics number}/{1 or 0(null)}<br>
15
+Use only application/web/other developers.</p>
16
+<h2>Example</h2>
17
+<p>no json - <a href="/api/553645" target="_blank">/api/553645 (Gochuumon wa Usagi desuka?)</a><br>
18
+json - <a href="/api/553645/1" target="_blank">/api/553645/1 (Gochuumon wa Usagi desuka?)</a><br>
19
+<a href="https://github.com/fmaru/fmaru" rel="noreferrer" target="_blank">fmaru</a> php porting by hakase - <a href="/fmaru" target="_blank">/fmaru</a><br>
20
+image direct view - <a href="/img/553645" target="_blank">/img/553645 (Gochuumon wa Usagi desuka?)</a></p>
21
+<h2>JSON Type</h2>
22
+<p>title : Manga Subject<br>
23
+url : Image URL<br>
24
+explorer : Another same cartoon episode (same episode will be ignored) - id => name (if not data, show null value)<br>
25
+prevnext : Next Episode / Prev Episode (if not data, show null value)<br>
26
+- prev : id => name (or NULL)<br>
27
+- next : id => name (or NULL)</p>
28
+<h2>String Type</h2>
29
+<p>First Line : Manga Subject<br>
30
+Other Line : Image URL</p>
31
+<h2>Error Message</h2>
32
+<p>Number 0 : Connect Error (yuncomics 403 or other error)<br>
33
+Number 1 : Cookie Send Error (Not applied sucuri cookie data)<br>
34
+Number 2 : Cookie Get Error<br>
35
+Number 3 : Password Error (Protected archive) - Retry 10 minutes after view or retry about 3 times)<br>
36
+Number 4 : Not found comics data<br>
37
+Other error : read the message</p>
38
+<p>Output only JSON (Example) {"error":1,"message":"Error Message)"}<br>
39
+Only error / message method use</p>
40
+<h2>Etc...</h2>
41
+<p><strong><i><u>No Open Source. - I just not want.<br>오픈 소스 계획 없음. - 그냥 하기 싫어.</u></i></strong></p>
42
+<p>Developed by <a href="https://keybase.io/hakasekr" rel="noreferrer" target="_blank">Hakase</a> (contact@hakase.kr)<br>
43
+사용은 자유고 제한 없음. 애초에 제한 있으면 API 인증키를 넣겠지만 귀찮아서 안 넣음.
44
+</p>
45
+</body>
46
+</html>
47
+<?php
48
+		exit;
49
+	}
50
+
51
+cookieget:
52
+	$dd = $marumaru->FileRead();
53
+	if(!$dd || explode(PHP_EOL, $dd)[0] < time())
54
+	{
55
+		$cookie = $marumaru->GetCookie();
56
+		if(!$cookie) $marumaru->ErrorEcho(2);
57
+		$marumaru->FileWrite($cookie);
58
+	}
59
+	else
60
+		$cookie = explode(PHP_EOL, $dd)[1];
61
+
62
+startdata:
63
+	$caches++;
64
+	$data = $marumaru->WEBParsing('http://www.yuncomics.com/archives/'.$num, $cookie);
65
+	/*if(stripos($data, 'HTTP/1.1 301 Moved Permanently') !== false)
66
+	{
67
+		$num = explode('/', $marumaru->splits($data, 'Location: ', PHP_EOL))[4];
68
+		$data = $marumaru->WEBParsing('http://www.yuncomics.com/archives/'.$num, $cookie.$cookie2);
69
+	}*/
70
+	if(stripos($data, 'HTTP/1.1 404 Not Found') !== false || stripos($data, 'HTTP/1.1 301 Moved Permanently') !== false) $marumaru->ErrorEcho(4);
71
+	if(stripos($data, 'HTTP/1.1 200 OK') === false) $marumaru->ErrorEcho(0);
72
+	if(stripos($data, 'This content is password protected.') !== false)
73
+		if($caches > 5) $marumaru->ErrorEcho(3);
74
+		else goto startdata;
75
+	if(stripos($data, 'You are being redirected...') !== false)
76
+		if($caches > 2) $marumaru->ErrorEcho(1);
77
+		else goto cookieget;
78
+
79
+	$jsonon = ($_GET['json'] == 1) ? true : false;
80
+	$aaa = explode('data-src="', $data);
81
+	$title = $marumaru->splits($aaa[0], '<title>', '</title>');
82
+	$title = trim(explode(' | ', $title)[0]);
83
+	$data2 = explode('<option value="', str_replace(' selected>', '>', $data));
84
+
85
+	for($i=1;$i<count($data2);$i++)
86
+	{
87
+		if($num == trim(explode('">', $data2[$i])[0]))
88
+		{
89
+			if($i != count($data2) - 1)
90
+			{
91
+				$nextid = trim(explode('">', $data2[$i+1])[0]);
92
+				$nextname = trim(explode('</option>', explode('">', $data2[$i+1])[1])[0]);
93
+			}
94
+			if($i != 1)
95
+			{
96
+				$previd = trim(explode('">', $data2[$i-1])[0]);
97
+				$prevname = trim(explode('</option>', explode('">', $data2[$i-1])[1])[0]);
98
+			}
99
+			continue;
100
+		}
101
+		$aac[] = [trim(explode('">', $data2[$i])[0]) => trim(explode('</option>', explode('">', $data2[$i])[1])[0])];
102
+	}
103
+	if($previd || $nextid)
104
+	{
105
+		if($previd) $aad[] = ['prev'=>[$previd=>$prevname]]; else $aad[] = ['prev'=>null];
106
+		if($nextid) $aad[] = ['next'=>[$nextid=>$nextname]]; else $aad[] = ['next'=>null];
107
+	}
108
+	for($i=1;$i<count($aaa);$i++)
109
+		$aab[] = trim(explode('"', $aaa[$i])[0]);
110
+
111
+	if($jsonon)
112
+	{
113
+		$aaaa = array('title'=>$title, 'url'=>$aab, 'explorer'=>$aac, 'prevnext'=>$aad);
114
+		echo json_encode($aaaa);
115
+	}
116
+	else
117
+		echo $title.PHP_EOL.implode(PHP_EOL, $aab);
118
+
119
+
120
+	exit;

+ 15
- 0
manga.php View File

@@ -0,0 +1,15 @@
1
+<?php
2
+	include_once '_function.php';
3
+	$marumaru = new Marumaru();
4
+	$data = $marumaru->WEBParsing('http://marumaru.in/'.$_GET['href']);
5
+	$data = str_replace('class="con_link" ', 'target="_blank" ', $data);
6
+	$thumb = $marumaru->splits($data, '<meta property="og:image" content="', '"');
7
+	$a = explode('<a target="_blank" href="', $data);
8
+	for($i=1;$i<count($a);$i++)
9
+	{
10
+		$href = explode('/', explode('"', $a[$i])[0])[4];
11
+		$title = str_replace('&nbsp;', ' ', strip_tags('<a target="_blank" href="'.explode('</a>', $a[$i])[0]));
12
+		if(!$title) continue;
13
+		$episodes[] = ['href'=>$href, 'title'=>$title];
14
+	}
15
+	echo json_encode(array('cover'=>$thumb, 'episodes'=>$episodes));

+ 20
- 0
mangalist.php View File

@@ -0,0 +1,20 @@
1
+<?php
2
+	include_once '_function.php';
3
+	$marumaru = new Marumaru();
4
+	$file = $marumaru->FileRead('mangalist.txt');
5
+	if(!$file || explode(PHP_EOL, $file)[0] < time())
6
+	{
7
+		$data = $marumaru->WEBParsing('http://marumaru.in/c/1');
8
+		$a = explode('" href="/b/manga/', $data);
9
+		$b = explode('<div width="200"><', $data);
10
+		for($i=1;$i<count($a);$i++)
11
+		{
12
+			$name = strip_tags('<'.explode('</div>', $b[$i])[0]);
13
+			$id = explode('"', $a[$i])[0];
14
+			$c[] = ['href'=>'/b/manga/'.$id, 'title'=>$name, 'id'=>$id];
15
+		}
16
+		$marumaru->FileWrite(json_encode(array('list'=>$c)), 'mangalist.txt');
17
+		$file = $marumaru->FileRead('mangalist.txt');
18
+	}
19
+	echo explode(PHP_EOL, $file)[1];
20
+	exit;

+ 23
- 0
style.css View File

@@ -0,0 +1,23 @@
1
+/* fallback */
2
+@font-face {
3
+  font-family: 'Material Icons';
4
+  font-style: normal;
5
+  font-weight: 400;
6
+  src: local('Material Icons'), local('MaterialIcons-Regular'), url(/Material_Icons.woff2) format('woff2'), url(/Material_Icons.woff) format('woff');
7
+}
8
+
9
+.material-icons {
10
+  font-family: 'Material Icons';
11
+  font-weight: normal;
12
+  font-style: normal;
13
+  font-size: 24px;
14
+  line-height: 1;
15
+  letter-spacing: normal;
16
+  text-transform: none;
17
+  display: inline-block;
18
+  white-space: nowrap;
19
+  word-wrap: normal;
20
+  direction: ltr;
21
+  -webkit-font-feature-settings: 'liga';
22
+  -webkit-font-smoothing: antialiased;
23
+}

Loading…
Cancel
Save