1 from lxml
.html
import HtmlElement
3 from manga_py
.provider
import Provider
4 from .helpers
import e_hentai_org
5 from .helpers
.std
import Std
9 class EHentaiOrg(Provider
, Std
):
12 def get_chapter_index(self
) -> str:
13 return str(self
.chapter_id
)
15 def get_content(self
):
16 return self
.http_get(self
.helper
.get_url())
18 def get_manga_name(self
) -> str:
19 return self
._get
_name
('/g/([^/]+/[^/?]+)').replace('/', '-')
21 def prepare_cookies(self
):
22 self
.helper
= e_hentai_org
.EHentaiOrg(self
)
23 self
.http().cookies
['nw'] = "1" # issue #178
24 self
.http().cookies
['nm'] = "1" # issue #178
26 def get_chapters(self
):
27 parser
= self
.document_fromstring(self
.content
)
28 max_idx
= self
.helper
.get_pages_count(parser
)
29 self
.log('Please, wait...\n')
30 return list(range(max_idx
, -1, -1))
33 url
= self
.helper
.get_url() + '?p='
34 selector
= '#gdt div[class^=gdt] a'
37 content
= self
.content
39 content
= self
.http_get('{}{}'.format(url
, idx
))
40 pages
= self
.document_fromstring(content
, selector
)
42 n
= self
.normalize_uri
43 f
= self
.document_fromstring
47 _url
= n(page
.get('href'))
48 images
.append(n(f(self
.http_get(_url
), '#img', 0).get('src')))
52 def get_cover(self
) -> str:
53 return self
._cover
_from
_content
('#gd1 > div')
55 def chapter_for_json(self
):