[ahottie:album] support multiple pages (#8862)
This commit is contained in:
@@ -62,15 +62,22 @@ class AhottieGalleryExtractor(GalleryExtractor, AhottieExtractor):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def images(self, page):
|
def images(self, page):
|
||||||
pos = page.find("<time ") + 1
|
|
||||||
data = {
|
data = {
|
||||||
"_http_headers" : {"Referer": None},
|
"_http_headers" : {"Referer": None},
|
||||||
"_http_validate": self._validate,
|
"_http_validate": self._validate,
|
||||||
}
|
}
|
||||||
return [
|
|
||||||
(url, data)
|
results = []
|
||||||
for url in text.extract_iter(page, '" src="', '"', pos)
|
while True:
|
||||||
]
|
pos = page.find("<time ") + 1
|
||||||
|
for url in text.extract_iter(page, '" src="', '"', pos):
|
||||||
|
results.append((url, data))
|
||||||
|
|
||||||
|
pos = page.find('rel="next"', pos)
|
||||||
|
if pos < 0:
|
||||||
|
break
|
||||||
|
page = self.request(text.rextr(page, 'href="', '"', pos)).text
|
||||||
|
return results
|
||||||
|
|
||||||
def _validate(self, response):
|
def _validate(self, response):
|
||||||
hget = response.headers.get
|
hget = response.headers.get
|
||||||
|
|||||||
@@ -10,12 +10,13 @@ from gallery_dl.extractor import ahottie
|
|||||||
__tests__ = (
|
__tests__ = (
|
||||||
{
|
{
|
||||||
"#url" : "https://ahottie.top/albums/5d54b221c19ff9c9126ffd62859c6603",
|
"#url" : "https://ahottie.top/albums/5d54b221c19ff9c9126ffd62859c6603",
|
||||||
|
"#comment" : "multiple pages (#8862)",
|
||||||
"#class" : ahottie.AhottieGalleryExtractor,
|
"#class" : ahottie.AhottieGalleryExtractor,
|
||||||
"#pattern" : r"https://images2\.imgbox\.com/../../\w+_o\.jpg",
|
"#pattern" : r"https://images2\.imgbox\.com/../../\w+_o\.jpg",
|
||||||
"#count" : 10,
|
"#count" : 14,
|
||||||
|
|
||||||
"count" : 10,
|
"count" : 14,
|
||||||
"num" : range(1, 10),
|
"num" : range(1, 14),
|
||||||
"date" : "dt:2024-12-30 00:00:00",
|
"date" : "dt:2024-12-30 00:00:00",
|
||||||
"extension" : "jpg",
|
"extension" : "jpg",
|
||||||
"filename" : str,
|
"filename" : str,
|
||||||
|
|||||||
Reference in New Issue
Block a user