[chevereto] support 'imagepond.net' (#7278)
This commit is contained in:
@@ -1183,6 +1183,12 @@ Consider all listed sites to potentially be NSFW.
|
||||
<td>Albums, individual Images, User Profiles</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ImagePond</td>
|
||||
<td>https://imagepond.net/</td>
|
||||
<td>Albums, individual Images, User Profiles</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="4"><strong>Danbooru Instances</strong></td>
|
||||
|
||||
@@ -18,19 +18,23 @@ class CheveretoExtractor(BaseExtractor):
|
||||
directory_fmt = ("{category}", "{user}", "{album}",)
|
||||
archive_fmt = "{id}"
|
||||
|
||||
def __init__(self, match):
|
||||
BaseExtractor.__init__(self, match)
|
||||
self.path = match.group(match.lastindex)
|
||||
def _init(self):
|
||||
self.path = self.groups[-1]
|
||||
|
||||
def _pagination(self, url):
|
||||
while url:
|
||||
while True:
|
||||
page = self.request(url).text
|
||||
|
||||
for item in text.extract_iter(
|
||||
page, '<div class="list-item-image ', 'image-container'):
|
||||
yield text.extr(item, '<a href="', '"')
|
||||
yield text.urljoin(self.root, text.extr(
|
||||
item, '<a href="', '"'))
|
||||
|
||||
url = text.extr(page, '<a data-pagination="next" href="', '" ><')
|
||||
url = text.extr(page, 'data-pagination="next" href="', '"')
|
||||
if not url:
|
||||
return
|
||||
if url[0] == "/":
|
||||
url = self.root + url
|
||||
|
||||
|
||||
BASE_PATTERN = CheveretoExtractor.update({
|
||||
@@ -42,6 +46,10 @@ BASE_PATTERN = CheveretoExtractor.update({
|
||||
"root": "https://img.kiwi",
|
||||
"pattern": r"img\.kiwi",
|
||||
},
|
||||
"imagepond": {
|
||||
"root": "https://imagepond.net",
|
||||
"pattern": r"imagepond\.net",
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ CATEGORY_MAP = {
|
||||
"illusioncardsbooru": "Illusion Game Cards",
|
||||
"imagebam" : "ImageBam",
|
||||
"imagefap" : "ImageFap",
|
||||
"imagepond" : "ImagePond",
|
||||
"imgbb" : "ImgBB",
|
||||
"imgbox" : "imgbox",
|
||||
"imagechest" : "ImageChest",
|
||||
|
||||
41
test/results/imagepond.py
Normal file
41
test/results/imagepond.py
Normal file
@@ -0,0 +1,41 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
# published by the Free Software Foundation.
|
||||
|
||||
from gallery_dl.extractor import chevereto
|
||||
|
||||
|
||||
__tests__ = (
|
||||
{
|
||||
"#url" : "https://imagepond.net/image/IMG-20250217-160622.TJNphg",
|
||||
"#category": ("chevereto", "imagepond", "image"),
|
||||
"#class" : chevereto.CheveretoImageExtractor,
|
||||
"#urls" : "https://media.imagepond.net/media/IMG_20250217_1606226b345a5dbd0e8971.jpg",
|
||||
"#sha1_content": "ec7fac6b427f7af01038619208cd69478e91ddef",
|
||||
|
||||
"album" : "",
|
||||
"extension": "jpg",
|
||||
"filename" : "IMG_20250217_1606226b345a5dbd0e8971",
|
||||
"id" : "TJNphg",
|
||||
"url" : "https://media.imagepond.net/media/IMG_20250217_1606226b345a5dbd0e8971.jpg",
|
||||
"user" : "dariusbbb24",
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://imagepond.net/album/CDilP/?sort=date_desc&page=1",
|
||||
"#category": ("chevereto", "imagepond", "album"),
|
||||
"#class" : chevereto.CheveretoAlbumExtractor,
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://imagepond.net/dariusbbb24",
|
||||
"#category": ("chevereto", "imagepond", "user"),
|
||||
"#class" : chevereto.CheveretoUserExtractor,
|
||||
"#range" : "1-30",
|
||||
"#count" : 30,
|
||||
},
|
||||
|
||||
)
|
||||
Reference in New Issue
Block a user