mirror of
https://github.com/mikf/gallery-dl.git
synced 2025-01-31 11:41:35 +01:00
[xvideos] fix galleries with more than 500 images (#5244)
This commit is contained in:
parent
13443f40a3
commit
d3dca68225
@ -59,15 +59,29 @@ class XvideosGalleryExtractor(XvideosBase, GalleryExtractor):
|
||||
},
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
def images(page):
|
||||
"""Return a list of all image urls for this gallery"""
|
||||
return [
|
||||
def images(self, page):
|
||||
results = [
|
||||
(url, None)
|
||||
for url in text.extract_iter(
|
||||
page, '<a class="embed-responsive-item" href="', '"')
|
||||
]
|
||||
|
||||
if not results:
|
||||
return
|
||||
|
||||
while len(results) % 500 == 0:
|
||||
path = text.rextract(page, ' href="', '"', page.find(">Next</"))[0]
|
||||
if not path:
|
||||
break
|
||||
page = self.request(self.root + path).text
|
||||
results.extend(
|
||||
(url, None)
|
||||
for url in text.extract_iter(
|
||||
page, '<a class="embed-responsive-item" href="', '"')
|
||||
)
|
||||
|
||||
return results
|
||||
|
||||
|
||||
class XvideosUserExtractor(XvideosBase, Extractor):
|
||||
"""Extractor for user profiles on xvideos.com"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user