diff options
| author | 2019-09-08 19:44:00 -0400 | |
|---|---|---|
| committer | 2019-09-08 19:44:00 -0400 | |
| commit | c09a9f00dd83017d486cd77650347bc2a397ad55 (patch) | |
| tree | b4609415ab7fcb51b1acf74344ed3a414dc0e322 /gallery_dl/extractor/exhentai.py | |
| parent | 01b2d06c57d52b2c6f241b1beb0e377ee3a8b2a6 (diff) | |
New upstream version 1.10.4upstream/1.10.4
Diffstat (limited to 'gallery_dl/extractor/exhentai.py')
| -rw-r--r-- | gallery_dl/extractor/exhentai.py | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/gallery_dl/extractor/exhentai.py b/gallery_dl/extractor/exhentai.py index 1833b1a..75e19d6 100644 --- a/gallery_dl/extractor/exhentai.py +++ b/gallery_dl/extractor/exhentai.py @@ -121,7 +121,7 @@ class ExhentaiGalleryExtractor(ExhentaiExtractor): r"|/s/([\da-f]{10})/(\d+)-(\d+))") test = ( ("https://exhentai.org/g/1200119/d55c44d3d0/", { - "keyword": "1b353fad00dff0665b1746cdd151ab5cc326df23", + "keyword": "3eeae7bde70dd992402d4cc0230ea0f2c4af46c5", "content": "e9891a4c017ed0bb734cd1efba5cd03f594d31ff", }), ("https://exhentai.org/g/960461/4f0e369d82/", { @@ -151,9 +151,6 @@ class ExhentaiGalleryExtractor(ExhentaiExtractor): def items(self): self.login() - if self.limits: - self._init_limits() - if self.gallery_token: gpage = self._gallery_page() self.image_token = text.extract(gpage, 'hentai.org/s/', '"')[0] @@ -308,15 +305,8 @@ class ExhentaiGalleryExtractor(ExhentaiExtractor): raise exception.NotFoundError("image page") return page - def _init_limits(self): - self._update_limits() - if self._remaining <= 0: - self.log.error("Image limit reached!") - ExhentaiExtractor.LIMIT = True - raise exception.StopExtraction() - def _check_limits(self, data): - if data["num"] % 20 == 0: + if not self._remaining or data["num"] % 20 == 0: self._update_limits() self._remaining -= data["cost"] @@ -360,7 +350,8 @@ class ExhentaiGalleryExtractor(ExhentaiExtractor): "width": text.parse_int(parts[0]), "height": text.parse_int(parts[2]), "size": size, - "cost": 1 + math.ceil(size * 5 / 1024 / 1024) + # 1 initial point + 1 per 0.1 MB + "cost": 1 + math.ceil(size / 104857.6) } |
