Update workflows/publish_pypi.yml
[manga-dl.git] / manga_py / providers / manganelos_com.py
blobd2179bdb98d7d2ed2e6c6fa08ca7142528aa6905
1 from manga_py.provider import Provider
2 from .helpers.std import Std
3 from requests import get
6 class MangaNelosCom(Provider, Std):
7 def get_chapter_index(self) -> str:
8 ch = self.re.search(r'-chapter-(\d+(?:\.\d+)?)', self.chapter)
9 return ch.group(1).replace('.', '-')
11 def get_content(self):
12 return self._get_content('{}/manga/{}')
14 def get_manga_name(self) -> str:
15 return self._get_name('/manga/([^/]+)')
17 def get_chapters(self):
18 return self._elements('.content .chapter a')
20 def get_files(self):
21 content = self.text_content_full(self.http_get(self.chapter), '#arraydata')
22 images = content.split(',')
24 if len(images) == 0:
25 return []
27 if self._download_cookies is None:
28 with get(images[0], stream=True) as req:
29 self._download_cookies = req.cookies
31 return images
33 def get_cover(self) -> str:
34 return self._cover_from_content('.media-left.cover-detail')
36 def prepare_cookies(self):
37 self.http()._download = self._download
40 main = MangaNelosCom