Skip to content

Commit

Permalink
Refactor and add warnings disable
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiDrang committed Feb 14, 2020
1 parent f823ccc commit 8494701
Show file tree
Hide file tree
Showing 16 changed files with 46 additions and 42 deletions.
2 changes: 1 addition & 1 deletion python3_anticaptcha/AntiCaptchaAppStats.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import requests
import aiohttp
import requests

from python3_anticaptcha import get_app_stats_url

Expand Down
6 changes: 3 additions & 3 deletions python3_anticaptcha/AntiCaptchaControl.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import requests
import aiohttp
import requests

from python3_anticaptcha import (
get_balance_url,
get_app_stats_url,
incorrect_imagecaptcha_url,
incorrect_recaptcha_url,
get_queue_status_url,
incorrect_recaptcha_url,
incorrect_imagecaptcha_url,
)

# available app stats mods
Expand Down
6 changes: 3 additions & 3 deletions python3_anticaptcha/CallbackClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
import time

import requests
import pika

import pika
from python3_anticaptcha import (
HOST,
PORT,
RTMQ_USERNAME,
RTMQ_PASSWORD,
RTMQ_HOST,
RTMQ_PORT,
RTMQ_VHOST,
RTMQ_PASSWORD,
RTMQ_USERNAME,
)


Expand Down
4 changes: 2 additions & 2 deletions python3_anticaptcha/CustomCaptchaTask.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import time
import asyncio

import requests
import aiohttp
import requests

from python3_anticaptcha import create_task_url, app_key, get_async_result, get_sync_result
from python3_anticaptcha import app_key, create_task_url, get_sync_result, get_async_result


class CustomCaptchaTask:
Expand Down
2 changes: 1 addition & 1 deletion python3_anticaptcha/FunCaptchaTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import aiohttp
import requests

from python3_anticaptcha import create_task_url, app_key, get_sync_result, get_async_result
from python3_anticaptcha import app_key, create_task_url, get_sync_result, get_async_result


class FunCaptchaTask:
Expand Down
2 changes: 1 addition & 1 deletion python3_anticaptcha/FunCaptchaTaskProxyless.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import aiohttp
import requests

from python3_anticaptcha import create_task_url, app_key, get_sync_result, get_async_result
from python3_anticaptcha import app_key, create_task_url, get_sync_result, get_async_result


class FunCaptchaTaskProxyless:
Expand Down
2 changes: 1 addition & 1 deletion python3_anticaptcha/GeeTestTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import aiohttp
import requests

from python3_anticaptcha import create_task_url, app_key, get_sync_result, get_async_result
from python3_anticaptcha import app_key, create_task_url, get_sync_result, get_async_result


class GeeTestTask:
Expand Down
4 changes: 2 additions & 2 deletions python3_anticaptcha/GeeTestTaskProxyless.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import time
import asyncio

import requests
import aiohttp
import requests

from python3_anticaptcha import create_task_url, app_key, get_sync_result, get_async_result
from python3_anticaptcha import app_key, create_task_url, get_sync_result, get_async_result


class GeeTestTaskProxyless:
Expand Down
12 changes: 6 additions & 6 deletions python3_anticaptcha/ImageToTextTask.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import os
import time
import base64
import asyncio
import hashlib
import os
import base64

import requests
import aiohttp
import requests
from requests.adapters import HTTPAdapter

from python3_anticaptcha import (
create_task_url,
ReadError,
ParamError,
app_key,
create_task_url,
get_sync_result,
get_async_result,
ParamError,
ReadError,
)

SAVE_FORMATS = ("const", "temp")
Expand Down
4 changes: 2 additions & 2 deletions python3_anticaptcha/NoCaptchaTask.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import time
import asyncio

import requests
import aiohttp
import requests

from python3_anticaptcha import create_task_url, app_key, get_sync_result, get_async_result
from python3_anticaptcha import app_key, create_task_url, get_sync_result, get_async_result


class NoCaptchaTask:
Expand Down
4 changes: 2 additions & 2 deletions python3_anticaptcha/NoCaptchaTaskProxyless.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import time
import asyncio

import requests
import aiohttp
import requests

from python3_anticaptcha import create_task_url, app_key, get_sync_result, get_async_result
from python3_anticaptcha import app_key, create_task_url, get_sync_result, get_async_result


class NoCaptchaTaskProxyless:
Expand Down
4 changes: 2 additions & 2 deletions python3_anticaptcha/ReCaptchaV3TaskProxyless.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import time
import asyncio

import requests
import aiohttp
import requests

from python3_anticaptcha import create_task_url, app_key, get_sync_result, get_async_result
from python3_anticaptcha import app_key, create_task_url, get_sync_result, get_async_result

MIN_SCORES = (0.3, 0.7, 0.9)

Expand Down
12 changes: 6 additions & 6 deletions python3_anticaptcha/SquareNetTextTask.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import os
import time
import base64
import asyncio
import hashlib
import os
import base64

import requests
import aiohttp
import requests
from requests.adapters import HTTPAdapter

from python3_anticaptcha import (
create_task_url,
ReadError,
ParamError,
app_key,
create_task_url,
get_sync_result,
get_async_result,
ParamError,
ReadError,
)


Expand Down
18 changes: 9 additions & 9 deletions python3_anticaptcha/__init__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
from .config import (
create_task_url,
app_key,
get_balance_url,
incorrect_imagecaptcha_url,
incorrect_recaptcha_url,
HOST,
PORT,
RTMQ_USERNAME,
RTMQ_PASSWORD,
RTMQ_HOST,
RTMQ_PORT,
RTMQ_VHOST,
RTMQ_PASSWORD,
RTMQ_USERNAME,
app_key,
get_result_url,
get_queue_status_url,
create_task_url,
get_balance_url,
get_app_stats_url,
get_queue_status_url,
incorrect_recaptcha_url,
incorrect_imagecaptcha_url,
)
from .errors import ReadError, IdGetError, ParamError
from .get_answer import get_sync_result, get_async_result
from .errors import ParamError, ReadError, IdGetError
4 changes: 4 additions & 0 deletions python3_anticaptcha/config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import urllib3

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

# Адрес для создания задачи
create_task_url = "https://api.anti-captcha.com/createTask"
# Адрес для получения ответа
Expand Down
2 changes: 1 addition & 1 deletion python3_anticaptcha/get_answer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import asyncio
import time
import asyncio

import aiohttp
import requests
Expand Down

0 comments on commit 8494701

Please sign in to comment.