diff options
Diffstat (limited to 'gallery_dl/extractor/hentainexus.py')
| -rw-r--r-- | gallery_dl/extractor/hentainexus.py | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/gallery_dl/extractor/hentainexus.py b/gallery_dl/extractor/hentainexus.py index ad97eba..ef64942 100644 --- a/gallery_dl/extractor/hentainexus.py +++ b/gallery_dl/extractor/hentainexus.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2019 Mike Fährmann +# Copyright 2019-2020 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -22,7 +22,7 @@ class HentainexusGalleryExtractor(GalleryExtractor): test = ( ("https://hentainexus.com/view/5688", { "url": "746d0043e20030f1171aae5ea113176607302517", - "keyword": "77702b42f8f76ecfe5d8a14cfbbcbd855eb14d7f", + "keyword": "5e5bb4b1553b1c6e126b198f9ae017a1a5d0a5ad", }), ("https://hentainexus.com/read/5688"), ) @@ -42,6 +42,8 @@ class HentainexusGalleryExtractor(GalleryExtractor): "title" : extr('<h1 class="title">', '</h1>'), "artist" : rmve(extr('viewcolumn">Artist</td>' , '</td>')), "book" : rmve(extr('viewcolumn">Book</td>' , '</td>')), + "circle" : rmve(extr('viewcolumn">Circle</td>' , '</td>')), + "event" : rmve(extr('viewcolumn">Event</td>' , '</td>')), "language" : rmve(extr('viewcolumn">Language</td>' , '</td>')), "magazine" : rmve(extr('viewcolumn">Magazine</td>' , '</td>')), "parody" : rmve(extr('viewcolumn">Parody</td>' , '</td>')), @@ -49,8 +51,36 @@ class HentainexusGalleryExtractor(GalleryExtractor): "description": rmve(extr('viewcolumn">Description</td>', '</td>')), } data["lang"] = util.language_to_code(data["language"]) + data["type"] = "Doujinshi" if 'doujin' in data["tags"] else "Manga" + data["title_conventional"] = self.join_title( + data["event"], + data["circle"], + data["artist"], + data["title"], + data["parody"], + data["book"], + data["magazine"], + ) return data + @staticmethod + def join_title(event, circle, artist, title, parody, book, magazine): + jt = '' + if event: + jt += '({}) '.format(event) + if circle: + jt += '[{} ({})] '.format(circle, artist) + else: + jt += '[{}] '.format(artist) + jt += title + if parody.lower() != 'original work': + jt += ' ({})'.format(parody) + if book: + jt += ' ({})'.format(book) + if magazine: + jt += ' ({})'.format(magazine) + return jt + def images(self, page): url = "{}/read/{}".format(self.root, self.gallery_id) extr = text.extract_from(self.request(url).text) |
