1
0
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:
Mike Fährmann 2024-02-26 15:36:41 +01:00
parent 13443f40a3
commit d3dca68225
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -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"""