From 0e4e40c9d23688dd8209eadadfcaf20268d9a130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 17 Oct 2024 21:20:21 +0200 Subject: [PATCH] [vk] document 'offset', add '--range' support --- docs/configuration.rst | 10 ++++++++++ gallery_dl/extractor/vk.py | 9 ++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index 5ba7e0e2..a11cf212 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -4698,6 +4698,16 @@ Description or `cookies `__ +extractor.vk.offset +------------------- +Type + ``integer`` +Default + ``0`` +Description + Custom ``offset`` starting value when paginating over image results. + + extractor.vsco.include ---------------------- Type diff --git a/gallery_dl/extractor/vk.py b/gallery_dl/extractor/vk.py index f7213c8a..ea034a79 100644 --- a/gallery_dl/extractor/vk.py +++ b/gallery_dl/extractor/vk.py @@ -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" : self.config("offset") or 0, + "offset" : self.offset, } while True: