[pixhost] add 'gallery' support (#3353)
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user