[vk] report errors for private albums (#2556)

This commit is contained in:
Mike Fährmann 2022-05-04 11:46:30 +02:00
parent 9adea93aef
commit 435e9c5d2e
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -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):