1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-25 04:02:32 +01:00

[imxto] add 'gallery' extractor (#1289)

This commit is contained in:
Mike Fährmann 2023-04-17 20:49:09 +02:00
parent 359e31e462
commit 5b635f2317
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 23 additions and 1 deletions

View File

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

View File

@ -135,6 +135,28 @@ class ImxtoImageExtractor(ImagehostImageExtractor):
}
class ImxtoGalleryExtractor(ImagehostImageExtractor):
"""Extractor for image galleries from imx.to"""
category = "imxto"
subcategory = "gallery"
pattern = r"(?:https?://)?(?:www\.)?(imx\.to/g/([^/?#]+))"
test = ("https://imx.to/g/ozdy", {
"pattern": ImxtoImageExtractor.pattern,
"keyword": {"title": "untitled gallery"},
"count": 40,
})
def items(self):
page = self.request(self.page_url).text
title, pos = text.extract(page, '<div class="title', '<')
data = {
"_extractor": ImxtoImageExtractor,
"title": text.unescape(title.partition(">")[2]).strip(),
}
for url in text.extract_iter(page, '<a href="', '"', pos):
yield Message.Queue, url, data
class AcidimgImageExtractor(ImagehostImageExtractor):
"""Extractor for single images from acidimg.cc"""
category = "acidimg"