add BrightData proxy support

This commit is contained in:
Lei PAN
2022-06-13 11:42:54 +02:00
parent 5dcb0f6bbb
commit d1699c295f
7 changed files with 40 additions and 38 deletions
+4 -2
View File
@@ -13,6 +13,7 @@ from pojo.ReserveResultPojo import ReserveResultPojo, PublishType
from pojo.captcha_error_contact_pojo import ERROR_TYPE_CAPTCHA, \
TOO_MANY_REQUEST_ERROR
from pojo.contact_pojo import ContactPojo
from proxy.proxy_type import ProxyType
from utils.generate_random_passport_id import get_captcha_error_contact_from_contact
from workers.SolveCaptch import SolveCaptcha
@@ -52,7 +53,8 @@ class Tls(threading.local):
class CommandorPage:
tls = Tls()
def __init__(self, contact: ContactPojo, store_type=0, proxy_type=0, mode: ModeEnum = ModeEnum.MANUAL):
def __init__(self, contact: ContactPojo, store_type=0, proxy_type=ProxyType.BRIGHT_DATA,
mode: ModeEnum = ModeEnum.MANUAL):
self.otp_value = None
self.logger = logging.getLogger("约会页面:" + str(contact.phone))
self.is_finished = False
@@ -379,7 +381,7 @@ def launch_page():
first_name="xingzhen",
mail="ColbyPatel653@gmail.com", ccid="", position=0)
page = CommandorPage(contact, store_type=1)
return page.start_page(params.get_proxy(0))
return page.start_page(params.get_proxy())
def wait_for_otp(event: threading.Event, commandor: CommandorPage):