1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 02:32:33 +01:00

merge #6328: [vk] add 'offset' option

This commit is contained in:
Mike Fährmann 2024-10-17 21:21:52 +02:00
commit 9751b716ef
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 18 additions and 1 deletions

View File

@ -4698,6 +4698,16 @@ Description
or `cookies <extractor.*.cookies_>`__
extractor.vk.offset
-------------------
Type
``integer``
Default
``0``
Description
Custom ``offset`` starting value when paginating over image results.
extractor.vsco.include
----------------------
Type

View File

@ -24,6 +24,13 @@ class VkExtractor(Extractor):
root = "https://vk.com"
request_interval = (0.5, 1.5)
def _init(self):
self.offset = text.parse_int(self.config("offset"))
def skip(self, num):
self.offset += num
return num
def items(self):
sub = re.compile(r"/imp[fg]/").sub
sizes = "wzyxrqpo"
@ -75,7 +82,7 @@ class VkExtractor(Extractor):
"al" : "1",
"direction": "1",
"list" : photos_id,
"offset" : 0,
"offset" : self.offset,
}
while True: