mirror of
https://github.com/mikf/gallery-dl.git
synced 2025-01-31 19:51:34 +01:00
[imagetwist] add 'gallery' extractor (#5190)
This commit is contained in:
parent
fde82ab0ce
commit
4641937ca3
@ -364,7 +364,7 @@ Consider all listed sites to potentially be NSFW.
|
||||
<tr>
|
||||
<td>Imagetwist</td>
|
||||
<td>https://imagetwist.com/</td>
|
||||
<td>individual Images</td>
|
||||
<td>Galleries, individual Images</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -183,6 +183,23 @@ class ImagetwistImageExtractor(ImagehostImageExtractor):
|
||||
return url, filename
|
||||
|
||||
|
||||
class ImagetwistGalleryExtractor(ImagehostImageExtractor):
|
||||
"""Extractor for galleries from imagetwist.com"""
|
||||
category = "imagetwist"
|
||||
subcategory = "gallery"
|
||||
pattern = (r"(?:https?://)?((?:www\.|phun\.)?"
|
||||
r"image(?:twist|haha)\.com/(p/[^/?#]+/\d+))")
|
||||
example = "https://imagetwist.com/p/USER/12345/NAME"
|
||||
|
||||
def items(self):
|
||||
data = {"_extractor": ImagetwistImageExtractor}
|
||||
root = self.page_url[:self.page_url.find("/", 8)]
|
||||
page = self.request(self.page_url).text
|
||||
gallery = text.extr(page, 'class="gallerys', "</div")
|
||||
for path in text.extract_iter(gallery, ' href="', '"'):
|
||||
yield Message.Queue, root + path, data
|
||||
|
||||
|
||||
class ImgspiceImageExtractor(ImagehostImageExtractor):
|
||||
"""Extractor for single images from imgspice.com"""
|
||||
category = "imgspice"
|
||||
|
@ -41,4 +41,16 @@ __tests__ = (
|
||||
"#class" : imagehosts.ImagetwistImageExtractor,
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://imagetwist.com/p/gdldev/747223/digits",
|
||||
"#category": ("imagehost", "imagetwist", "gallery"),
|
||||
"#class" : imagehosts.ImagetwistGalleryExtractor,
|
||||
"#urls" : (
|
||||
"https://imagetwist.com/j6eu91sbl9bs",
|
||||
"https://imagetwist.com/vx4oh119izyr",
|
||||
"https://imagetwist.com/n3td3a6vzzed",
|
||||
"https://imagetwist.com/8uz6lmg31nmc",
|
||||
),
|
||||
},
|
||||
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user