[vk] report errors for private albums (#2556)
This commit is contained in:
parent
9adea93aef
commit
435e9c5d2e
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user