[vk] detect redirects to 'challenge' pages (#7650)

This commit is contained in:
Mike Fährmann
2025-06-11 18:02:14 +02:00
parent 9348c9ce25
commit 8287a1b372

View File

@@ -85,10 +85,13 @@ class VkExtractor(Extractor):
}
while True:
payload = self.request(
url, method="POST", headers=headers, data=data,
).json()["payload"][1]
response = self.request(
url, method="POST", headers=headers, data=data)
if response.history and "/challenge.html" in response.url:
raise exception.StopExtraction(
"HTTP redirect to 'challenge' page<:\n%s", response.url)
payload = response.json()["payload"][1]
if len(payload) < 4:
self.log.debug(payload)
raise exception.AuthorizationError(