Browse Source

Style 수정

기존의 Tab 에서 Space 로 변경.
스타일 변경만 했으며 소스 수정을 따로 할 필요는 없음.
pull/4/head
hakasenyang 2 years ago
parent
commit
4d3a62cf32
7 changed files with 395 additions and 395 deletions
  1. 238
    238
      _function.php
  2. 11
    11
      fmaru.php
  3. 17
    17
      image_parse.php
  4. 79
    79
      index.php
  5. 14
    14
      manga.php
  6. 19
    19
      mangalist.php
  7. 17
    17
      style.css

+ 238
- 238
_function.php View File

@@ -1,241 +1,241 @@
1 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
-			}
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 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
-				}
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 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
-	}
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
+    }

+ 11
- 11
fmaru.php View File

@@ -1,18 +1,18 @@
1 1
 <!DOCTYPE html>
2 2
 <html>
3 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">
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 12
 </head>
13 13
 <body style="margin:0px">
14
-	<div id="contents"></div>
15
-	<script src="config.js"></script>
16
-	<script src="app.js"></script>
14
+    <div id="contents"></div>
15
+    <script src="config.js"></script>
16
+    <script src="app.js"></script>
17 17
 </body>
18 18
 </html>

+ 17
- 17
image_parse.php View File

@@ -1,21 +1,21 @@
1 1
 <?php
2
-	include '_function.php';
3
-	$url = $_GET['url'];
4
-	$marumaru = new Marumaru();
2
+    include '_function.php';
3
+    $url = $_GET['url'];
4
+    $marumaru = new Marumaru();
5 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
-	}
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 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);
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 21
 ?>

+ 79
- 79
index.php View File

@@ -1,10 +1,10 @@
1 1
 <?php
2
-	include_once '_function.php';
3
-	$marumaru = new Marumaru();
4
-	$num = $_GET['num'];
5
-	$image = $_GET['image'];
6
-	if(!is_numeric($num) || strpos($num, '.'))
7
-	{
2
+    include_once '_function.php';
3
+    $marumaru = new Marumaru();
4
+    $num = $_GET['num'];
5
+    $image = $_GET['image'];
6
+    if(!is_numeric($num) || strpos($num, '.'))
7
+    {
8 8
 ?>
9 9
 <!doctype html><html><head><title>Yuncomics(marumaru.in) Image URL Parser API</title><meta charset="UTF-8">
10 10
 <style>body img { width: auto; height: auto; max-width: 100%;
@@ -46,84 +46,84 @@ Only error / message method use</p>
46 46
 </body>
47 47
 </html>
48 48
 <?php
49
-		exit;
50
-	}
49
+        exit;
50
+    }
51 51
 
52 52
 cookieget:
53
-	$dd = $marumaru->FileRead();
54
-	if(!$dd || explode(PHP_EOL, $dd)[0] < time())
55
-	{
56
-		$cookie = $marumaru->GetCookie();
57
-		if(!$cookie) $marumaru->ErrorEcho(2);
58
-		$marumaru->FileWrite($cookie);
59
-	}
60
-	else
61
-		$cookie = explode(PHP_EOL, $dd)[1];
53
+    $dd = $marumaru->FileRead();
54
+    if(!$dd || explode(PHP_EOL, $dd)[0] < time())
55
+    {
56
+        $cookie = $marumaru->GetCookie();
57
+        if(!$cookie) $marumaru->ErrorEcho(2);
58
+        $marumaru->FileWrite($cookie);
59
+    }
60
+    else
61
+        $cookie = explode(PHP_EOL, $dd)[1];
62 62
 
63 63
 startdata:
64
-	$caches++;
65
-	$data = $marumaru->WEBParsing('http://www.yuncomics.com/archives/'.$num, $cookie);
66
-	/*if(stripos($data, 'HTTP/1.1 301 Moved Permanently') !== false)
67
-	{
68
-		$num = explode('/', $marumaru->splits($data, 'Location: ', PHP_EOL))[4];
69
-		$data = $marumaru->WEBParsing('http://www.yuncomics.com/archives/'.$num, $cookie.$cookie2);
70
-	}*/
71
-	if(stripos($data, 'HTTP/1.1 404 Not Found') !== false || stripos($data, 'HTTP/1.1 301 Moved Permanently') !== false) $marumaru->ErrorEcho(4);
72
-	if(stripos($data, 'HTTP/1.1 200 OK') === false) $marumaru->ErrorEcho(0);
73
-	if(stripos($data, 'This content is password protected.') !== false)
74
-		if($caches > 5) $marumaru->ErrorEcho(3);
75
-		else goto startdata;
76
-	if(stripos($data, 'You are being redirected...') !== false)
77
-		if($caches > 2) $marumaru->ErrorEcho(1);
78
-		else goto cookieget;
64
+    $caches++;
65
+    $data = $marumaru->WEBParsing('http://www.yuncomics.com/archives/'.$num, $cookie);
66
+    /*if(stripos($data, 'HTTP/1.1 301 Moved Permanently') !== false)
67
+    {
68
+        $num = explode('/', $marumaru->splits($data, 'Location: ', PHP_EOL))[4];
69
+        $data = $marumaru->WEBParsing('http://www.yuncomics.com/archives/'.$num, $cookie.$cookie2);
70
+    }*/
71
+    if(stripos($data, 'HTTP/1.1 404 Not Found') !== false || stripos($data, 'HTTP/1.1 301 Moved Permanently') !== false) $marumaru->ErrorEcho(4);
72
+    if(stripos($data, 'HTTP/1.1 200 OK') === false) $marumaru->ErrorEcho(0);
73
+    if(stripos($data, 'This content is password protected.') !== false)
74
+        if($caches > 5) $marumaru->ErrorEcho(3);
75
+        else goto startdata;
76
+    if(stripos($data, 'You are being redirected...') !== false)
77
+        if($caches > 2) $marumaru->ErrorEcho(1);
78
+        else goto cookieget;
79 79
 
80
-	$jsonon = ($_GET['json'] == 1) ? true : false;
81
-	$aaa = explode('data-src="', $data);
82
-	$title = $marumaru->splits($aaa[0], '<title>', '</title>');
83
-	$title = trim(explode(' | ', $title)[0]);
84
-	$data2 = explode('<option value="', str_replace(' selected>', '>', $data));
80
+    $jsonon = ($_GET['json'] == 1) ? true : false;
81
+    $aaa = explode('data-src="', $data);
82
+    $title = $marumaru->splits($aaa[0], '<title>', '</title>');
83
+    $title = trim(explode(' | ', $title)[0]);
84
+    $data2 = explode('<option value="', str_replace(' selected>', '>', $data));
85 85
 
86
-	if ($image)
87
-	{
88
-		$jsonon = ($_GET['json'] == 1) ? true : false;
89
-		$aaa = explode('data-src="', $data);
86
+    if ($image)
87
+    {
88
+        $jsonon = ($_GET['json'] == 1) ? true : false;
89
+        $aaa = explode('data-src="', $data);
90 90
 
91
-		for($i=1;$i<count($aaa);$i++)
92
-		    echo '<img src="'.trim(explode('"', $aaa[$i])[0]).'"><br>';
93
-	}
94
-	else
95
-	{
96
-		for($i=1;$i<count($data2);$i++)
97
-		{
98
-			if($num == trim(explode('">', $data2[$i])[0]))
99
-			{
100
-				if($i != count($data2) - 1)
101
-				{
102
-					$nextid = trim(explode('">', $data2[$i+1])[0]);
103
-					$nextname = trim(explode('</option>', explode('">', $data2[$i+1])[1])[0]);
104
-				}
105
-				if($i != 1)
106
-				{
107
-					$previd = trim(explode('">', $data2[$i-1])[0]);
108
-					$prevname = trim(explode('</option>', explode('">', $data2[$i-1])[1])[0]);
109
-				}
110
-				continue;
111
-			}
112
-			$aac[] = [trim(explode('">', $data2[$i])[0]) => trim(explode('</option>', explode('">', $data2[$i])[1])[0])];
113
-		}
114
-		if($previd || $nextid)
115
-		{
116
-			if($previd) $aad[] = ['prev'=>[$previd=>$prevname]]; else $aad[] = ['prev'=>null];
117
-			if($nextid) $aad[] = ['next'=>[$nextid=>$nextname]]; else $aad[] = ['next'=>null];
118
-		}
119
-		for($i=1;$i<count($aaa);$i++)
120
-			$aab[] = trim(explode('"', $aaa[$i])[0]);
91
+        for($i=1;$i<count($aaa);$i++)
92
+            echo '<img src="'.trim(explode('"', $aaa[$i])[0]).'"><br>';
93
+    }
94
+    else
95
+    {
96
+        for($i=1;$i<count($data2);$i++)
97
+        {
98
+            if($num == trim(explode('">', $data2[$i])[0]))
99
+            {
100
+                if($i != count($data2) - 1)
101
+                {
102
+                    $nextid = trim(explode('">', $data2[$i+1])[0]);
103
+                    $nextname = trim(explode('</option>', explode('">', $data2[$i+1])[1])[0]);
104
+                }
105
+                if($i != 1)
106
+                {
107
+                    $previd = trim(explode('">', $data2[$i-1])[0]);
108
+                    $prevname = trim(explode('</option>', explode('">', $data2[$i-1])[1])[0]);
109
+                }
110
+                continue;
111
+            }
112
+            $aac[] = [trim(explode('">', $data2[$i])[0]) => trim(explode('</option>', explode('">', $data2[$i])[1])[0])];
113
+        }
114
+        if($previd || $nextid)
115
+        {
116
+            if($previd) $aad[] = ['prev'=>[$previd=>$prevname]]; else $aad[] = ['prev'=>null];
117
+            if($nextid) $aad[] = ['next'=>[$nextid=>$nextname]]; else $aad[] = ['next'=>null];
118
+        }
119
+        for($i=1;$i<count($aaa);$i++)
120
+            $aab[] = trim(explode('"', $aaa[$i])[0]);
121 121
 
122
-		if($jsonon)
123
-		{
124
-			$aaaa = array('title'=>$title, 'url'=>$aab, 'explorer'=>$aac, 'prevnext'=>$aad);
125
-			echo json_encode($aaaa);
126
-		}
127
-		else
128
-			echo $title.PHP_EOL.implode(PHP_EOL, $aab);
129
-	}
122
+        if($jsonon)
123
+        {
124
+            $aaaa = array('title'=>$title, 'url'=>$aab, 'explorer'=>$aac, 'prevnext'=>$aad);
125
+            echo json_encode($aaaa);
126
+        }
127
+        else
128
+            echo $title.PHP_EOL.implode(PHP_EOL, $aab);
129
+    }

+ 14
- 14
manga.php View File

@@ -1,15 +1,15 @@
1 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));
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));

+ 19
- 19
mangalist.php View File

@@ -1,20 +1,20 @@
1 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;
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;

+ 17
- 17
style.css View File

@@ -1,23 +1,23 @@
1 1
 /* fallback */
2 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');
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 7
 }
8 8
 
9 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;
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 23
 }

Loading…
Cancel
Save