[vk] unescape error messages

pull/3028/head
Mike Fährmann 2 years ago
parent 7f30a0d7a7
commit 122e1a467a
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -79,7 +79,8 @@ class VkExtractor(Extractor):
if len(payload) < 4: if len(payload) < 4:
self.log.debug(payload) self.log.debug(payload)
raise exception.AuthorizationError(payload[0]) raise exception.AuthorizationError(
text.unescape(payload[0]) if payload[0] else None)
total = payload[1] total = payload[1]
photos = payload[3] photos = payload[3]
@ -182,9 +183,6 @@ class VkAlbumExtractor(VkExtractor):
directory_fmt = ("{category}", "{user[id]}", "{album[id]}") directory_fmt = ("{category}", "{user[id]}", "{album[id]}")
pattern = BASE_PATTERN + r"/album(-?\d+)_(\d+)$" pattern = BASE_PATTERN + r"/album(-?\d+)_(\d+)$"
test = ( test = (
("https://vk.com/album232175027_00", {
"count": 8,
}),
("https://vk.com/album-165740836_281339889", { ("https://vk.com/album-165740836_281339889", {
"count": 12, "count": 12,
}), }),
@ -192,6 +190,9 @@ class VkAlbumExtractor(VkExtractor):
("https://vk.com/album-53775183_00", { ("https://vk.com/album-53775183_00", {
"exception": exception.AuthorizationError, "exception": exception.AuthorizationError,
}), }),
("https://vk.com/album232175027_00", {
"exception": exception.AuthorizationError,
}),
) )
def __init__(self, match): def __init__(self, match):

Loading…
Cancel
Save