From 435e9c5d2ef54a44378c40b3f9daac877729429a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Wed, 4 May 2022 11:46:30 +0200 Subject: [PATCH] [vk] report errors for private albums (#2556) --- gallery_dl/extractor/vk.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gallery_dl/extractor/vk.py b/gallery_dl/extractor/vk.py index afb39af2..23f6ea2e 100644 --- a/gallery_dl/extractor/vk.py +++ b/gallery_dl/extractor/vk.py @@ -9,7 +9,7 @@ """Extractors for https://vk.com/""" from .common import Extractor, Message -from .. import text +from .. import text, exception BASE_PATTERN = r"(?:https://)?(?:www\.|m\.)?vk\.com" @@ -72,6 +72,10 @@ class VkExtractor(Extractor): url, method="POST", headers=headers, data=data, ).json()["payload"][1] + if len(payload) < 4: + self.log.debug(payload) + raise exception.AuthorizationError(payload[0]) + total = payload[1] photos = payload[3] @@ -179,6 +183,10 @@ class VkAlbumExtractor(VkExtractor): ("https://vk.com/album-165740836_281339889", { "count": 12, }), + # "Access denied" (#2556) + ("https://vk.com/album-53775183_00", { + "exception": exception.AuthorizationError, + }), ) def __init__(self, match):