[pixhost] add 'gallery' support (#3353)

This commit is contained in:
enduser420
2022-12-04 20:49:14 +05:30
committed by GitHub
parent 213676c785
commit 54844944ab
2 changed files with 20 additions and 1 deletions

View File

@@ -634,7 +634,7 @@ Consider all sites to be NSFW unless otherwise known.
<tr>
<td>Pixhost</td>
<td>https://pixhost.to/</td>
<td>individual Images</td>
<td>Galleries, individual Images</td>
<td></td>
</tr>
<tr>

View File

@@ -242,6 +242,25 @@ class PixhostImageExtractor(ImagehostImageExtractor):
return url, filename
class PixhostGalleryExtractor(ImagehostImageExtractor):
"""Extractor for image galleries from pixhost.to"""
category = "pixhost"
subcategory = "gallery"
pattern = (r"(?:https?://)?((?:www\.)?pixhost\.(?:to|org)"
r"/gallery/([^/?#]+))")
test = ("https://pixhost.to/gallery/jSMFq", {
"pattern": PixhostImageExtractor.pattern,
"count": 3,
})
def items(self):
page = text.extr(self.request(
self.page_url).text, 'class="images"', "</div>")
data = {"_extractor": PixhostImageExtractor}
for url in text.extract_iter(page, '<a href="', '"'):
yield Message.Queue, url, data
class PostimgImageExtractor(ImagehostImageExtractor):
"""Extractor for single images from postimages.org"""
category = "postimg"