[hentaifoundry] add 'tag' extractor (#6465)
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user