|
@@ -16,29 +16,18 @@ from tools.utils import get_random_browser, get_external_ip, get_random_proxy_at
|
|
|
save_all_proxy_ip_v2
|
|
save_all_proxy_ip_v2
|
|
|
|
|
|
|
|
|
|
|
|
|
-def poc_2(account, passwd, target_url, log_name, single_proxy, random_index):
|
|
|
|
|
- """
|
|
|
|
|
- # 生成 5 到 10 秒之间的随机等待时间
|
|
|
|
|
- wait_time = random.uniform(5, 10)
|
|
|
|
|
- # 打印等待时间并等待
|
|
|
|
|
- loggerKit.info(f"等待 {wait_time:.2f} 秒...")
|
|
|
|
|
- time.sleep(wait_time)
|
|
|
|
|
- """
|
|
|
|
|
|
|
+def poc_2(account, passwd, target_url, single_proxy):
|
|
|
|
|
|
|
|
if single_proxy is not None:
|
|
if single_proxy is not None:
|
|
|
# 开始业务逻辑
|
|
# 开始业务逻辑
|
|
|
lock = threading.Lock()
|
|
lock = threading.Lock()
|
|
|
with lock:
|
|
with lock:
|
|
|
# event_cname
|
|
# event_cname
|
|
|
- # url = 'https://t.livepocket.jp/e/lxyyc'
|
|
|
|
|
sub_str = target_url.replace("https://t.livepocket.jp/", "")
|
|
sub_str = target_url.replace("https://t.livepocket.jp/", "")
|
|
|
strs = sub_str.split('/')
|
|
strs = sub_str.split('/')
|
|
|
cname = strs[len(strs) - 1]
|
|
cname = strs[len(strs) - 1]
|
|
|
- # print(cname)
|
|
|
|
|
|
|
|
|
|
loggerKit.info(f'account: {account}, passwd: {passwd}')
|
|
loggerKit.info(f'account: {account}, passwd: {passwd}')
|
|
|
- # writer = FileWriter(log_name)
|
|
|
|
|
- # writer.write_to_file(f'------{account}, {passwd}------ \n')
|
|
|
|
|
user_agent = get_random_browser()
|
|
user_agent = get_random_browser()
|
|
|
# single_proxy = 'rrehqcjf:33f90umk8x32@185.199.228.220:7300'
|
|
# single_proxy = 'rrehqcjf:33f90umk8x32@185.199.228.220:7300'
|
|
|
proxies = {
|
|
proxies = {
|
|
@@ -47,7 +36,6 @@ def poc_2(account, passwd, target_url, log_name, single_proxy, random_index):
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
loggerKit.info(f'proxies: {proxies}')
|
|
loggerKit.info(f'proxies: {proxies}')
|
|
|
- # writer.write_to_file(f'account: {account}, passwd: {passwd}, proxies:{proxies} \n')
|
|
|
|
|
|
|
|
|
|
# session
|
|
# session
|
|
|
if redis_client.get(f'token_{account}') is None:
|
|
if redis_client.get(f'token_{account}') is None:
|
|
@@ -86,10 +74,6 @@ def poc_2(account, passwd, target_url, log_name, single_proxy, random_index):
|
|
|
if 'token' not in content:
|
|
if 'token' not in content:
|
|
|
loggerKit.info(
|
|
loggerKit.info(
|
|
|
f'login account:{account}, 本机出口IP:{get_external_ip()}、代理IP:{single_proxy} 被封!!!')
|
|
f'login account:{account}, 本机出口IP:{get_external_ip()}、代理IP:{single_proxy} 被封!!!')
|
|
|
- # 将被封的IP数据从redis中去掉
|
|
|
|
|
- # key = f'proxy_{str(random_index)}'
|
|
|
|
|
- # loggerKit.info(f'key:{key}')
|
|
|
|
|
- # redis_client.delete(key=key)
|
|
|
|
|
|
|
|
|
|
# 生成 2 到 6 分之间的随机等待时间
|
|
# 生成 2 到 6 分之间的随机等待时间
|
|
|
wait_time = random.uniform(120, 180)
|
|
wait_time = random.uniform(120, 180)
|
|
@@ -259,8 +243,6 @@ def poc_2(account, passwd, target_url, log_name, single_proxy, random_index):
|
|
|
'account: {0}, order_id: {1}, onetime_token_name: {2}, onetime_token_value: {3}, 抢到!!!',
|
|
'account: {0}, order_id: {1}, onetime_token_name: {2}, onetime_token_value: {3}, 抢到!!!',
|
|
|
account, order_id, onetime_token_name, onetime_token_value)
|
|
account, order_id, onetime_token_name, onetime_token_value)
|
|
|
|
|
|
|
|
- # writer.write_to_file(f'account:{account}, order_id:{order_id}, onetime_token_name:{onetime_token_name}, onetime_token_value:{onetime_token_value} \n')
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
def process_account(pocket_url, account, log_name, single_proxy, random_index):
|
|
def process_account(pocket_url, account, log_name, single_proxy, random_index):
|
|
|
try:
|
|
try:
|
|
@@ -295,9 +277,9 @@ def process_running(max_threads, pocket_url):
|
|
|
thread.join()
|
|
thread.join()
|
|
|
|
|
|
|
|
|
|
|
|
|
-def run_poc(account, password, url, log_name, single_proxy, random_index):
|
|
|
|
|
|
|
+def run_poc(account, password, url, single_proxy):
|
|
|
try:
|
|
try:
|
|
|
- poc_2(account, password, url, log_name, single_proxy, random_index)
|
|
|
|
|
|
|
+ poc_2(account, password, url, single_proxy)
|
|
|
except Exception as ex:
|
|
except Exception as ex:
|
|
|
loggerKit.error(f'error: {traceback.format_exc()}, account:{account}')
|
|
loggerKit.error(f'error: {traceback.format_exc()}, account:{account}')
|
|
|
|
|
|