|
@@ -1,16 +1,19 @@
|
|
|
import json
|
|
import json
|
|
|
import multiprocessing
|
|
import multiprocessing
|
|
|
import re
|
|
import re
|
|
|
|
|
+import threading
|
|
|
import time
|
|
import time
|
|
|
|
|
+from datetime import datetime
|
|
|
from urllib import parse
|
|
from urllib import parse
|
|
|
|
|
|
|
|
import requests
|
|
import requests
|
|
|
|
|
|
|
|
-from tools.utils import get_random_browser, get_proxy_ip
|
|
|
|
|
|
|
+from tools.utils import get_random_browser, get_proxy_ip, create_file_if_not_exists
|
|
|
|
|
|
|
|
|
|
|
|
|
-def poc_2(account, passwd, target_url):
|
|
|
|
|
|
|
+def poc_2(account, passwd, target_url, log_name):
|
|
|
print('account: %s, passwd: %s' % (account, passwd))
|
|
print('account: %s, passwd: %s' % (account, passwd))
|
|
|
|
|
+ create_file_if_not_exists(log_name, f'------{account}, {passwd}------')
|
|
|
user_agent = get_random_browser()
|
|
user_agent = get_random_browser()
|
|
|
single_proxy = get_proxy_ip()
|
|
single_proxy = get_proxy_ip()
|
|
|
# single_proxy = 'rrehqcjf:33f90umk8x32@185.199.228.220:7300'
|
|
# single_proxy = 'rrehqcjf:33f90umk8x32@185.199.228.220:7300'
|
|
@@ -20,6 +23,7 @@ def poc_2(account, passwd, target_url):
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
print('proxies:', proxies)
|
|
print('proxies:', proxies)
|
|
|
|
|
+ create_file_if_not_exists(log_name, f'account: {account}, passwd: {passwd}, proxies:{proxies}')
|
|
|
|
|
|
|
|
# session
|
|
# session
|
|
|
"""
|
|
"""
|
|
@@ -122,7 +126,8 @@ def poc_2(account, passwd, target_url):
|
|
|
|
|
|
|
|
print('form_data:', form_data)
|
|
print('form_data:', form_data)
|
|
|
|
|
|
|
|
- response = result.post(net_url, headers=header, cookies=cookies, data=form_data, allow_redirects=False, proxies=proxies)
|
|
|
|
|
|
|
+ response = result.post(net_url, headers=header, cookies=cookies, data=form_data, allow_redirects=False,
|
|
|
|
|
+ proxies=proxies)
|
|
|
print('response.headers: ', response.headers)
|
|
print('response.headers: ', response.headers)
|
|
|
redirect_url1 = response.headers['Location']
|
|
redirect_url1 = response.headers['Location']
|
|
|
print('redirect_url1: ', redirect_url1)
|
|
print('redirect_url1: ', redirect_url1)
|
|
@@ -171,22 +176,49 @@ def poc_2(account, passwd, target_url):
|
|
|
'reserve_ticket[0][amount]': 1,
|
|
'reserve_ticket[0][amount]': 1,
|
|
|
'payment_type': 'credit'
|
|
'payment_type': 'credit'
|
|
|
}
|
|
}
|
|
|
- drawing_response = result.post(drawing_url, headers=drawing_headers, cookies=drawing_cookies, data=drawing_form_data, allow_redirects=False, proxies=proxies)
|
|
|
|
|
|
|
+ drawing_response = result.post(drawing_url, headers=drawing_headers, cookies=drawing_cookies,
|
|
|
|
|
+ data=drawing_form_data, allow_redirects=False, proxies=proxies)
|
|
|
print('drawing_response.text: ', drawing_response.text)
|
|
print('drawing_response.text: ', drawing_response.text)
|
|
|
drawing_data = json.loads(drawing_response.text)
|
|
drawing_data = json.loads(drawing_response.text)
|
|
|
if drawing_data['success']:
|
|
if drawing_data['success']:
|
|
|
order_id = drawing_data['result']['order_id']
|
|
order_id = drawing_data['result']['order_id']
|
|
|
onetime_token_name = drawing_data['result']['onetime_token_name']
|
|
onetime_token_name = drawing_data['result']['onetime_token_name']
|
|
|
onetime_token_value = drawing_data['result']['onetime_token_value']
|
|
onetime_token_value = drawing_data['result']['onetime_token_value']
|
|
|
- print('account, order_id, onetime_token_name, onetime_token_value', account, order_id, onetime_token_name, onetime_token_value)
|
|
|
|
|
|
|
+ print('account, order_id, onetime_token_name, onetime_token_value', account, order_id, onetime_token_name,
|
|
|
|
|
+ onetime_token_value)
|
|
|
|
|
+
|
|
|
|
|
+ create_file_if_not_exists(log_name, f'account:{account}, order_id:{order_id}, onetime_token_name:{onetime_token_name}, onetime_token_value:{onetime_token_value}')
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+def process_account(account, log_name):
|
|
|
|
|
+ try:
|
|
|
|
|
+ poc_2(account.strip(), 'panyue666', 'https://t.livepocket.jp/e/cx591', log_name)
|
|
|
|
|
+ except Exception as e:
|
|
|
|
|
+ print(f'error: {e}, account:{account}')
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+def process_running():
|
|
|
|
|
+ log_name = 'result_' + datetime.now().strftime('%Y%m%d%H%M')
|
|
|
|
|
+ with open('account.txt', 'r') as accounts:
|
|
|
|
|
+ account_list = accounts.readlines()
|
|
|
|
|
+
|
|
|
|
|
+ threads = []
|
|
|
|
|
+ for account in account_list:
|
|
|
|
|
+ thread = threading.Thread(target=process_account, args=(account, log_name))
|
|
|
|
|
+ threads.append(thread)
|
|
|
|
|
+ thread.start()
|
|
|
|
|
+
|
|
|
|
|
+ for thread in threads:
|
|
|
|
|
+ thread.join()
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
|
# 新增下面一行代码即可打包多进程
|
|
# 新增下面一行代码即可打包多进程
|
|
|
multiprocessing.freeze_support()
|
|
multiprocessing.freeze_support()
|
|
|
- with open('account.txt', 'r') as accounts:
|
|
|
|
|
- for account in accounts:
|
|
|
|
|
- try:
|
|
|
|
|
- poc_2(account.strip(), 'panyue666', 'https://t.livepocket.jp/e/cx591')
|
|
|
|
|
- except Exception as e:
|
|
|
|
|
- print(f'error: {e}, account:{account}')
|
|
|
|
|
|
|
+ # with open('account.txt', 'r') as accounts:
|
|
|
|
|
+ # for account in accounts:
|
|
|
|
|
+ # try:
|
|
|
|
|
+ # poc_2(account.strip(), 'panyue666', 'https://t.livepocket.jp/e/cx591')
|
|
|
|
|
+ # except Exception as e:
|
|
|
|
|
+ # print(f'error: {e}, account:{account}')
|
|
|
|
|
+ process_running()
|