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:
parent
359e31e462
commit
5b635f2317
@ -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>
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user