[chevereto] support 'imagepond.net' (#7278)
This commit is contained in:
@@ -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",
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user