Hujiarui il y a 2 mois
Parent
commit
21fb14e063

+ 2 - 2
france_visa_registration_bot.py

@@ -172,7 +172,7 @@ class FranceVisaRegistrator:
         
         
     def activate(self, sent_at=None):
     def activate(self, sent_at=None):
         username = self.user_inputs.get('username')
         username = self.user_inputs.get('username')
-        email_box = 'visafly666@gmail.com'
+        email_box = 'hujiarui8@gmail.com'
         sender = 'noreply at interieur.gouv.fr'
         sender = 'noreply at interieur.gouv.fr'
         recipient = username
         recipient = username
         subject_keywords = 'Create your France-Visas account'
         subject_keywords = 'Create your France-Visas account'
@@ -299,7 +299,7 @@ def main():
     }
     }
     capsolver_key = ''
     capsolver_key = ''
     user_inputs = {
     user_inputs = {
-        "username": "ManaliAshokGaikwad26@gmail-app.com",
+        "username": "ManaliAshokGaikwad26@text.skin",
         "first_name": "Manali Ashok",
         "first_name": "Manali Ashok",
         "last_name": "Gaikwad",
         "last_name": "Gaikwad",
         "nationality": "Indian",
         "nationality": "Indian",

+ 1 - 1
plugins/bel_plugin.py

@@ -41,7 +41,7 @@ def to_yyyymmdd(data_str: str, date_str_format: str, target_format: str="%Y-%m-%
     dt = datetime.strptime(data_str, date_str_format)
     dt = datetime.strptime(data_str, date_str_format)
     return dt.strftime("%Y-%m-%d")
     return dt.strftime("%Y-%m-%d")
 
 
-def get_alias_email(email: str, new_domain: str = "gmail-app.com") -> str:
+def get_alias_email(email: str, new_domain: str = "text.skin") -> str:
     if "@" not in email: raise ValueError(f"Invalid email: {email}")
     if "@" not in email: raise ValueError(f"Invalid email: {email}")
     local_part, _ = email.rsplit("@", 1)
     local_part, _ = email.rsplit("@", 1)
     return f"{local_part}@{new_domain}"
     return f"{local_part}@{new_domain}"

+ 1 - 1
plugins/bls_plugin.py

@@ -944,7 +944,7 @@ class BlsPlugin(IVSPlg):
         """
         """
         读取 BLS 的 OTP 邮件
         读取 BLS 的 OTP 邮件
         """
         """
-        master_email = "visafly666@gmail.com"
+        master_email = "hujiarui8@gmail.com"
         recipient = self.config.account.username
         recipient = self.config.account.username
         sender = "Info@blsinternational.com"
         sender = "Info@blsinternational.com"
         subject_keywords = "BLS"
         subject_keywords = "BLS"

+ 3 - 3
plugins/de_plugin.py

@@ -41,7 +41,7 @@ def to_yyyymmdd(data_str: str, date_str_format: str, target_format: str="%Y-%m-%
     dt = datetime.strptime(data_str, date_str_format)
     dt = datetime.strptime(data_str, date_str_format)
     return dt.strftime("%Y-%m-%d")
     return dt.strftime("%Y-%m-%d")
 
 
-def get_alias_email(email: str, new_domain: str = "gmail-app.com") -> str:
+def get_alias_email(email: str, new_domain: str = "text.skin") -> str:
     if "@" not in email: raise ValueError(f"Invalid email: {email}")
     if "@" not in email: raise ValueError(f"Invalid email: {email}")
     local_part, _ = email.rsplit("@", 1)
     local_part, _ = email.rsplit("@", 1)
     return f"{local_part}@{new_domain}"
     return f"{local_part}@{new_domain}"
@@ -317,7 +317,7 @@ class DePlugin(IVSPlg):
         time_slot = self._get_slot_time(target_date)
         time_slot = self._get_slot_time(target_date)
         
         
         # 2. 发送邮件流程
         # 2. 发送邮件流程
-        alias_email = get_alias_email(user_inputs.get("email"), new_domain='gmail-app.com')
+        alias_email = get_alias_email(user_inputs.get("email"), new_domain='text.skin')
         self._send_email_step1(alias_email)
         self._send_email_step1(alias_email)
         self._send_email_step2("0")
         self._send_email_step2("0")
         
         
@@ -441,7 +441,7 @@ class DePlugin(IVSPlg):
         self._perform_request('POST', url, data=payload, headers=headers)
         self._perform_request('POST', url, data=payload, headers=headers)
 
 
     def _read_otp_email(self, recipient) -> str:
     def _read_otp_email(self, recipient) -> str:
-        master_email = "visafly666@gmail.com"
+        master_email = "hujiarui8@gmail.com"
         sender = 'Visametric - verify at visametric.com'
         sender = 'Visametric - verify at visametric.com'
         now_utc = datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S")
         now_utc = datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S")
         for i in range(12):
         for i in range(12):

+ 1 - 1
plugins/pol_plugin.py

@@ -40,7 +40,7 @@ def to_yyyymmdd(data_str: str, date_str_format: str, target_format: str="%Y-%m-%
     dt = datetime.strptime(data_str, date_str_format)
     dt = datetime.strptime(data_str, date_str_format)
     return dt.strftime("%Y-%m-%d")
     return dt.strftime("%Y-%m-%d")
 
 
-def get_alias_email(email: str, new_domain: str = "gmail-app.com") -> str:
+def get_alias_email(email: str, new_domain: str = "text.skin") -> str:
     if "@" not in email: raise ValueError(f"Invalid email: {email}")
     if "@" not in email: raise ValueError(f"Invalid email: {email}")
     local_part, _ = email.rsplit("@", 1)
     local_part, _ = email.rsplit("@", 1)
     return f"{local_part}@{new_domain}"
     return f"{local_part}@{new_domain}"

+ 16 - 28
plugins/vfs_plugin.py

@@ -80,9 +80,9 @@ def to_yyyymmdd(data_str: str, date_str_format: str, target_format: str="%Y-%m-%
     except:
     except:
         return data_str
         return data_str
     
     
-def get_alias_email(email: str, new_domain: str = "gmail-app.com") -> str:
+def get_alias_email(email: str, new_domain: str = "text.skin") -> str:
     """
     """
-    将邮箱域名替换为指定域名(默认 gmail-app.com
+    将邮箱域名替换为指定域名(默认 text.skin
     """
     """
     if "@" not in email:
     if "@" not in email:
         raise ValueError(f"Invalid email: {email}")
         raise ValueError(f"Invalid email: {email}")
@@ -175,17 +175,22 @@ class VfsPlugin(IVSPlg):
             
             
     def keep_alive(self):
     def keep_alive(self):
         try:
         try:
-            applicants = self._get_application()
-            self._log(f'keep_alive request, get applicant resp={applicants}')
-        except:
+            keep_alive_funcs = [
+                self._get_application,
+                self._query_center,
+            ]
+
+            resp = random.choice(keep_alive_funcs)()
+            self._log(f'keep_alive request, resp={resp}')
+        except Exception as e:
             self.is_healthy = False
             self.is_healthy = False
+            self._log(f'keep_alive failed: {e}')
 
 
     def health_check(self) -> bool:
     def health_check(self) -> bool:
         if not self.is_healthy:
         if not self.is_healthy:
             return False
             return False
         if self.page is None:
         if self.page is None:
             return False
             return False
-        # 检查页面是否还活着
         try:
         try:
             if not self.page.run_js("return 1;"):
             if not self.page.run_js("return 1;"):
                 return False
                 return False
@@ -370,8 +375,6 @@ class VfsPlugin(IVSPlg):
                 
                 
         except Exception as e:
         except Exception as e:
             self._log(f"Create Session Failed: {e}")
             self._log(f"Create Session Failed: {e}")
-            time.sleep(3600)
-            self.cleanup()
             raise e
             raise e
 
 
     def query(self, apt_type: AppointmentType) -> VSQueryResult:
     def query(self, apt_type: AppointmentType) -> VSQueryResult:
@@ -533,7 +536,6 @@ class VfsPlugin(IVSPlg):
         策略:尝试点击“接受所有”,如果点不到就直接移除 DOM
         策略:尝试点击“接受所有”,如果点不到就直接移除 DOM
         """
         """
         try:
         try:
-            # 使用 JS 处理最快,且不会因为元素运动报错
             js = """
             js = """
             try {
             try {
                 // 1. 尝试点击 '接受所有' 按钮
                 // 1. 尝试点击 '接受所有' 按钮
@@ -597,8 +599,7 @@ class VfsPlugin(IVSPlg):
             return "0.0.0.0"
             return "0.0.0.0"
 
 
     def _get_common_headers(self, with_auth=True) -> Dict[str, str]:
     def _get_common_headers(self, with_auth=True) -> Dict[str, str]:
-        # DrissionPage 浏览器会自动带上 Origin, Referer, User-Agent, Sec-CH-UA 等
-        # 这里只需要补充业务特定的 Headers
+        # DrissionPage 浏览器会自动带上 Origin, Referer, User-Agent, Sec-CH-UA 等,这里只需要补充业务特定的 Headers
         mission = self.free_config.get("mission_code", "")
         mission = self.free_config.get("mission_code", "")
         country = self.free_config.get("country_code", "")
         country = self.free_config.get("country_code", "")
         lang = self.free_config.get("language", "en")
         lang = self.free_config.get("language", "en")
@@ -719,7 +720,7 @@ class VfsPlugin(IVSPlg):
 
 
     def _read_otp_email(self, sent_at='', sender='VFS Global') -> str:
     def _read_otp_email(self, sent_at='', sender='VFS Global') -> str:
         # 保持原样,这部分使用云API读取邮件,不依赖本地网络库
         # 保持原样,这部分使用云API读取邮件,不依赖本地网络库
-        master_email = "visafly666@gmail.com"
+        master_email = "hujiarui8@gmail.com"
         recipient = self.config.account.username
         recipient = self.config.account.username
         subject_keywords = "One Time Password"
         subject_keywords = "One Time Password"
         body_keywords = "OTP"
         body_keywords = "OTP"
@@ -741,7 +742,6 @@ class VfsPlugin(IVSPlg):
         self._log("Submitting Login OTP...")
         self._log("Submitting Login OTP...")
         
         
         new_cf_token = self._refresh_turnstile_token()
         new_cf_token = self._refresh_turnstile_token()
-        # ---------------------------
 
 
         email = self.config.account.username
         email = self.config.account.username
         password = self.config.account.password
         password = self.config.account.password
@@ -818,7 +818,6 @@ class VfsPlugin(IVSPlg):
                     use_dfs = False
                     use_dfs = False
                     cf_bypasser.click_verification_button(use_dfs)
                     cf_bypasser.click_verification_button(use_dfs)
                 except Exception as e:
                 except Exception as e:
-                    # 点击过程报错不要中断主循环
                     pass
                     pass
         
         
         raise BizLogicError("Failed to refresh Cloudflare Turnstile token (Timeout)")
         raise BizLogicError("Failed to refresh Cloudflare Turnstile token (Timeout)")
@@ -830,7 +829,7 @@ class VfsPlugin(IVSPlg):
         self._log("Starting booking process...")
         self._log("Starting booking process...")
         
         
         user_email = user_inputs.get('email')
         user_email = user_inputs.get('email')
-        user_inputs['alias_email'] = get_alias_email(user_email, new_domain="gmail-app.com")
+        user_inputs['alias_email'] = get_alias_email(user_email, new_domain="text.skin")
         
         
         res = VSBookResult()
         res = VSBookResult()
         app_type = slot_info.apt_type
         app_type = slot_info.apt_type
@@ -1217,7 +1216,6 @@ class VfsPlugin(IVSPlg):
         ads_out = []
         ads_out = []
         if calendars:
         if calendars:
             for item in calendars:
             for item in calendars:
-                # API 返回可能是 MM/DD/YYYY 或 DD/MM/YYYY,VFS 比较乱
                 # 通常是 MM/DD/YYYY
                 # 通常是 MM/DD/YYYY
                 raw = item.get("date")
                 raw = item.get("date")
                 ads_out.append(to_yyyymmdd(raw, "%m/%d/%Y"))
                 ads_out.append(to_yyyymmdd(raw, "%m/%d/%Y"))
@@ -1326,11 +1324,7 @@ class VfsPlugin(IVSPlg):
         
         
         try:
         try:
             self._log("Resolving payment redirect...")
             self._log("Resolving payment redirect...")
-            # 使用新标签页去跑,以免当前会话状态丢失
             pay_tab = self.page.new_tab(start_url)
             pay_tab = self.page.new_tab(start_url)
-            
-            # 等待跳转完成 (通常会跳到 Stripe, WorldPay 或其他支付网关)
-            # 等待直到 URL 不再是 PayRequest
             pay_tab.wait.url_change(start_url, timeout=15)
             pay_tab.wait.url_change(start_url, timeout=15)
             
             
             final_url = pay_tab.url
             final_url = pay_tab.url
@@ -1409,16 +1403,13 @@ class VfsPlugin(IVSPlg):
         """
         """
         销毁浏览器并彻底删除临时文件
         销毁浏览器并彻底删除临时文件
         """
         """
-        # 1. 关闭浏览器
         if self.page:
         if self.page:
             try:
             try:
-                self.page.quit() # 这会关闭 Chrome 进程
+                self.page.quit()
             except Exception:
             except Exception:
-                pass # 忽略已关闭的错误
+                pass
             self.page = None
             self.page = None
         
         
-        # 2. 删除文件
-        # 注意:Chrome 关闭后可能需要几百毫秒释放文件锁,稍微等待
         if os.path.exists(self.root_workspace):
         if os.path.exists(self.root_workspace):
             for _ in range(3):
             for _ in range(3):
                 try:
                 try:
@@ -1426,15 +1417,12 @@ class VfsPlugin(IVSPlg):
                     shutil.rmtree(self.root_workspace, ignore_errors=True)
                     shutil.rmtree(self.root_workspace, ignore_errors=True)
                     break
                     break
                 except Exception as e:
                 except Exception as e:
-                    # 如果删除失败(通常是Windows文件占用),重试
                     self._log(f"Cleanup retry: {e}")
                     self._log(f"Cleanup retry: {e}")
                     time.sleep(0.5)
                     time.sleep(0.5)
             
             
-            # 如果依然存在,打印警告(虽然 ignore_errors=True 会掩盖报错,但可以 check exists)
             if os.path.exists(self.root_workspace):
             if os.path.exists(self.root_workspace):
                  self._log(f"[WARN] Failed to fully remove workspace: {self.root_workspace}")
                  self._log(f"[WARN] Failed to fully remove workspace: {self.root_workspace}")
                  
                  
-        # 3. [新增] 关闭代理隧道
         if self.tunnel:
         if self.tunnel:
             try: self.tunnel.stop()
             try: self.tunnel.stop()
             except: pass
             except: pass

+ 1 - 1
test/tls_standalone.py

@@ -724,7 +724,7 @@ if __name__ == "__main__":
     MY_CONFIG = {
     MY_CONFIG = {
         # 账号信息
         # 账号信息
         "account": {
         "account": {
-            "username": "mayun06@gmail-app.com",
+            "username": "mayun06@text.skin",
             "password": "Visafly@111"
             "password": "Visafly@111"
         },
         },
         # 目标签证中心信息 (例如广州 TLS: cnCNG2fr)
         # 目标签证中心信息 (例如广州 TLS: cnCNG2fr)

+ 5 - 6
tls_registration_bot.py

@@ -10,7 +10,7 @@ import requests
 import argparse
 import argparse
 import concurrent.futures
 import concurrent.futures
 from urllib.parse import urlencode
 from urllib.parse import urlencode
-from datetime import datetime, timedelta
+from datetime import datetime
 from typing import Optional, Dict
 from typing import Optional, Dict
 from DrissionPage.common import Keys
 from DrissionPage.common import Keys
 from DrissionPage import ChromiumPage, ChromiumOptions
 from DrissionPage import ChromiumPage, ChromiumOptions
@@ -19,10 +19,9 @@ import configure
 from utils.cloudflare_bypass_for_scraping import CloudflareBypasser
 from utils.cloudflare_bypass_for_scraping import CloudflareBypasser
 from toolkit.vs_cloud_api import VSCloudApi
 from toolkit.vs_cloud_api import VSCloudApi
 from toolkit.mihomo_tunnel import MihomoTunnel
 from toolkit.mihomo_tunnel import MihomoTunnel
-from vs_types import NotFoundError, PermissionDeniedError, RateLimiteddError, SessionExpiredOrInvalidError, BizLogicError 
+from vs_types import BizLogicError 
 from utils.mouse import HumanMouse
 from utils.mouse import HumanMouse
 from utils.keyboard import HumanKeyboard
 from utils.keyboard import HumanKeyboard
-from utils.scroll import HumanScroll
 from utils.fingerprint_utils import FingerprintGenerator
 from utils.fingerprint_utils import FingerprintGenerator
 from utils.fake_utils import generate_random_account_detail
 from utils.fake_utils import generate_random_account_detail
     
     
@@ -255,7 +254,7 @@ class TlsRegistrator:
     
     
     def activate(self, sent_at=None):
     def activate(self, sent_at=None):
         email = self.account_detail.get('email')
         email = self.account_detail.get('email')
-        email_box = 'visafly666@gmail.com'
+        email_box = 'hujiarui8@gmail.com'
         sender = 'TLSContact'
         sender = 'TLSContact'
         recipient = email
         recipient = email
         subject_keywords = 'TLSContact'
         subject_keywords = 'TLSContact'
@@ -391,7 +390,7 @@ class TlsRegistrator:
 
 
         travel_group = None
         travel_group = None
         for g in groups:
         for g in groups:
-            if g.get('vacName', '').lower() == location.lower():
+            if location in g.get('vacName', ''):
                 travel_group = g
                 travel_group = g
                 break
                 break
         
         
@@ -616,7 +615,7 @@ class TlsRegistrator:
             
             
 def register_worker(proxy_config, tls_url, capsolver_key):
 def register_worker(proxy_config, tls_url, capsolver_key):
     """单个注册任务的工作线程函数"""
     """单个注册任务的工作线程函数"""
-    account_detail = generate_random_account_detail('CN')
+    account_detail = generate_random_account_detail('GB')
     bot = None
     bot = None
     try:
     try:
         bot = TlsRegistrator(
         bot = TlsRegistrator(

+ 2 - 2
utils/fake_utils.py

@@ -110,7 +110,7 @@ def _generate_email(first_name: str, last_name: str) -> str:
     email_prefix = re.sub(r"[^a-z0-9]", "", f"{first_name}{last_name}".lower())
     email_prefix = re.sub(r"[^a-z0-9]", "", f"{first_name}{last_name}".lower())
     if not email_prefix:
     if not email_prefix:
         email_prefix = f"user{random.randint(100000, 999999)}"
         email_prefix = f"user{random.randint(100000, 999999)}"
-    return f"{email_prefix}{random.randint(1000, 9999)}@gmail-app.com"
+    return f"{email_prefix}{random.randint(1000, 9999)}@text.skin"
 
 
 # ==========================================
 # ==========================================
 # 3. 主函数
 # 3. 主函数
@@ -154,7 +154,7 @@ def generate_random_account_detail(country_code: str = "CN") -> Dict[str, Any]:
         "location": config["location"],
         "location": config["location"],
         "visa_type": VISA_TYPE,
         "visa_type": VISA_TYPE,
         "travel_purpose": TRAVEL_PURPOSE,
         "travel_purpose": TRAVEL_PURPOSE,
-        "application_form_id": f"FRA1SH{app_form_suffix}",
+        "application_form_id": f"FRA1LO{app_form_suffix}",
         "last_name": last_name,
         "last_name": last_name,
         "first_name": first_name,
         "first_name": first_name,
         "gender": gender,
         "gender": gender,