[hentaifoundry] add 'tag' extractor (#6465)

This commit is contained in:
Mike Fährmann
2024-11-13 18:23:06 +01:00
parent b62c466c14
commit a3276e3b5d
3 changed files with 29 additions and 1 deletions

View File

@@ -328,7 +328,7 @@ Consider all listed sites to potentially be NSFW.
<tr>
<td>Hentai Foundry</td>
<td>https://www.hentai-foundry.com/</td>
<td>Favorites, individual Images, Pictures, Popular Images, Recent Images, Scraps, Stories, User Profiles</td>
<td>Favorites, individual Images, Pictures, Popular Images, Recent Images, Scraps, Stories, Tag Searches, User Profiles</td>
<td></td>
</tr>
<tr>

View File

@@ -254,6 +254,22 @@ class HentaifoundryFavoriteExtractor(HentaifoundryExtractor):
self.root, self.user)
class HentaifoundryTagExtractor(HentaifoundryExtractor):
"""Extractor for tag searches on hentaifoundry.com"""
subcategory = "tag"
directory_fmt = ("{category}", "{search_tags}")
archive_fmt = "t_{search_tags}_{index}"
pattern = BASE_PATTERN + r"/pictures/tagged/([^/?#]+)"
example = "https://www.hentai-foundry.com/pictures/tagged/TAG"
def __init__(self, match):
HentaifoundryExtractor.__init__(self, match)
self.page_url = "{}/pictures/tagged/{}".format(self.root, self.user)
def metadata(self):
return {"search_tags": self.user}
class HentaifoundryRecentExtractor(HentaifoundryExtractor):
"""Extractor for 'Recent Pictures' on hentaifoundry.com"""
subcategory = "recent"

View File

@@ -55,12 +55,24 @@ __tests__ = (
"#class" : hentaifoundry.HentaifoundryFavoriteExtractor,
},
{
"#url" : "https://www.hentai-foundry.com/pictures/tagged/kancolle",
"#category": ("", "hentaifoundry", "tag"),
"#class" : hentaifoundry.HentaifoundryTagExtractor,
"#pattern" : r"https://pictures.hentai-foundry.com/[^/]/[^/?#]+/\d+/",
"#range" : "20-30",
"search_tags": "kancolle",
},
{
"#url" : "https://www.hentai-foundry.com/pictures/recent/2018-09-20",
"#category": ("", "hentaifoundry", "recent"),
"#class" : hentaifoundry.HentaifoundryRecentExtractor,
"#pattern" : r"https://pictures.hentai-foundry.com/[^/]/[^/?#]+/\d+/",
"#range" : "20-30",
"date": "2018-09-20",
},
{