3 Commits 61524e77a8 ... 0c1a58d57e

Author SHA1 Message Date
  xubo 0c1a58d57e 存储 account 、token 与 proxy_ip 对应关系 1 year ago
  xubo ddf86ca14b 存储 account 、token 与 proxy_ip 对应关系 1 year ago
  xubo 0e96dd783a 存储 account 、token 与 proxy_ip 对应关系 1 year ago
1 changed files with 9 additions and 3 deletions
  1. 9 3
      app.py

+ 9 - 3
app.py

@@ -102,6 +102,8 @@ def save_account_info(account, passwd, target_url, single_proxy):
                 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)
+                # 存储 account 、token 与 proxy_ip 对应关系
+                redis_client.set(f'proxy_ip_{account}', single_proxy)
 
                 file_writer.write_to_file(f'login account:{account}, 代理IP:{single_proxy}, token: {token} 登录成功!!!')
                 print(f"login account:{account}, 代理IP:{single_proxy}, token: {token} 登录成功!!!")
@@ -112,7 +114,6 @@ def save_account_info(account, passwd, target_url, single_proxy):
                 print(f"login account:{account}, login_session:{login_session}, token: {token} 已经登录!!!")
 
 
-
 def get_ticket(account, passwd, target_url, single_proxy):
     if single_proxy is not None:
         # 开始业务逻辑
@@ -658,7 +659,9 @@ def process_running_manual(max_threads, pocket_url):
 
         threads = []
         for account in account_list:
-            single_proxy = get_proxy_from_file("proxy_list.txt")
+            # single_proxy = get_proxy_from_file("proxy_list.txt")
+            # 从redis 中获取 proxy_ip
+            single_proxy = redis_client.get(f'proxy_ip_{account}')
             print(f"当前账号: {account}, 当前代理:{single_proxy}")
             loggerKit.info(f"当前账号: {account}, 当前代理:{single_proxy}")
 
@@ -741,7 +744,10 @@ def run_threading_order(max_threads, account_path, url):
 
             threads = []
             for account in account_list:
-                single_proxy = get_proxy_from_file("proxy_list.txt")
+                # single_proxy = get_proxy_from_file("proxy_list.txt")
+                # 从redis 中获取 proxy_ip
+                single_proxy = redis_client.get(f'proxy_ip_{account}')
+
                 print(f"当前账号: {account}, 当前代理:{single_proxy}")
                 loggerKit.info(f"当前账号: {account}, 当前代理:{single_proxy}")