Я пытаюсь получить изображение капчи с my.jdownloader.org с помощью myjdapi, но не могу его получить.
Не удалось получить идентификатор изображения капчи: 1729973111207. Ответ сервера : Нет
Справочник по JD API
Пример кода, который я использую:
# Main function for processing captchas
def show_active_captchas_and_solve(device):
try:
# Getting the list of active captchas from the device
captchas = device.captcha.list()
if captchas:
print("Active captchas:")
for captcha in captchas:
captcha_id = captcha.get("id")
print(f"Captcha ID: {captcha_id}")
# Getting the captcha image
captcha_image_response = device.captcha.get(captcha_id) # Removed 'format' parameter
# Check if the response is obtained and display it
if captcha_image_response is None:
print(f"Failed to get captcha image ID: {captcha_id}. Server response: {captcha_image_response}")
continue # Move to the next captcha
# If the response is not None, print it for debugging
print(f"Server response for captcha ID {captcha_id}: {captcha_image_response}")
# Assuming the image is returned in Base64 format
captcha_image_base64 = captcha_image_response # Adjust depending on the response structure.
if captcha_image_base64:
print(f"Base64 Captcha Image: {captcha_image_base64}")
# Solve the captcha using NopeCHA
solution = solve_captcha(captcha_image_base64)
if solution:
print(f"Captcha solution: {solution}")
# Send the solution back to JDownloader
device.captcha.solve(captcha_id, solution, "normal") # Specify the format 'normal'
print("Solution sent successfully.")
else:
print(f"Failed to solve captcha ID: {captcha_id}.")
else:
print(f"Captcha image is empty for ID: {captcha_id}.")
else:
print("No active captchas.")
except Exception as e:
print(f"Error while processing captchas: {e}")
Подробнее здесь: https://stackoverflow.com/questions/791 ... ng-myjdapi
Получите и решите капчу с помощью myjdapi ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Как обойти капчу слайдера, чтобы решить головоломку с помощью селена? (Python)
Anonymous » » в форуме Python - 0 Ответы
- 18 Просмотры
-
Последнее сообщение Anonymous
-