Skip to content

Commit f7cd436

Browse files
committed
[chevereto] support 'imagepond.net' (#7278)
1 parent 015ba76 commit f7cd436

File tree

4 files changed

+62
-6
lines changed

4 files changed

+62
-6
lines changed

docs/supportedsites.md

+6
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,12 @@ Consider all listed sites to potentially be NSFW.
11831183
<td>Albums, individual Images, User Profiles</td>
11841184
<td></td>
11851185
</tr>
1186+
<tr>
1187+
<td>ImagePond</td>
1188+
<td>https://imagepond.net/</td>
1189+
<td>Albums, individual Images, User Profiles</td>
1190+
<td></td>
1191+
</tr>
11861192

11871193
<tr>
11881194
<td colspan="4"><strong>Danbooru Instances</strong></td>

gallery_dl/extractor/chevereto.py

+14-6
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,23 @@ class CheveretoExtractor(BaseExtractor):
1818
directory_fmt = ("{category}", "{user}", "{album}",)
1919
archive_fmt = "{id}"
2020

21-
def __init__(self, match):
22-
BaseExtractor.__init__(self, match)
23-
self.path = match.group(match.lastindex)
21+
def _init(self):
22+
self.path = self.groups[-1]
2423

2524
def _pagination(self, url):
26-
while url:
25+
while True:
2726
page = self.request(url).text
2827

2928
for item in text.extract_iter(
3029
page, '<div class="list-item-image ', 'image-container'):
31-
yield text.extr(item, '<a href="', '"')
30+
yield text.urljoin(self.root, text.extr(
31+
item, '<a href="', '"'))
3232

33-
url = text.extr(page, '<a data-pagination="next" href="', '" ><')
33+
url = text.extr(page, 'data-pagination="next" href="', '"')
34+
if not url:
35+
return
36+
if url[0] == "/":
37+
url = self.root + url
3438

3539

3640
BASE_PATTERN = CheveretoExtractor.update({
@@ -42,6 +46,10 @@ def _pagination(self, url):
4246
"root": "https://img.kiwi",
4347
"pattern": r"img\.kiwi",
4448
},
49+
"imagepond": {
50+
"root": "https://imagepond.net",
51+
"pattern": r"imagepond\.net",
52+
},
4553
})
4654

4755

scripts/supportedsites.py

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"illusioncardsbooru": "Illusion Game Cards",
7979
"imagebam" : "ImageBam",
8080
"imagefap" : "ImageFap",
81+
"imagepond" : "ImagePond",
8182
"imgbb" : "ImgBB",
8283
"imgbox" : "imgbox",
8384
"imagechest" : "ImageChest",

test/results/imagepond.py

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# -*- coding: utf-8 -*-
2+
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License version 2 as
5+
# published by the Free Software Foundation.
6+
7+
from gallery_dl.extractor import chevereto
8+
9+
10+
__tests__ = (
11+
{
12+
"#url" : "https://imagepond.net/image/IMG-20250217-160622.TJNphg",
13+
"#category": ("chevereto", "imagepond", "image"),
14+
"#class" : chevereto.CheveretoImageExtractor,
15+
"#urls" : "https://media.imagepond.net/media/IMG_20250217_1606226b345a5dbd0e8971.jpg",
16+
"#sha1_content": "ec7fac6b427f7af01038619208cd69478e91ddef",
17+
18+
"album" : "",
19+
"extension": "jpg",
20+
"filename" : "IMG_20250217_1606226b345a5dbd0e8971",
21+
"id" : "TJNphg",
22+
"url" : "https://media.imagepond.net/media/IMG_20250217_1606226b345a5dbd0e8971.jpg",
23+
"user" : "dariusbbb24",
24+
25+
},
26+
27+
{
28+
"#url" : "https://imagepond.net/album/CDilP/?sort=date_desc&page=1",
29+
"#category": ("chevereto", "imagepond", "album"),
30+
"#class" : chevereto.CheveretoAlbumExtractor,
31+
},
32+
33+
{
34+
"#url" : "https://imagepond.net/dariusbbb24",
35+
"#category": ("chevereto", "imagepond", "user"),
36+
"#class" : chevereto.CheveretoUserExtractor,
37+
"#range" : "1-30",
38+
"#count" : 30,
39+
},
40+
41+
)

0 commit comments

Comments
 (0)