Browse Source

designer 传参

derrickx 1 năm trước cách đây
mục cha
commit
4ce735c640

BIN
__pycache__/app.cpython-311.pyc


BIN
__pycache__/litter_helper.cpython-311.pyc


+ 416 - 5
app.py

@@ -15,6 +15,95 @@ from tools import loggerKit, redis_client, file_writer
 from tools.utils import get_random_browser, get_external_ip, get_random_proxy_at_redis, save_all_proxy_ip, \
     save_all_proxy_ip_v2
 
+"""
+保留登陆账号的信息
+"""
+
+
+def save_account_info(account, passwd, target_url, single_proxy):
+    lock = threading.Lock()
+    with lock:
+        if single_proxy is not None:
+            # event_cname
+            sub_str = target_url.replace("https://t.livepocket.jp/", "")
+            strs = sub_str.split('/')
+            cname = strs[len(strs) - 1]
+
+            loggerKit.info(f'target_url: {target_url}, account: {account}, passwd: {passwd}')
+            user_agent = get_random_browser()
+            # single_proxy = 'rrehqcjf:33f90umk8x32@185.199.228.220:7300'
+            proxies = {
+                'http': f'http://{single_proxy}',
+                # 'https': f'https://{single_proxy}'
+            }
+
+            loggerKit.info(f'proxies: {proxies}')
+
+            # session
+            if redis_client.get(f'token_{account}') is None:
+
+                """
+                模拟登录
+                """
+                # 定义请求地址
+                stamp = str(int(time.time()))
+                login_url = f"https://t.livepocket.jp/api/sessions/create?mytimestamp={stamp}"
+
+                # 定义请求header
+                headers = {'Content-Type': 'application/x-www-form-urlencoded;',
+                           'Referer': 'https://t.livepocket.jp/login?acroot=header-new_p_u_nl',
+                           'Sec-Ch-Ua': 'Chromium";v="124", "Google Chrome";v="124", "Not-A.Brand";v="99',
+                           'User-Agent': user_agent,
+                           'path': f'/api/sessions/create?mytimestamp={stamp}',
+                           'Origin': 'https://t.livepocket.jp',
+                           'Sec-Ch-Ua-Mobile': '?0',
+                           'Sec-Fetch-Mode': 'cors',
+                           'Sec-Fetch-Site': 'same-origin',
+                           'Priority': 'u=1, i'
+                           }
+
+                # 通过字典方式定义请求body
+                form_data = {"login": account,
+                             "password": passwd,
+                             "auto_login": "on",
+                             "login_password": f"{account}&{passwd}"
+                             }
+
+                data = parse.urlencode(form_data)
+                session = requests.session()
+                content = session.post(url=login_url, headers=headers, data=data, proxies=proxies).text
+                # loggerKit.info(f'login info: {content}')
+                if 'token' not in content:
+                    loggerKit.info(
+                        f'login account:{account}, 本机出口IP:{get_external_ip()}、代理IP:{single_proxy} 被封!!!')
+
+                    # # 生成 2 到 6 分之间的随机等待时间
+                    # wait_time = random.uniform(120, 180)
+                    # # 打印等待时间并等待
+                    # loggerKit.info(f"等待 {wait_time:.2f} 秒...")
+                    # time.sleep(wait_time)
+
+                    return
+
+                cookie = session.cookies
+                response_cookie = cookie.get_dict()
+                login_resp = json.loads(content)
+                token = login_resp['result']['token']
+                login_session = response_cookie['ci_session']
+                php_session = response_cookie['PHPSESSID']
+                loggerKit.info(f'login account:{account}, 代理IP:{single_proxy}, token: {token} login success!!!')
+                redis_client.set(f'token_{account}', token)
+                redis_client.set(f'php_session_{account}', php_session)
+                redis_client.set(f'ci_session_{account}', login_session)
+
+                file_writer.write_to_file(f'login account:{account}, 代理IP:{single_proxy}, token: {token} 登录成功!!!')
+            else:
+                token = redis_client.get(f'token_{account}')
+                login_session = redis_client.get(f'ci_session_{account}')
+                php_session = redis_client.get(f'php_session_{account}')
+
+            print(f"login_session:{login_session}, token:{token}")
+
 
 def get_ticket(account, passwd, target_url, single_proxy):
     if single_proxy is not None:
@@ -74,11 +163,11 @@ def get_ticket(account, passwd, target_url, single_proxy):
                     loggerKit.info(
                         f'login account:{account}, 本机出口IP:{get_external_ip()}、代理IP:{single_proxy} 被封!!!')
 
-                    # 生成 2 到 6 分之间的随机等待时间
-                    wait_time = random.uniform(120, 180)
-                    # 打印等待时间并等待
-                    loggerKit.info(f"等待 {wait_time:.2f} 秒...")
-                    time.sleep(wait_time)
+                    # # 生成 2 到 6 分之间的随机等待时间
+                    # wait_time = random.uniform(120, 180)
+                    # # 打印等待时间并等待
+                    # loggerKit.info(f"等待 {wait_time:.2f} 秒...")
+                    # time.sleep(wait_time)
 
                     return
 
@@ -247,6 +336,244 @@ def get_ticket(account, passwd, target_url, single_proxy):
                 file_writer.write_to_file(f'account: {account}, order_id: {order_id}, Order Ticket!!!')
 
 
+"""
+下单
+"""
+
+
+def get_ticket_order(account, passwd, target_url, single_proxy):
+    if single_proxy is not None:
+        # 开始业务逻辑
+        lock = threading.Lock()
+        with lock:
+            # event_cname
+            sub_str = target_url.replace("https://t.livepocket.jp/", "")
+            strs = sub_str.split('/')
+            cname = strs[len(strs) - 1]
+
+            loggerKit.info(f'target_url: {target_url}, account: {account}, passwd: {passwd}')
+            user_agent = get_random_browser()
+            # single_proxy = 'rrehqcjf:33f90umk8x32@185.199.228.220:7300'
+            proxies = {
+                'http': f'http://{single_proxy}',
+                # 'https': f'https://{single_proxy}'
+            }
+
+            loggerKit.info(f'proxies: {proxies}')
+
+            # session
+            if redis_client.get(f'token_{account}') is None:
+
+                """
+                模拟登录
+                """
+                # 定义请求地址
+                stamp = str(int(time.time()))
+                login_url = f"https://t.livepocket.jp/api/sessions/create?mytimestamp={stamp}"
+
+                # 定义请求header
+                headers = {'Content-Type': 'application/x-www-form-urlencoded;',
+                           'Referer': 'https://t.livepocket.jp/login?acroot=header-new_p_u_nl',
+                           'Sec-Ch-Ua': 'Chromium";v="124", "Google Chrome";v="124", "Not-A.Brand";v="99',
+                           'User-Agent': user_agent,
+                           'path': f'/api/sessions/create?mytimestamp={stamp}',
+                           'Origin': 'https://t.livepocket.jp',
+                           'Sec-Ch-Ua-Mobile': '?0',
+                           'Sec-Fetch-Mode': 'cors',
+                           'Sec-Fetch-Site': 'same-origin',
+                           'Priority': 'u=1, i'
+                           }
+
+                # 通过字典方式定义请求body
+                form_data = {"login": account,
+                             "password": passwd,
+                             "auto_login": "on",
+                             "login_password": f"{account}&{passwd}"
+                             }
+
+                data = parse.urlencode(form_data)
+                session = requests.session()
+                content = session.post(url=login_url, headers=headers, data=data, proxies=proxies).text
+                # loggerKit.info(f'login info: {content}')
+                if 'token' not in content:
+                    loggerKit.info(
+                        f'login account:{account}, 本机出口IP:{get_external_ip()}、代理IP:{single_proxy} 被封!!!')
+
+                    # # 生成 2 到 6 分之间的随机等待时间
+                    # wait_time = random.uniform(120, 180)
+                    # # 打印等待时间并等待
+                    # loggerKit.info(f"等待 {wait_time:.2f} 秒...")
+                    # time.sleep(wait_time)
+
+                    return
+
+                cookie = session.cookies
+                response_cookie = cookie.get_dict()
+                login_resp = json.loads(content)
+                token = login_resp['result']['token']
+                login_session = response_cookie['ci_session']
+                php_session = response_cookie['PHPSESSID']
+                loggerKit.info(f'login account:{account}, 代理IP:{single_proxy}, token: {token} login success!!!')
+                redis_client.set(f'token_{account}', token)
+                redis_client.set(f'php_session_{account}', php_session)
+                redis_client.set(f'ci_session_{account}', login_session)
+
+                file_writer.write_to_file(f'login account:{account}, 代理IP:{single_proxy}, token: {token} 登录成功!!!')
+            else:
+                token = redis_client.get(f'token_{account}')
+                login_session = redis_client.get(f'ci_session_{account}')
+                php_session = redis_client.get(f'php_session_{account}')
+
+            # event_id
+            # 从redis中查询,查询不到再去请求
+            event_id = redis_client.get(f'event_id_{cname}')
+            if event_id == 0 or event_id is None:
+                response = requests.get(target_url, proxies=proxies)
+                if response.status_code == 200:
+                    html_string = response.content.decode('utf8')
+                    start_index = html_string.find('https://t.livepocket.jp/purchase/verify?event_id=')
+                    if start_index != -1:
+                        end_index = html_string.find("'", start_index)
+                        if end_index != -1:
+                            event_id = html_string[
+                                       start_index + len('https://t.livepocket.jp/purchase/verify?event_id='):end_index]
+                            redis_client.set(f'event_id_{cname}', event_id)
+                            loggerKit.info(f'event_id: {event_id}')
+                        else:
+                            loggerKit.warning('End index not found.')
+                    else:
+                        loggerKit.warning('Substring not found.')
+                else:
+                    loggerKit.error('Failed to fetch the page. Status code: {0}', response.status_code)
+
+            # ticket_id
+            # 从redis中查询,不存在则请求
+            ticket_id = redis_client.get(f'ticket_id_{cname}')
+            if ticket_id == 0 or ticket_id is None:
+                response = requests.get(target_url, proxies=proxies)
+                if response.status_code == 200:
+                    html_string = response.text
+                    match = re.search(r'id="js_order_limited_(\d+)"', html_string)
+                    if match:
+                        ticket_id = match.group(1)
+                        redis_client.set(f'ticket_id_{cname}', ticket_id)
+                        loggerKit.info(f'ticket_id: {ticket_id}')
+                    else:
+                        loggerKit.warning("未找到匹配的数值")
+
+            # redirect_url1
+            net_url = 'https://t.livepocket.jp/purchase?type=new'
+            result = requests.Session()
+            header = {
+                'Host': 't.livepocket.jp',
+                'User-Agent': "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) "
+                              "Chrome/69.0.3947.100 Safari/537.36",
+                'Content-Type': 'application/x-www-form-urlencoded',
+                'Referer': f'{target_url}',
+            }
+            # my_session = 'IN7u3uuP5WcizQkmRzF%2F3OsLuNNQePnxNBvnlPgqT6FPz2BgyKT2KCJaMvdj8ZSa6wNp2xZIL6VoA7Mj0R2zECMZkOKJOLbsNwUdXwvcsROxjfCzibxEaj4nG%2Bq29dCEUdiWI2TgUsKSFGRZaOP0p37ktl%2B1wSMqMAk918Nkt7APIxpQtZ%2BoLwId4PMOkN3oOIwT3CvsuDbgPQHIuokZXcnNe8uOAUuZBLW4nKOdYimLcSw6oTMt85UXkwm4OyTdxYR3%2B8crA0OfQCyfHXqY%2Bj0t9R0mmNSusRXRDuDBmOCFR58vHVuuwZ0AXNHYoYB0sdm28VL9xgHHrzkvm2M9cpLEIVWUWBWGaZgtO3xp2d8L70%2BfAKwyv6JPGcGmGf9wUQzBltssBpMmYqSfkws1%2Bp8BOhmXOqfljSYbWcxxVVSw%2B2dtoxBXsTf793mD9sVYRsrr8YPGz4JPVGWGU0outg%3D%3D'
+            cookies = {
+                'ci_session': f'{login_session}',
+                'PHPSESSID': f'{php_session}',
+                'list_count': '{"success":true,"result":{"myticket_count":{"count":"0"},"today_event":{"total_count":0,"data_list":[]},"unread_count":5},"submit":true}',
+                'sns_status': '{"success":true,"result":{"facebook":0,"twitter":0,"mixi":0,"line":0,"yahoo":0,"plusid":1,"google":0},"submit":true}',
+                'display_init': '{"success":true,"result":{"purchased_tickets":{"total_count":0,"data_list":{"ticket_info":[]}},"lottery_tickets":{"total_count":0,"data_list":{"ticket_info":[]}},"order_limited_event_tickets":{"data_list":{"ticket_info":[]},"total_count":0},"event_order_limit":true},"submit":true}',
+            }
+
+            ticket_key = f'ticket_id_{ticket_id}'
+            form_data = {
+                'redirect_url': 'https://t.livepocket.jp/purchase/',
+                'event_id': event_id,
+                'event_cname': f'{cname}',
+                'ticket_type': 'lottery',
+                'facebook_ticket_count': 0,
+                'twitter_ticket_count': 0,
+                'plusid_linkage_invalidation_flg': 0,
+                ticket_key: 1
+            }
+
+            loggerKit.info('form_data: {0}', form_data)
+            response = result.post(net_url, headers=header, cookies=cookies, data=form_data, allow_redirects=False,
+                                   proxies=proxies)
+            loggerKit.info('response.headers: {0}', response.headers)
+            if 'Location' in response.headers:
+                redirect_url1 = response.headers['Location']
+                loggerKit.info('redirect_url1: {0}', redirect_url1)
+            else:
+                return
+
+            # https://t.livepocket.jp/purchase/security?id=309887&type=new
+            # redirect_url2
+            response2 = result.get(redirect_url1, headers=header, cookies=cookies, allow_redirects=False,
+                                   proxies=proxies)
+            loggerKit.info('response2.headers: {0}', response2.headers)
+            if 'Location' in response2.headers:
+                redirect_url2 = response2.headers['Location']
+                loggerKit.info('redirect_url2: {0}', redirect_url2)
+            else:
+                return
+
+            # https://t.livepocket.jp/purchase/confirm?id=309887&reserved_session_id=423272
+            # redirect_url3
+            response3 = result.get(redirect_url2, headers=header, cookies=cookies, allow_redirects=False,
+                                   proxies=proxies)
+            print('response3.headers: ', response3.headers)
+            if 'Location' in response3.headers:
+                redirect_url3 = response3.headers['Location']
+                loggerKit.info('redirect_url3: {0}', redirect_url3)
+            else:
+                loggerKit.warning('redirect_url3 is None')
+                return
+
+            # https://t.livepocket.jp/purchase/confirm?id=309887&reserved_session_id=794986&otoken=mMyZTgzMmQ4OWQ5ZjY5NWFlNGE2ZmJlMWM5Mm
+            # drawing_tickets
+            # drawing_url = 'https://t.livepocket.jp/api/drawing_tickets/entry?mytimestamp=' + str(int(time.time()))
+
+            region_string = redirect_url3.split('?')[1]
+            params = region_string.split('&')
+            reserve_session_id = params[1].split("=")[1]
+
+            drawing_headers = {
+                'Host': 't.livepocket.jp',
+                'User-Agent': user_agent,
+                'Content-Type': 'application/x-www-form-urlencoded',
+                'Referer': f'{redirect_url3}',
+            }
+            drawing_cookies = {
+                'ci_session': f'{login_session}',
+                'PHPSESSID': f'{php_session}',
+            }
+            drawing_form_data = {
+                'utoken': f'{token}',
+                'onetime_token_name': 'buy_ticket',
+                'onetime_token_value': params[2].split('=')[1],
+                'url': f'https://t.livepocket.jp/purchase/confirm?id={event_id}&reserved_session_id={reserve_session_id}',
+                'payment_method': 0,
+                'reserve_session_id': reserve_session_id,
+                'event_id': event_id,
+                'reserve_ticket[0][ticket_id]': ticket_id,
+                'reserve_ticket[0][amount]': 1,
+                'payment_type': 'credit'
+            }
+            drawing_response = result.post(
+                f'https://t.livepocket.jp/api/drawing_tickets/entry?mytimestamp={str(int(time.time()))}',
+                headers=drawing_headers, cookies=drawing_cookies,
+                data=drawing_form_data, allow_redirects=False, proxies=proxies)
+            loggerKit.info('drawing_response.text: {0}', drawing_response.text)
+            drawing_data = json.loads(drawing_response.text)
+            if drawing_data['success']:
+                order_id = drawing_data['result']['order_id']
+                onetime_token_name = drawing_data['result']['onetime_token_name']
+                onetime_token_value = drawing_data['result']['onetime_token_value']
+                loggerKit.info(
+                    'account: {0}, order_id: {1}, onetime_token_name: {2}, onetime_token_value: {3}, Get Ticket!!!',
+                    account, order_id, onetime_token_name, onetime_token_value)
+
+                file_writer.write_to_file(f'account: {account}, order_id: {order_id}, Order Ticket!!!')
+
+                # 写入文件
+
+
 def process_account(pocket_url, account, single_proxy):
     try:
         run_threading(account, 'panyue666', pocket_url, single_proxy)
@@ -254,6 +581,18 @@ def process_account(pocket_url, account, single_proxy):
         loggerKit.error(f'error: {traceback.format_exc()}, account:{account}')
 
 
+"""
+登陆
+"""
+
+
+def process_account_login(pocket_url, account, single_proxy):
+    try:
+        run_threading_login(account, 'panyue666', pocket_url, single_proxy)
+    except Exception as ex:
+        loggerKit.error(f'error: {traceback.format_exc()}, account:{account}')
+
+
 def process_running(max_threads, pocket_url):
     # log_name = f"data_{datetime.datetime.now().strftime('%Y%m%d%H%M')}.txt"
 
@@ -280,6 +619,34 @@ def process_running(max_threads, pocket_url):
             thread.join()
 
 
+"""
+账号批量登陆
+"""
+
+
+def login_account(max_threads, accounts_path, pocket_url):
+    with open(accounts_path, 'r') as accounts:
+        account_list = accounts.readlines()
+
+    threads = []
+    for account in account_list:
+        single_proxy, random_index = get_random_proxy_at_redis(100)
+        thread = threading.Thread(target=save_account_info,
+                                  args=(account.strip(), "panyue666", pocket_url, single_proxy))
+        threads.append(thread)
+        thread.start()
+
+        # 如果当前线程数达到上限,等待有线程结束后再创建新线程
+        if len(threads) == max_threads:
+            for t in threads:
+                t.join()
+            threads.clear()
+
+    # 等待所有线程执行完毕
+    for thread in threads:
+        thread.join()
+
+
 def run_threading(account, password, url, single_proxy):
     try:
         get_ticket(account, password, url, single_proxy)
@@ -287,6 +654,50 @@ def run_threading(account, password, url, single_proxy):
         loggerKit.error(f'error: {traceback.format_exc()}, account:{account}')
 
 
+"""
+登陆
+"""
+
+
+def run_threading_login(account, password, url, single_proxy):
+    try:
+        save_account_info(account, password, url, single_proxy)
+    except Exception as ex:
+        loggerKit.error(f'error: {traceback.format_exc()}, account:{account}')
+
+
+"""
+下单
+"""
+
+
+def run_threading_order(max_threads, account_path, url):
+    try:
+        with open('accounts.txt', 'r') as accounts:
+            account_list = accounts.readlines()
+
+        threads = []
+        for account in account_list:
+            single_proxy, random_index = get_random_proxy_at_redis(100)
+            thread = threading.Thread(target=get_ticket_order,
+                                      args=(account, "panyue666", url, single_proxy))
+            threads.append(thread)
+            thread.start()
+
+            # 如果当前线程数达到上限,等待有线程结束后再创建新线程
+            if len(threads) == max_threads:
+                for t in threads:
+                    t.join()
+                threads.clear()
+
+        # 等待所有线程执行完毕
+        for thread in threads:
+            thread.join()
+
+    except Exception as ex:
+        loggerKit.error(f'error: {traceback.format_exc()}, account:{account_path}')
+
+
 def run_daily_job(hour, minute):
     # 获取当前日期和时间
     now = datetime.datetime.now()

BIN
dist/.DS_Store


+ 25 - 17
litter_helper.py

@@ -2,7 +2,7 @@
 
 # Form implementation generated from reading ui file 'litter_helper.ui'
 #
-# Created by: PyQt5 UI code generator 5.15.9
+# Created by: PyQt5 UI code generator 5.15.10
 #
 # WARNING: Any manual changes made to this file will be lost when pyuic5 is
 # run again.  Do not edit this file unless you know what you are doing.
@@ -14,54 +14,60 @@ from PyQt5 import QtCore, QtGui, QtWidgets
 class Ui_menu(object):
     def setupUi(self, menu):
         menu.setObjectName("menu")
-        menu.resize(678, 348)
+        menu.resize(631, 336)
         self.centralwidget = QtWidgets.QWidget(menu)
         self.centralwidget.setObjectName("centralwidget")
         self.label = QtWidgets.QLabel(self.centralwidget)
-        self.label.setGeometry(QtCore.QRect(70, 50, 60, 16))
+        self.label.setGeometry(QtCore.QRect(60, 40, 60, 16))
         self.label.setObjectName("label")
         self.urlLineEdit = QtWidgets.QLineEdit(self.centralwidget)
-        self.urlLineEdit.setGeometry(QtCore.QRect(140, 50, 491, 22))
+        self.urlLineEdit.setGeometry(QtCore.QRect(130, 40, 281, 22))
         self.urlLineEdit.setObjectName("urlLineEdit")
         self.label_2 = QtWidgets.QLabel(self.centralwidget)
-        self.label_2.setGeometry(QtCore.QRect(70, 100, 60, 16))
+        self.label_2.setGeometry(QtCore.QRect(60, 90, 60, 16))
         self.label_2.setObjectName("label_2")
         self.label_3 = QtWidgets.QLabel(self.centralwidget)
-        self.label_3.setGeometry(QtCore.QRect(70, 160, 60, 16))
+        self.label_3.setGeometry(QtCore.QRect(60, 150, 60, 16))
         self.label_3.setObjectName("label_3")
         self.startDateTimeEdit = QtWidgets.QDateTimeEdit(self.centralwidget)
-        self.startDateTimeEdit.setGeometry(QtCore.QRect(140, 100, 194, 22))
+        self.startDateTimeEdit.setGeometry(QtCore.QRect(130, 90, 194, 22))
         self.startDateTimeEdit.setObjectName("startDateTimeEdit")
         self.endDateTimeEdit = QtWidgets.QDateTimeEdit(self.centralwidget)
-        self.endDateTimeEdit.setGeometry(QtCore.QRect(140, 160, 194, 22))
+        self.endDateTimeEdit.setGeometry(QtCore.QRect(130, 150, 194, 22))
         self.endDateTimeEdit.setObjectName("endDateTimeEdit")
         self.label_4 = QtWidgets.QLabel(self.centralwidget)
-        self.label_4.setGeometry(QtCore.QRect(70, 220, 60, 16))
+        self.label_4.setGeometry(QtCore.QRect(460, 40, 60, 16))
         self.label_4.setObjectName("label_4")
         self.concurrencyLineEdit = QtWidgets.QLineEdit(self.centralwidget)
-        self.concurrencyLineEdit.setGeometry(QtCore.QRect(140, 220, 51, 22))
+        self.concurrencyLineEdit.setGeometry(QtCore.QRect(520, 40, 51, 22))
         self.concurrencyLineEdit.setObjectName("concurrencyLineEdit")
         self.startPushButton = QtWidgets.QPushButton(self.centralwidget)
-        self.startPushButton.setGeometry(QtCore.QRect(380, 220, 81, 26))
+        self.startPushButton.setGeometry(QtCore.QRect(370, 210, 81, 26))
         self.startPushButton.setObjectName("startPushButton")
         self.endPushButton = QtWidgets.QPushButton(self.centralwidget)
-        self.endPushButton.setGeometry(QtCore.QRect(510, 220, 81, 26))
+        self.endPushButton.setGeometry(QtCore.QRect(500, 210, 81, 26))
         self.endPushButton.setObjectName("endPushButton")
         self.accountsLabel = QtWidgets.QLabel(self.centralwidget)
-        self.accountsLabel.setGeometry(QtCore.QRect(390, 100, 60, 16))
+        self.accountsLabel.setGeometry(QtCore.QRect(380, 90, 60, 16))
         self.accountsLabel.setObjectName("accountsLabel")
         self.watchPushButton = QtWidgets.QPushButton(self.centralwidget)
-        self.watchPushButton.setGeometry(QtCore.QRect(510, 160, 81, 26))
+        self.watchPushButton.setGeometry(QtCore.QRect(180, 210, 81, 26))
         self.watchPushButton.setObjectName("watchPushButton")
         self.ipPoolLabel = QtWidgets.QLabel(self.centralwidget)
-        self.ipPoolLabel.setGeometry(QtCore.QRect(520, 100, 71, 16))
+        self.ipPoolLabel.setGeometry(QtCore.QRect(510, 90, 71, 16))
         self.ipPoolLabel.setObjectName("ipPoolLabel")
         self.loginPushButton = QtWidgets.QPushButton(self.centralwidget)
-        self.loginPushButton.setGeometry(QtCore.QRect(380, 160, 81, 26))
+        self.loginPushButton.setGeometry(QtCore.QRect(50, 210, 81, 26))
         self.loginPushButton.setObjectName("loginPushButton")
+        self.startTimePushButton = QtWidgets.QPushButton(self.centralwidget)
+        self.startTimePushButton.setGeometry(QtCore.QRect(370, 150, 81, 26))
+        self.startTimePushButton.setObjectName("startTimePushButton")
+        self.endTimePushButton = QtWidgets.QPushButton(self.centralwidget)
+        self.endTimePushButton.setGeometry(QtCore.QRect(500, 150, 81, 26))
+        self.endTimePushButton.setObjectName("endTimePushButton")
         menu.setCentralWidget(self.centralwidget)
         self.menubar = QtWidgets.QMenuBar(menu)
-        self.menubar.setGeometry(QtCore.QRect(0, 0, 678, 21))
+        self.menubar.setGeometry(QtCore.QRect(0, 0, 631, 24))
         self.menubar.setObjectName("menubar")
         self.menuLittle_Helper = QtWidgets.QMenu(self.menubar)
         self.menuLittle_Helper.setObjectName("menuLittle_Helper")
@@ -87,4 +93,6 @@ class Ui_menu(object):
         self.watchPushButton.setText(_translate("menu", "查看结果"))
         self.ipPoolLabel.setText(_translate("menu", "IP池编辑"))
         self.loginPushButton.setText(_translate("menu", "登录账号"))
+        self.startTimePushButton.setText(_translate("menu", "开始定时"))
+        self.endTimePushButton.setText(_translate("menu", "停止定时"))
         self.menuLittle_Helper.setTitle(_translate("menu", "Little Helper"))

+ 59 - 33
litter_helper.ui

@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>678</width>
-    <height>348</height>
+    <width>631</width>
+    <height>336</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -17,8 +17,8 @@
    <widget class="QLabel" name="label">
     <property name="geometry">
      <rect>
-      <x>70</x>
-      <y>50</y>
+      <x>60</x>
+      <y>40</y>
       <width>60</width>
       <height>16</height>
      </rect>
@@ -30,9 +30,9 @@
    <widget class="QLineEdit" name="urlLineEdit">
     <property name="geometry">
      <rect>
-      <x>140</x>
-      <y>50</y>
-      <width>491</width>
+      <x>130</x>
+      <y>40</y>
+      <width>281</width>
       <height>22</height>
      </rect>
     </property>
@@ -40,8 +40,8 @@
    <widget class="QLabel" name="label_2">
     <property name="geometry">
      <rect>
-      <x>70</x>
-      <y>100</y>
+      <x>60</x>
+      <y>90</y>
       <width>60</width>
       <height>16</height>
      </rect>
@@ -53,8 +53,8 @@
    <widget class="QLabel" name="label_3">
     <property name="geometry">
      <rect>
-      <x>70</x>
-      <y>160</y>
+      <x>60</x>
+      <y>150</y>
       <width>60</width>
       <height>16</height>
      </rect>
@@ -66,8 +66,8 @@
    <widget class="QDateTimeEdit" name="startDateTimeEdit">
     <property name="geometry">
      <rect>
-      <x>140</x>
-      <y>100</y>
+      <x>130</x>
+      <y>90</y>
       <width>194</width>
       <height>22</height>
      </rect>
@@ -76,8 +76,8 @@
    <widget class="QDateTimeEdit" name="endDateTimeEdit">
     <property name="geometry">
      <rect>
-      <x>140</x>
-      <y>160</y>
+      <x>130</x>
+      <y>150</y>
       <width>194</width>
       <height>22</height>
      </rect>
@@ -86,8 +86,8 @@
    <widget class="QLabel" name="label_4">
     <property name="geometry">
      <rect>
-      <x>70</x>
-      <y>220</y>
+      <x>460</x>
+      <y>40</y>
       <width>60</width>
       <height>16</height>
      </rect>
@@ -99,8 +99,8 @@
    <widget class="QLineEdit" name="concurrencyLineEdit">
     <property name="geometry">
      <rect>
-      <x>140</x>
-      <y>220</y>
+      <x>520</x>
+      <y>40</y>
       <width>51</width>
       <height>22</height>
      </rect>
@@ -109,8 +109,8 @@
    <widget class="QPushButton" name="startPushButton">
     <property name="geometry">
      <rect>
-      <x>380</x>
-      <y>220</y>
+      <x>370</x>
+      <y>210</y>
       <width>81</width>
       <height>26</height>
      </rect>
@@ -122,8 +122,8 @@
    <widget class="QPushButton" name="endPushButton">
     <property name="geometry">
      <rect>
-      <x>510</x>
-      <y>220</y>
+      <x>500</x>
+      <y>210</y>
       <width>81</width>
       <height>26</height>
      </rect>
@@ -135,8 +135,8 @@
    <widget class="QLabel" name="accountsLabel">
     <property name="geometry">
      <rect>
-      <x>390</x>
-      <y>100</y>
+      <x>380</x>
+      <y>90</y>
       <width>60</width>
       <height>16</height>
      </rect>
@@ -148,8 +148,8 @@
    <widget class="QPushButton" name="watchPushButton">
     <property name="geometry">
      <rect>
-      <x>510</x>
-      <y>160</y>
+      <x>180</x>
+      <y>210</y>
       <width>81</width>
       <height>26</height>
      </rect>
@@ -161,8 +161,8 @@
    <widget class="QLabel" name="ipPoolLabel">
     <property name="geometry">
      <rect>
-      <x>520</x>
-      <y>100</y>
+      <x>510</x>
+      <y>90</y>
       <width>71</width>
       <height>16</height>
      </rect>
@@ -174,8 +174,8 @@
    <widget class="QPushButton" name="loginPushButton">
     <property name="geometry">
      <rect>
-      <x>380</x>
-      <y>160</y>
+      <x>50</x>
+      <y>210</y>
       <width>81</width>
       <height>26</height>
      </rect>
@@ -184,14 +184,40 @@
      <string>登录账号</string>
     </property>
    </widget>
+   <widget class="QPushButton" name="startTimePushButton">
+    <property name="geometry">
+     <rect>
+      <x>370</x>
+      <y>150</y>
+      <width>81</width>
+      <height>26</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>开始定时</string>
+    </property>
+   </widget>
+   <widget class="QPushButton" name="endTimePushButton">
+    <property name="geometry">
+     <rect>
+      <x>500</x>
+      <y>150</y>
+      <width>81</width>
+      <height>26</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>停止定时</string>
+    </property>
+   </widget>
   </widget>
   <widget class="QMenuBar" name="menubar">
    <property name="geometry">
     <rect>
      <x>0</x>
      <y>0</y>
-     <width>678</width>
-     <height>21</height>
+     <width>631</width>
+     <height>24</height>
     </rect>
    </property>
    <widget class="QMenu" name="menuLittle_Helper">

+ 0 - 0
livepocket/logs/spider-terminal_2024-06-29.log


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 697 - 0
logs/spider-terminal_2024-06-29.log


+ 32 - 1
main.py

@@ -1,9 +1,13 @@
+import ctypes
 import sys
 import os
 from PyQt5.QtCore import Qt, QUrl, QDateTime
 from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel, QFileDialog, QMessageBox, QDateTimeEdit, QPushButton
 from PyQt5.QtGui import QDesktopServices
+
+from app import login_account, run_threading_order
 from litter_helper import Ui_menu  # 确保这个导入路径是正确的
+from tools.utils import save_all_proxy_ip_v3
 
 
 class ClickableLabel(QLabel):
@@ -42,6 +46,8 @@ class MainWindow(QMainWindow, Ui_menu):
 
         # 设置标签的文本为传递的参数
         # self.label.setText(f"参数1: {self.param1}, 参数2: {self.param2}")
+        self.concurrencyLineEdit.setText("1")
+        self.urlLineEdit.setText("https://t.livepocket.jp/e/l3im7")
 
         # 登录账号
         self.loginPushButton.clicked.connect(self.on_login_button_click)
@@ -119,13 +125,38 @@ class MainWindow(QMainWindow, Ui_menu):
             print(f"选中的日期和时间: {date_time_value.toString('yyyy-MM-dd HH:mm:ss')}")
 
         # 获取并发数
+        thread_num = 1
         if self.concurrencyLineEdit:
             print(f"并发数为: {self.concurrencyLineEdit.text()}")
+            thread_num = self.concurrencyLineEdit.text()
+
+        # url
+        net_url = None
+        if self.urlLineEdit:
+            net_url = self.urlLineEdit.text()
+
+        # 下单
+        run_threading_order(thread_num, get_resource_path("accounts.txt"), net_url)
 
     # 登录账号
     def on_login_button_click(self):
         print(f"登录账号! {self.urlLineEdit.text()}")
 
+        thread_num = 1
+        if self.concurrencyLineEdit.text():
+            thread_num = self.concurrencyLineEdit.text()
+
+        pocket_url = None
+        if self.urlLineEdit.text():
+            pocket_url = self.urlLineEdit.text()
+        else:
+            QMessageBox.warning(self, '警告', '请输入URL')
+            return
+
+        save_all_proxy_ip_v3(get_resource_path("proxy_list.txt"))
+
+        login_account(thread_num, get_resource_path("accounts.txt"), pocket_url)
+
     # 终止下单
     def on_stop_button_click(self):
         print(f"终止下单! 目标网址: {self.urlLineEdit.text()}")
@@ -152,4 +183,4 @@ if __name__ == "__main__":
     window = MainWindow("Hello", "World")
     window.show()
 
-    sys.exit(app.exec_())
+    sys.exit(app.exec_())

+ 49 - 0
results/2024-06-29.txt

@@ -0,0 +1,49 @@
+login account:piaop@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20089, token: echrlxw8JFgGx6bAMq6ONYHMLBGzCPkXs9LxmWV6 登录成功!!!
+login account:zhnggg@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20021, token: JsTnOvCuM7eejdjI1izo06AbwwI1WvZzg9YqEPUG 登录成功!!!
+login account:576h0@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20091, token: vfgRoY8dHex8EFT86DCbuQzDcRHu3ZMkSLuH5ooz 登录成功!!!
+login account:mq693@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20031, token: Bjd9tybz3fzdFkUa06hb9mdns2lMqZy0BCm3ttX8 登录成功!!!
+login account:26e4b@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20023, token: lCLBUxHa7wx1Wjd6rELUMcvSkiMBdwlzEQhwoi3y 登录成功!!!
+login account:4l965@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20019, token: XQ67IFDnZiTAwuaF5xWF8jKppUrTcbmgnVtp3TMb 登录成功!!!
+login account:68r90@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20051, token: n8DHezfaKtqGj8236CF89LkjhwIGZKiwNjK2zXlB 登录成功!!!
+login account:7441188@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20015, token: cVHOu5l8xAnJ0Dm08e27OVauDpiABEul5E0QBNqF 登录成功!!!
+login account:7k6o2@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20087, token: H8k3laqE51hXzhhaCWHqaDagUCHJM7ON7tR9QCO8 登录成功!!!
+login account:b73cd@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20010, token: NvNN9dwvcxGRpgn5o8vup9RIbZigsQwCyzaoiURV 登录成功!!!
+login account:aokimomo@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20006, token: W4Ona35z8AZuCDTVuIoYyUNLGJ89cyazrBQ55aYp 登录成功!!!
+login account:wi719@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20011, token: jAj8WCX7tA5I6C2OT0XPzMh6C9FbaEObvXsQ7Gwe 登录成功!!!
+login account:wang@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20019, token: MAC8QFcR2DVaB9Af9bpa9Z9kTuVKB3IZm30eU4Zp 登录成功!!!
+login account:teerwrw@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20084, token: IVQju2QSx8vqerCAFxWKwpLDSN8OHvMXs2FNH4E6 登录成功!!!
+login account:g926m@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20099, token: w715hgiiocPA0KpUeXDw5lxrAS3wv2OvlgFTm06f 登录成功!!!
+login account:9441193@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20065, token: sDqF1QFzRjvjRozZDfP1qbMZF3ymMM6xB8aKsjZg 登录成功!!!
+login account:s4817yos7@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20059, token: iGEqvgBZ7kwjivnFFEf9E51QzVPLP4bYVT56nKpu 登录成功!!!
+login account:satmisauos25@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20090, token: EEC0BZFdft0b9Gvbph6F00nl72cRe8rG3EJcBL3G 登录成功!!!
+login account:sato443jh2@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20019, token: gIhb85nHkX7LEK2o4h7L65LED0mL0V5O8TmpEkDD 登录成功!!!
+login account:yos34@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20002, token: Pe8oYfUT3jt0dld8lrVRQ5waZlbuqLGxsR06gCPS 登录成功!!!
+login account:896h2@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20094, token: SPPgVK8Edx2QgI1Di3J2zRsEgvY6TUYVcjigB3MW 登录成功!!!
+login account:115k@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20025, token: H3IetT1dmxmKN54P0urcBtwjcIg0BnBDtVklFEL2 登录成功!!!
+login account:876h1@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20021, token: xZFmSzFpzeVD4Q8sCRGoWMO55lYDYNnUWuoCVUOp 登录成功!!!
+login account:117k@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20077, token: tm2dibRj6F2NWawk7USYOY2LgEYZ5kJ15BLu1945 登录成功!!!
+login account:yoshinobuyos39@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20029, token: zd00MqLHFff5BYxIIr3Ssae4lUw7zV3aQ3xHvtQ0 登录成功!!!
+login account:116k@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20067, token: r0DjUeMfJ4BVe5UhMlzcre663KiGQQTdxdO9gzkN 登录成功!!!
+login account:samatsueils28@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20098, token: nPbWld1kkjiL2MlkgpgZawiL2Oc8OqUrLT5gK606 登录成功!!!
+login account:119k@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20070, token: KPWnz50irTb01JJ1V5OHuHLFNPxEuACq8CPbNrJA 登录成功!!!
+login account:676h0@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20062, token: QwFxJP4XzY1FDpAF9jebdQKkLBP23WsZUmyX8zLh 登录成功!!!
+login account:sa853yos16@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20028, token: eNeqqC6nvuFfReXjPPSuePOumMOp9YfVoBta918e 登录成功!!!
+login account:sanmieyos27@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20099, token: tSkLbQoIfCKzEtPQ5lzRH8FTMwyflPH7EIo9TMh9 登录成功!!!
+login account:masatoriyos37@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20071, token: i2yBQCL7U08v9Lp3sSXmepmt8vsQtJzLCwbjZybf 登录成功!!!
+login account:hua1111@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20050, token: LNOE5xkZJiSW1fZoO1hnVHGmXb3PZQgXVpoKJBUJ 登录成功!!!
+login account:aoki@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20095, token: OHobvBP5U2RA0500EFTw0H0LMPDA4MNwQsviIvji 登录成功!!!
+login account:wang4@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20069, token: l1rxEb2G2CEYPsbURE6LkVBELbVnCnGs95kL8xNX 登录成功!!!
+login account:1086a@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20089, token: tRAdI80C3xqRb3fK6Zt6oG3HcynaG5HjRL85uQej 登录成功!!!
+login account:sa8721s18@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20047, token: zttary9413j7h4z3qZw8yd2YsDrvFV6Tm3D0rRlN 登录成功!!!
+login account:61f35@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20011, token: jGNfA1lcNXX3XVbA4kL3hwJxUOCRa45utCohwyKT 登录成功!!!
+login account:satoys9@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20031, token: xXgXPWVdy9H3oJPOpjJNCWpslbGI3BmtAr8Er4GC 登录成功!!!
+login account:82y9o@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20038, token: KzI9X3D4olyeUXVUePoTmyVtEDNv3mpBKZWOYfLi 登录成功!!!
+login account:snastoueos26@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20050, token: PWtLDBs54e8VkXQ4Ve2OqOUTsmWHcN44GBgPQoLm 登录成功!!!
+login account:r1xlk@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20094, token: qNtiV2ySvTkgLANlg6Jgrog1xJh6QWVUsZr1qRx4 登录成功!!!
+login account:o4qzc@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20063, token: TnDAi4DTdfVO1iOqQFCG9pMsI0mLIucAjoXEoNBc 登录成功!!!
+login account:nagoziyos38@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20026, token: cQh5ezOTHovrt7nwtnm4K4J17Bp7wlV1mQ7oirT1 登录成功!!!
+login account:118k@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20089, token: HLxYwJvB4h9nuQSRqc7BCxPotwwgQtKymY2oD87j 登录成功!!!
+login account:nylo0@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20065, token: EiWxZM1j4JCllpjiRUG7eMFfRcTNYuVFctq8PsB8 登录成功!!!
+login account:0482z@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20024, token: KrgUE7r721ztzw3n7oHz7EUXWWqrdoJEFw6skrqd 登录成功!!!
+login account:zzzzdf@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20013, token: TAJKwY2XRPeizYyjXppyixgpMAXpkoCkp2hI1tmy 登录成功!!!
+login account:nagoziyos38@huatcn.com, 代理IP:spnelh8q2c:panyue6411802~@gate.dc.visitxiangtan.com:20537, token: cQh5ezOTHovrt7nwtnm4K4J17Bp7wlV1mQ7oirT1 登录成功!!!

BIN
tools/__pycache__/utils.cpython-311.pyc


+ 16 - 0
tools/utils.py

@@ -217,6 +217,22 @@ def save_all_proxy_ip_v2():
             i = i + 1
 
 
+"""
+读取指定proxy_list文件
+"""
+
+
+def save_all_proxy_ip_v3(proxy_file_path):
+    i = 0
+    with open(proxy_file_path, 'r') as proxies:
+        lines = [line.strip() for line in proxies]
+        for single_proxy in lines:
+            print(f'proxy:{single_proxy}')
+            # 存入redis
+            redis_client.set(f'proxy_{str(i)}', single_proxy, 24 * 60 * 60)
+            i = i + 1
+
+
 def get_proxy_poc():
     response = requests.get(
         "https://proxy.webshare.io/api/v2/proxy/list/?page=1&page_size=10",

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác