[rule34hentai] cleanup

- fix using 'self._posts_rule34hentai'
- fix 'file_url' for posts
- update docs/supportedsites
- add tests
This commit is contained in:
Mike Fährmann
2023-12-22 00:01:36 +01:00
parent ef370df41d
commit 79e4606893
4 changed files with 62 additions and 5 deletions

View File

@@ -35,9 +35,8 @@ class Shimmie2Extractor(BaseExtractor):
if self.category == "giantessbooru":
self.posts = self._posts_giantessbooru
if self.category == "rule34hentai":
self.posts = self._posts_giantessbooru
elif self.category == "rule34hentai":
self.posts = self._posts_rule34hentai
def items(self):
data = self.metadata()
@@ -301,8 +300,8 @@ class Shimmie2PostExtractor(Shimmie2Extractor):
"tags" : extr(": ", "<").partition(" - ")[0].rstrip(")"),
"md5" : extr("/_thumbs/", "/"),
"file_url": self.root + (
extr("id='main_image' src=\"", "\"") or
extr("<source src=\"", "\"")).lstrip("."),
extr('id="main_image" src="', '"') or
extr('<source src="', '"')).lstrip("."),
"width" : extr("data-width=", " ").strip("\"'"),
"height" : extr("data-height=", ">").partition(
" ")[0].strip("\"'"),