-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrawkuma.py
executable file
·74 lines (62 loc) · 1.8 KB
/
rawkuma.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
from jidouteki import Metadata, Config, Chapter
import jidouteki
@jidouteki.register
class Rawkuma(Config):
@jidouteki.meta
def _meta(self):
return Metadata(
key = "rawkuma",
display_name = "Rawkuma",
base = "https://rawkuma.com/"
)
@jidouteki.match
def _match(self):
return (
r"https://rawkuma\.com/(?P<series>.*?)-chapter-(?P<chapter>.*?)(?:[/?].*|)$",
r"https://rawkuma\.com/manga/(?P<series>.*?)(?:[/?].*|)$"
)
def _fetch_series(self, series):
return self.fetch(f"/manga/{series}")
@jidouteki.series.chapters
def _chapters(self, series):
d = self._fetch_series(series)
ret = []
for el in d.css("#chapterlist li"):
chapter = Chapter(
params = { "chapter": el["data-num"]},
chapter = el["data-num"]
)
ret.append(chapter)
return list(reversed(ret))
@jidouteki.series.cover
def _cover(self, series):
d = self._fetch_series(series).css(".thumbook .thumb img")
for el in d:
return el["src"]
@jidouteki.series.title
def _title(self, series):
d = self._fetch_series(series)
d = d.css(".ts-breadcrumb.bixbox > div > span:last-child > a > span[itemprop=name]")
for el in d:
return el.get_text("text")
return None
@jidouteki.images
def _images(self, series, chapter):
d = self.fetch(f"/{series}-chapter-{chapter}")
d = d.css("#readerarea img")
return [el["src"] for el in d]
# search:
# fetcher:
# params:
# - query
# type: request
# urls:
# - /?s={query}
# series:
# selector:
# type: css
# query: .bs > .bsx a
# pipeline:
# - props:
# - href
# - regex: https://rawkuma\.com/manga/(.*?)/