|
@@ -1,4 +1,4 @@ discard block |
|
|
block discarded – undo |
|
1
|
|
-<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
|
1
|
+<?php declare(strict_types = 1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
2
|
2
|
|
|
3
|
3
|
class Batoto extends Base_Site_Model { |
|
4
|
4
|
//Batoto is a bit tricky to track. Unlike MangaFox and MangaHere, it doesn't store anything in the title_url, which means we have to get the data via other methods. |
|
@@ -25,12 +25,12 @@ discard block |
|
|
block discarded – undo |
|
25
|
25
|
|
|
26
|
26
|
$chapter_parts = explode(':--:', $chapter); |
|
27
|
27
|
return [ |
|
28
|
|
- 'url' => "https://bato.to/reader#" . $chapter_parts[0], |
|
|
28
|
+ 'url' => "https://bato.to/reader#".$chapter_parts[0], |
|
29
|
29
|
'number' => $chapter_parts[1] |
|
30
|
30
|
]; |
|
31
|
31
|
} |
|
32
|
32
|
|
|
33
|
|
- public function getTitleData(string $title_url, bool $firstGet = FALSE) : ?array { |
|
|
33
|
+ public function getTitleData(string $title_url, bool $firstGet = FALSE) : ? array { |
|
34
|
34
|
$titleData = []; |
|
35
|
35
|
|
|
36
|
36
|
$title_parts = explode(':--:', $title_url); |
|
@@ -60,7 +60,7 @@ discard block |
|
|
block discarded – undo |
|
60
|
60
|
|
|
61
|
61
|
preg_match('/^(?:Vol\.(?<volume>\S+) )?(?:Ch.(?<chapter>[^\s:]+)(?:\s?-\s?(?<extra>[0-9]+))?):?.*/', trim($data['nodes_chapter']->nodeValue), $text); |
|
62
|
62
|
$chapter_url = $data['nodes_chapter']->getAttribute('href'); |
|
63
|
|
- $titleData['latest_chapter'] = substr($chapter_url, strpos($chapter_url, "reader#") + 7) . ':--:' . ((!empty($text['volume']) ? 'v'.$text['volume'].'/' : '') . 'c'.$text['chapter'] . (!empty($text['extra']) ? '-'.$text['extra'] : '')); |
|
|
63
|
+ $titleData['latest_chapter'] = substr($chapter_url, strpos($chapter_url, "reader#") + 7).':--:'.((!empty($text['volume']) ? 'v'.$text['volume'].'/' : '').'c'.$text['chapter'].(!empty($text['extra']) ? '-'.$text['extra'] : '')); |
|
64
|
64
|
|
|
65
|
65
|
$dateString = $data['nodes_latest']->nodeValue; |
|
66
|
66
|
if($dateString == 'An hour ago') { |
|
@@ -170,7 +170,7 @@ discard block |
|
|
block discarded – undo |
|
170
|
170
|
$chapter = $nodes_chapter->item(0); |
|
171
|
171
|
preg_match('/^(?:Vol\.(?<volume>\S+) )?(?:Ch.(?<chapter>[^\s:]+)(?:\s?-\s?(?<extra>[0-9]+))?):?.*/', trim($chapter->nodeValue), $text); |
|
172
|
172
|
$chapter_url = $chapter->getAttribute('href'); |
|
173
|
|
- $titleData['latest_chapter'] = substr($chapter_url, strpos($chapter_url, "reader#") + 7) . ':--:' . ((!empty($text['volume']) ? 'v'.$text['volume'].'/' : '') . 'c'.$text['chapter'] . (!empty($text['extra']) ? '-'.$text['extra'] : '')); |
|
|
173
|
+ $titleData['latest_chapter'] = substr($chapter_url, strpos($chapter_url, "reader#") + 7).':--:'.((!empty($text['volume']) ? 'v'.$text['volume'].'/' : '').'c'.$text['chapter'].(!empty($text['extra']) ? '-'.$text['extra'] : '')); |
|
174
|
174
|
|
|
175
|
175
|
$dateString = $nodes_latest->item(0)->nodeValue; |
|
176
|
176
|
if($dateString == 'An hour ago') { |