1 from manga_py
.provider
import Provider
2 from .helpers
.std
import Std
5 class MangaOnlineToday(Provider
, Std
):
6 _img_selector
= '#sct_content img'
8 def get_chapter_index(self
) -> str:
9 idx
= self
.re
.search(r
'\.\w{2,7}/[^/]+/([^/]+)', self
.chapter
)
10 return idx
.group(1).replace('.', '-')
12 def get_content(self
):
13 return self
._get
_content
('{}/{}/')
15 def get_manga_name(self
) -> str:
16 return self
._get
_name
(r
'\.\w{2,7}/([^/]+)')
18 def get_chapters(self
):
19 return self
._elements
('ul.chp_lst a')
21 def _pages_helper(self
, options
):
23 chapter
= self
.chapter
24 for n
in range(1, int(options
)):
25 content
= self
.html_fromstring('{}{}/'.format(chapter
, n
* 2 + 1))
26 img
= content
.cssselect(self
._img
_selector
)
28 images
.append(i
.get('src'))
33 content
= self
.html_fromstring(self
.chapter
)
34 img
= content
.cssselect(self
._img
_selector
)
36 images
= [i
.get('src') for i
in img
]
38 options
= len(content
.cssselect('.cbo_wpm_pag')[0].cssselect('option')) / 2 + .5
39 return images
+ self
._pages
_helper
(options
)
44 def book_meta(self
) -> dict:
49 main
= MangaOnlineToday