Pārlūkot izejas kodu

feat: add support for Prenotami Italy visa plugin and configuration

hujiarui 3 nedēļas atpakaļ
vecāks
revīzija
eba6fca0d8

+ 1 - 0
.gitignore

@@ -89,6 +89,7 @@ docs/italy-refactor
 # Agent
 AGENTS.md
 powershell.cmd
+!scripts/powershell.cmd
 *.yaml
 !config/mihomo_config.yaml
 !config/registry.yaml

+ 5 - 5
README.md

@@ -248,7 +248,7 @@ tester.test_cleanup()
 
 ## France-Visas (法签申请表) 账号全自动注册、填表与 FRA1 提取
 
-Coordinate 提供了法签申请表系统的全流程自动化工具 [`francevisa_keygen.py`](francevisa_keygen.py),支持从 Keycloak 注册、邮箱验证、初始密码设定、登录探针到 Step 1 填表(含中国本土及海外各领区/递签中心,如都柏林、伦敦等)及最终官方 `FRA1` 申请编号的即时提取。
+Coordinate 提供了法签申请表系统的全流程自动化工具 [`keygens/francevisa_keygen.py`](keygens/francevisa_keygen.py),支持从 Keycloak 注册、邮箱验证、初始密码设定、登录探针到 Step 1 填表(含中国本土及海外各领区/递签中心,如都柏林、伦敦等)及最终官方 `FRA1` 申请编号的即时提取。
 
 ### 1. 核心自动化流水线
 
@@ -327,7 +327,7 @@ graph TD
 
 #### 示例 A:国内常规申请(北京 1PE,一键注册+填表+生成 FRA1)
 ```powershell
-python francevisa_keygen.py `
+python keygens/francevisa_keygen.py `
   --email "my_france_01@text.skin" `
   --password "FraVis@2026888!" `
   --first-name "San" `
@@ -339,7 +339,7 @@ python francevisa_keygen.py `
 #### 示例 B:爱尔兰都柏林递签申请(中国护照持有人在都柏林申请申根签)
 > **参数说明**:递签国为 `IRL`,递签城市为 `1DB`,护照签发国为 `CHN`。生成的官方申请号前缀为 `FRA1DB...`。
 ```powershell
-python francevisa_keygen.py `
+python keygens/francevisa_keygen.py `
   --email "my_dublin_01@text.skin" `
   --password "FraVis@2026888!" `
   --first-name "San" `
@@ -373,12 +373,12 @@ purpose: "1"
 ```
 命令行直接加载:
 ```powershell
-python francevisa_keygen.py --config config/france_apply.yaml
+python keygens/francevisa_keygen.py --config config/france_apply.yaml
 ```
 
 #### 示例 D:Python 代码内嵌调用
 ```python
-from francevisa_keygen import FranceVisaKeygen, auto_register
+from keygens.francevisa_keygen import FranceVisaKeygen, auto_register
 
 # 1. 一键全自动注册 + 填表 + 提取 FRA1 申请号
 result = auto_register({

+ 134 - 25
config/config_booker.yaml

@@ -1,43 +1,99 @@
-- id: 28
-  node_id: Jerry Win11 PC
-  identifier: greekemba.ie.gr
-  enable: 1
+- id: 22
+  node_id: jerry_win11_pc
+  identifier: vfs.cn.at
+  enable: 0
   debug: 0
   need_account: 1
   need_proxy: 1
   proxy_pool:
-  - local:local_multi_pool
-  proxy_cd: 0
-  session_max_life: 86400
+  - proxy-cheap
+  proxy_cd: 300
+  session_max_life: 1800
   active_time_start: 00:00
   active_time_end: '23:59'
-  website: https://www.supersaas.com/schedule/GreekEmbassyInDublin/Visas
+  website: https://visa.vfsglobal.com/chn/en/aut/login
   booker:
     account_cd: 10800
     keep_alive: 120
-    account_source: order
-    account_pool_id: dub.gr.tourist
-    booking_cooldown: 30
+    account_source: built-in
+    account_pool_id: cn.at.booker
+    booking_cooldown: 10
     target_instances: 1
-    max_bookings_per_account: 1
+    max_bookings_per_account: 8
   plugin_config:
     lib_path: plugins
-    plugin_bin: grc_plugin.py
-    plugin_name: grc_plugin
+    plugin_bin: vfs_plugin.py
+    plugin_name: vfs_plugin
     plugin_proto: IVSPlg
   appointment_types:
-  - city: Dublin
-    weight: 10
-    country: Greece
+  - city: Beijing
+    weight: 1
+    country: Austria
+    visa_type: Tourist
+    routing_key: slot.bjs.at.tourist
+  - city: Guangzhou
+    weight: 0
+    country: Austria
+    visa_type: Tourist
+    routing_key: slot.can.at.tourist
+  - city: Shenzhen
+    weight: 0
+    country: Austria
+    visa_type: Tourist
+    routing_key: slot.szx.at.tourist
+  - city: Shanghai
+    weight: 1
+    country: Austria
     visa_type: Tourist
-    routing_key: slot.dub.gr.tourist
-  free_config: {}
-  version: 13
+    routing_key: slot.sha.at.tourist
+  free_config:
+    language: en
+    apt_configs:
+      slot.bjs.at.tourist:
+        address: 7/F, GAL Tower, No. 78, Pazhou Avenue, Haizhu District
+        vac_code: Bei
+        center_name: Austria Visa Application Center, Beijing
+        category_code: VTC
+        category_name: Visa Type C-Schengen
+        subcategory_code: TR
+        subcategory_name: Tourism (90 days)
+      slot.can.at.tourist:
+        address: 7/F, GAL Tower, No. 78, Pazhou Avenue, Haizhu District
+        vac_code: Gua
+        center_name: Austria Visa Application Center, Guangzhou
+        category_code: VTC
+        category_name: Visa Type C-Schengen
+        subcategory_code: TR
+        subcategory_name: Tourism (90 days)
+      slot.sha.at.tourist:
+        address: 3F, Jiushi Commercial Building, No. 213, Middle Sichuan Road, Huangpu
+          District
+        vac_code: Shaa
+        center_name: Austria Visa Application Center, Shanghai
+        category_code: TT
+        category_name: Visa Type C - Tourism Visa
+        subcategory_code: VTCT
+        subcategory_name: Visa Type C - Tourism Visa
+      slot.szx.at.tourist:
+        address: Unit 2303, Floor 23, East Tower, C Future City, No. 9285 Binhe Avenue,
+          Futian District
+        vac_code: ASSZA
+        center_name: Austria Visa Application Center, Shenzhen
+        category_code: VTC
+        category_name: Visa Type C-Schengen
+        subcategory_code: TR
+        subcategory_name: Tourism (90 days)
+    country_code: chn
+    country_name: China
+    culture_code: en-US
+    mission_code: aut
+    mission_name: Austria
+  version: 5
   updated_by: 769858626@qq.com
-  created_at: '2026-08-23T15:08:14'
-  updated_at: '2026-09-24T13:18:16'
+  created_at: '2026-08-23T15:08:12'
+  updated_at: '2026-10-06T18:03:08'
 - id: 2
-  node_id: Jerry Win11 PC
+  node_id: jerry_win11_pc
   identifier: vfs.ie.nl
   enable: 0
   debug: 0
@@ -85,7 +141,60 @@
     culture_code: en-US
     mission_code: nld
     mission_name: Netherlands
-  version: 6
+  version: 7
   updated_by: 769858626@qq.com
   created_at: '2026-08-23T15:08:03'
-  updated_at: '2026-09-24T13:17:38'
+  updated_at: '2026-10-01T04:33:11'
+- id: 9
+  node_id: jerry_win11_pc
+  identifier: vfs.ie.dk
+  enable: 0
+  debug: 0
+  need_account: 1
+  need_proxy: 1
+  proxy_pool:
+  - local:local_multi_pool
+  proxy_cd: 300
+  session_max_life: 1800
+  active_time_start: 00:00
+  active_time_end: '23:59'
+  website: https://visa.vfsglobal.com/irl/en/dnk/login
+  booker:
+    account_cd: 10800
+    keep_alive: 120
+    account_source: built-in
+    account_pool_id: ie.dk.booker
+    booking_cooldown: 10
+    target_instances: 1
+    max_bookings_per_account: 8
+  plugin_config:
+    lib_path: plugins
+    plugin_bin: vfs_plugin.py
+    plugin_name: vfs_plugin
+    plugin_proto: IVSPlg
+  appointment_types:
+  - city: Dublin
+    weight: 10
+    country: Denmark
+    visa_type: Tourist
+    routing_key: slot.dub.dk.tourist
+  free_config:
+    language: en
+    apt_configs:
+      slot.dub.dk.tourist:
+        address: Cunningham House, 130 Francis Street, Dublin 8 D08 H48R
+        vac_code: DIDUB
+        center_name: 'Denmark Visa Application Center, Dublin '
+        category_code: SV
+        category_name: Schengen Visa
+        subcategory_code: TV
+        subcategory_name: Tourism
+    country_code: irl
+    country_name: Ireland
+    culture_code: en-US
+    mission_code: dnk
+    mission_name: Denmark
+  version: 7
+  updated_by: 769858626@qq.com
+  created_at: '2026-08-23T15:08:06'
+  updated_at: '2026-10-01T04:33:03'

+ 279 - 6
config/config_sentinel.yaml

@@ -1,7 +1,280 @@
+- id: 26
+  node_id: jerry_win11_pc
+  identifier: pernotami.ie.it
+  enable: 0
+  debug: 0
+  need_account: 1
+  need_proxy: 1
+  proxy_pool:
+  - local:local_multi_pool
+  proxy_cd: 300
+  session_max_life: 7200
+  active_time_start: 00:00
+  active_time_end: '23:59'
+  website: https://prenotami.esteri.it/Home
+  sentinel:
+    account_cd: 86400
+    query_wait:
+      mode: Random
+      random_max: 300
+      random_min: 60
+    signal_ttl: 30
+    account_source: built-in
+    account_pool_id: ie.it.sentinel
+    target_instances: 1
+  plugin_config:
+    lib_path: plugins
+    plugin_bin: ita_plugin.py
+    plugin_name: ita_plugin
+    plugin_proto: IVSPlg
+  appointment_types:
+  - city: Dublin
+    weight: 10
+    country: Italy
+    visa_type: Tourist
+    routing_key: slot.dub.it.tourist
+  free_config:
+    capture:
+      enabled: false
+    website: https://prenotami.esteri.it/
+    otp_mode: cloud
+    query_mode: calendar
+    apt_configs:
+      slot.dub.it.tourist:
+        form:
+          purpose_value: '42'
+          purpose_labels:
+          - Turismo
+          - Tourism
+          additional_fields:
+            Passaporto:
+              kind: file
+              selector: File_0
+              value_from: passport_image_url
+              placeholder: data/mock_passport.pdf
+            Tipo di passaporto:
+              kind: select
+              selector: ddls_4
+              value_from: passport_type
+              placeholder: '3'
+            Numero di passaporto:
+              kind: text
+              selector: DatiAddizionaliPrenotante_1___testo
+              value_from: passport_no
+              placeholder: QUERYONLY
+            Altra/e cittadinanza/e:
+              kind: text
+              selector: DatiAddizionaliPrenotante_5___testo
+              value_from: citizen
+              placeholder: N/A
+            Indirizzo completo di residenza:
+              kind: text
+              selector: DatiAddizionaliPrenotante_3___testo
+              value_from: address
+              placeholder: MOCK ADDRESS DUBLIN
+            Documenti comprovanti la residenza estera:
+              kind: file
+              selector: File_1
+              value_from: residence_proof_url
+              placeholder: data/mock_residence_proof.pdf
+            Data di scadenza del passaporto (dd/mm/yyyy):
+              kind: date
+              selector: DatiAddizionaliPrenotante_2___data
+              value_from: passport_expiry_date
+              placeholder: '2035-01-01'
+          booking_type_value: '1'
+          purpose_control_id: ddls_0
+          booking_type_labels:
+          - Prenotazione Singola
+          - Single booking
+          booking_type_control_id: typeofbookingddl
+        mail:
+          sender: noreply-prenotami at esteri.it
+          authorization_email: hujiarui8@gmail.com
+          authorization_source: configured
+        capability: single_schengen_tourism
+        service_id: 1321
+        calendar_scan:
+          lookahead_months: 12
+    inspection_mode: false
+    final_submit_enabled: false
+  version: 14
+  updated_by: 769858626@qq.com
+  created_at: '2026-08-23T15:08:25'
+  updated_at: '2026-10-24T14:21:26'
+- id: 7
+  node_id: jerry_win11_pc
+  identifier: vfs.ie.at
+  enable: 0
+  debug: 0
+  need_account: 1
+  need_proxy: 1
+  proxy_pool:
+  - local:local_multi_pool
+  proxy_cd: 300
+  session_max_life: 1800
+  active_time_start: 01:00
+  active_time_end: '10:00'
+  website: https://visa.vfsglobal.com/irl/en/aut/login
+  sentinel:
+    account_cd: 10800
+    query_wait:
+      mode: Random
+      fixed_wait: 10
+      random_max: 300
+      random_min: 60
+    signal_ttl: 30
+    account_source: built-in
+    account_pool_id: ie.at.sentinel
+    target_instances: 1
+  plugin_config:
+    lib_path: plugins
+    plugin_bin: vfs_plugin.py
+    plugin_name: vfs_plugin
+    plugin_proto: IVSPlg
+  appointment_types:
+  - city: Dublin
+    weight: 10
+    country: Austria
+    visa_type: Tourist
+    routing_key: slot.dub.at.tourist
+  free_config:
+    language: en
+    apt_configs:
+      slot.dub.at.tourist:
+        address: Cunningham House, 130 Francis Street, Dublin 8 D08 H48R
+        vac_code: AUT-DUB
+        center_name: Austria / Switzerland / Liechtenstein/ Slovenia Visa Application
+          Center, Dublin
+        category_code: 'Default_Austria_Ireland '
+        category_name: Other Visas
+        subcategory_code: TA
+        subcategory_name: 'All Visas '
+    country_code: irl
+    country_name: Ireland
+    culture_code: en-US
+    mission_code: aut
+    mission_name: Austria
+  version: 7
+  updated_by: 769858626@qq.com
+  created_at: '2026-08-23T15:08:18'
+  updated_at: '2026-10-09T13:14:21'
+- id: 1
+  node_id: jerry_win11_pc
+  identifier: vfs.ie.nl
+  enable: 0
+  debug: 0
+  need_account: 1
+  need_proxy: 1
+  proxy_pool:
+  - local:local_multi_pool
+  proxy_cd: 60
+  session_max_life: 1800
+  active_time_start: 01:00
+  active_time_end: '10:00'
+  website: https://visa.vfsglobal.com/irl/en/nld/login
+  sentinel:
+    account_cd: 10800
+    query_wait:
+      mode: Random
+      fixed_wait: 10
+      random_max: 300
+      random_min: 60
+    signal_ttl: 30
+    account_source: built-in
+    account_pool_id: ie.nl.sentinel
+    target_instances: 1
+  plugin_config:
+    lib_path: plugins
+    plugin_bin: vfs_plugin.py
+    plugin_name: vfs_plugin
+    plugin_proto: IVSPlg
+  appointment_types:
+  - city: Dublin
+    weight: 10
+    country: Netherlands
+    visa_type: Tourist
+    routing_key: slot.dub.nl.tourist
+  free_config:
+    language: en
+    apt_configs:
+      slot.dub.nl.tourist:
+        address: Cunningham House, 130 Francis Street, Dublin 8  D08 H48R
+        vac_code: NTDB
+        center_name: Netherlands Visa Application Center - Dublin
+        category_code: TA
+        category_name: All Short stay Categories
+        subcategory_code: To
+        subcategory_name: Tourist
+    country_code: irl
+    country_name: Ireland
+    culture_code: en-US
+    mission_code: nld
+    mission_name: Netherlands
+  version: 14
+  updated_by: 769858626@qq.com
+  created_at: '2026-08-23T15:08:15'
+  updated_at: '2026-10-09T13:14:19'
+- id: 10
+  node_id: jerry_win11_pc
+  identifier: vfs.ie.hu
+  enable: 0
+  debug: 0
+  need_account: 1
+  need_proxy: 1
+  proxy_pool:
+  - local:local_multi_pool
+  proxy_cd: 300
+  session_max_life: 1800
+  active_time_start: 01:00
+  active_time_end: '10:00'
+  website: https://visa.vfsglobal.com/irl/en/hun/login
+  sentinel:
+    account_cd: 10800
+    query_wait:
+      mode: Random
+      fixed_wait: 10
+      random_max: 300
+      random_min: 60
+    signal_ttl: 30
+    account_source: built-in
+    account_pool_id: ie.hu.sentinel
+    target_instances: 1
+  plugin_config:
+    lib_path: plugins
+    plugin_bin: vfs_plugin.py
+    plugin_name: vfs_plugin
+    plugin_proto: IVSPlg
+  appointment_types:
+  - city: Dublin
+    weight: 10
+    country: Hungary
+    visa_type: Tourist
+    routing_key: slot.dub.hu.tourist
+  free_config:
+    language: en
+    apt_configs:
+      slot.dub.hu.tourist:
+        address: Cunningham House, 130 Francis Street Dublin
+        vac_code: DUB
+        center_name: Ireland Visa Application Center,Dublin
+        category_code: SS
+        category_name: Short Stay
+        subcategory_code: Schengen Visa
+        subcategory_name: Schengen Visa
+    country_code: irl
+    country_name: Ireland
+    culture_code: en-US
+    mission_code: hun
+    mission_name: Hungary
+  version: 14
+  updated_by: 769858626@qq.com
+  created_at: '2026-08-23T15:08:19'
+  updated_at: '2026-10-09T13:14:17'
 - id: 8
-  node_id: jerry_macos
+  node_id: jerry_win11_pc
   identifier: vfs.ie.dk
-  enable: 1
+  enable: 0
   debug: 0
   need_account: 1
   need_proxy: 1
@@ -9,8 +282,8 @@
   - local:local_multi_pool
   proxy_cd: 300
   session_max_life: 1800
-  active_time_start: 00:00
-  active_time_end: '23:59'
+  active_time_start: 01:00
+  active_time_end: '10:00'
   website: https://visa.vfsglobal.com/irl/en/dnk/login
   sentinel:
     account_cd: 10800
@@ -50,7 +323,7 @@
     culture_code: en-US
     mission_code: dnk
     mission_name: Denmark
-  version: 7
+  version: 10
   updated_by: 769858626@qq.com
   created_at: '2026-08-23T15:08:18'
-  updated_at: '2026-10-03T18:18:47'
+  updated_at: '2026-10-09T13:14:16'

+ 262 - 167
config/config_standalone.yaml

@@ -1,241 +1,336 @@
-- id: 3
-  node_id: yecaoyun
+- id: 1
+  node_id: jerry_win11_pc
   order_id: null
-  identifier: vfs
+  identifier: tls
   enable: 0
   debug: 1
+  plugin_config:
+    lib_path: plugins
+    plugin_bin: tls_plugin.py
+    plugin_name: tls_plugin
+    plugin_proto: IVSPlg
+  account:
+    password: Abc147258??
+    username: m18757101988@163.com
+  proxy_pool:
+  - local:local_multi_pool
+  query_wait:
+    mode: Random
+    fixed_wait: 10
+    random_max: 65
+    random_min: 55
+  login_interval: 1800
+  session_max_life: 7200
+  active_time_start: 00:00
+  active_time_end: '23:59'
+  appointment_types:
+  - city: Hangzhou
+    weight: 10
+    country: France
+    visa_type: Tourist
+    routing_key: slot.hgh.fr.tourist
+  user_preferences:
+    support_pta: false
+    expected_end_date: '2026-10-14'
+    expected_start_date: '2026-10-20'
+  free_config:
+    tls_url: https://visas-fr.tlscontact.com/en-us/country/cn/vac/cnHGH2fr
+    location: Hangzhou
+    capsolver_key: CAP-5441DD341DD3CC2FAEF0BE6FE493EE9A
+    login_captcha:
+      task: ReCaptchaV2TaskProxyLess
+      page_url: https://i2-auth.visas-fr.tlscontact.com
+      site_key: 6LcDpXcfAAAAAM7wOEsF_38DNsL20tTvPTKxpyn0
+      solve_advance: false
+  version: 13
+  updated_by: 769858626@qq.com
+  created_at: '2026-08-23T15:08:27'
+  updated_at: '2026-10-14T02:44:19'
+- id: 7
+  node_id: jerry_win11_pc
+  order_id: ''
+  identifier: std.vfs.gb.nl
+  enable: 0
+  debug: 0
   plugin_config:
     lib_path: plugins
     plugin_bin: vfs_plugin.py
     plugin_name: vfs_plugin
-    plugin_proto: IPlugin
+    plugin_class: VfsPlugin
+    plugin_proto: IVSPlg
   account:
     password: Visafly@111
-    username: italyvisa888@text.skin
+    username: gb_nl_1234@text.skin
   proxy_pool:
-  - cloud:proxy-cheap
+  - local:local_multi_pool
   query_wait:
     mode: Random
-    fixed_wait: 10
-    random_max: 180
-    random_min: 120
-  login_interval: 7200
+    random_max: 300
+    random_min: 60
+  login_interval: 3600
   session_max_life: 1800
   active_time_start: 00:00
-  active_time_end: '23:30'
+  active_time_end: '23:59'
   appointment_types:
-  - city: Changsha
-    weight: 0
-    country: Italy
-    visa_type: Tourist
-    routing_key: slot.csx.it.tourist
-  - city: Beijing
-    weight: 10
-    country: Italy
+  - city: London
+    weight: 50
+    country: Netherlands
     visa_type: Tourist
-    routing_key: slot.bjs.it.tourist
+    routing_key: slot.lon.nl.tourist
   user_preferences:
-    email: italyvisa666@text.skin
-    phone: 019074224604
+    email: yiqinghersy@gmail.com
+    phone: '7922623741'
     gender: female
-    birthday: '1997-09-09'
-    last_name: ZHAO
-    first_name: LINJIE
+    birthday: '1998-10-27'
+    last_name: he
+    first_name: yiqing
     nationality: China
-    passport_no: EE4571001
-    expected_end_date: '2026-07-03'
-    passport_image_url: data/passport.jpg
-    phone_country_code: '86'
-    expected_start_date: '2026-06-12'
-    passport_expiry_date: '2028-10-08'
-    social_media_account: '13370148298'
+    passport_no: EJ3538366
+    expected_end_date: '2026-11-16'
+    phone_country_code: '44'
+    expected_start_date: '2026-10-12'
+    passport_expiry_date: '2030-07-07'
+    social_media_account: ''
   free_config:
     language: en
     apt_configs:
-      slot.bjs.it.tourist:
-        address: East 101, Floor B1, Block C, Guanghua Lu SOHO II, No. 9 Guanghua
-          Lu, Chaoyang District
-        vac_code: BJII
-        center_name: Italy Visa Application Center, Beijing
-        category_code: Beijing Italy
-        category_name: Beijing Italy
-        subcategory_code: BJ Italy Standard
-        subcategory_name: Standard Beijing Italy
-      slot.csx.it.tourist:
-        address: 1F, Changsha Rongchuang Steigenberger Hotel, No. 3-9, Xueyuan Road,
-          Changsha County, Changsha City
-        vac_code: CGA
-        center_name: Italy Visa Application Center, Changsha
+      slot.lon.nl.tourist:
+        address: 66 Wilson Street, EC2A 2BT
+        vac_code: NAKN
+        center_name: Netherlands Visa application centre - London
         category_code: Schengen Visa
-        category_name: SchengenVisa
-        subcategory_code: 'Schengen '
-        subcategory_name: C visa / Schengen visa
-    country_code: chn
-    country_name: China
+        category_name: Schengen Visa
+        subcategory_code: TA
+        subcategory_name: Tourism
+      slot.man.nl.tourist:
+        address: 50 Devonshire Street North, M12 6JH
+        vac_code: NAKT
+        center_name: Netherlands Visa application centre - Manchester
+        category_code: Schengen Visa
+        category_name: Schengen Visa
+        subcategory_code: TA
+        subcategory_name: Tourism
+    country_code: gbr
+    country_name: United Kingdom
     culture_code: en-US
-    mission_code: ita
-    mission_name: Italy
-  version: 3
+    mission_code: nld
+    mission_name: Netherland
+  version: 7
   updated_by: 769858626@qq.com
-  created_at: '2026-08-23T15:08:28'
-  updated_at: '2026-08-24T13:50:12'
-- id: 1
-  node_id: yecaoyun
+  created_at: '2026-10-10T15:03:58'
+  updated_at: '2026-10-10T15:35:02'
+- id: 6
+  node_id: jerry_win11_pc
   order_id: null
-  identifier: tls
+  identifier: vfs.ie.hu
   enable: 0
   debug: 1
   plugin_config:
     lib_path: plugins
-    plugin_bin: tls_plugin.py
-    plugin_name: tls_plugin
-    plugin_proto: IPlugin
+    plugin_bin: vfs_plugin.py
+    plugin_name: vfs_plugin
+    plugin_proto: IVSPlg
   account:
-    password: Zhangww@201207
-    username: 18305503085@163.com
+    password: P0RU$ya4qX8w
+    username: ie_hu_87zpy1@text.skin
   proxy_pool:
-  - cloud:proxy-cheap
+  - local:local_multi_pool
   query_wait:
     mode: Random
     fixed_wait: 10
-    random_max: 65
-    random_min: 55
-  login_interval: 1800
-  session_max_life: 3600
-  active_time_start: 00:00
-  active_time_end: '23:30'
+    random_max: 180
+    random_min: 120
+  login_interval: 3600
+  session_max_life: 1800
+  active_time_start: 01:00
+  active_time_end: '10:00'
   appointment_types:
-  - city: Shanghai
+  - city: Dublin
     weight: 10
-    country: France
+    country: Hungary
     visa_type: Tourist
-    routing_key: slot.sha.fr.tourist
+    routing_key: slot.dub.hu.tourist
   user_preferences:
-    support_pta: false
-    expected_end_date: '2024-07-01'
-    expected_start_date: '2024-07-20'
+    email: minghanma20@gmail.com
+    phone: 0870393346
+    gender: female
+    birthday: '2000-02-29'
+    last_name: Ma
+    first_name: Minghan
+    nationality: China
+    passport_no: EH0519585
+    expected_end_date: '2026-10-02'
+    phone_country_code: '353'
+    expected_start_date: '2026-09-28'
+    passport_expiry_date: '2029-08-18'
   free_config:
-    tls_url: https://visas-fr.tlscontact.com/en-us/country/cn/vac/cnSHA2fr
-    location: Shanghai
-    capsolver_key: CAP-5441DD341DD3CC2FAEF0BE6FE493EE9A
-    login_captcha:
-      task: ReCaptchaV2TaskProxyLess
-      page_url: https://i2-auth.visas-fr.tlscontact.com
-      site_key: 6LcDpXcfAAAAAM7wOEsF_38DNsL20tTvPTKxpyn0
-      solve_advance: false
-  version: 2
+    language: en
+    apt_configs:
+      slot.dub.hu.tourist:
+        address: Cunningham House, 130 Francis Street Dublin
+        vac_code: DUB
+        center_name: Ireland Visa Application Center,Dublin
+        category_code: SS
+        category_name: Short Stay
+        subcategory_code: Schengen Visa
+        subcategory_name: Schengen Visa
+    country_code: irl
+    country_name: Ireland
+    culture_code: en-US
+    mission_code: hun
+    mission_name: Hungary
+  version: 16
   updated_by: 769858626@qq.com
-  created_at: '2026-08-23T15:08:27'
-  updated_at: '2026-08-23T16:16:43'
-- id: 2
-  node_id: yecaoyun
+  created_at: '2026-08-23T15:08:28'
+  updated_at: '2026-10-10T01:05:54'
+- id: 4
+  node_id: jerry_win11_pc
   order_id: null
-  identifier: usa
+  identifier: vfs.ie.nl
   enable: 0
   debug: 1
   plugin_config:
     lib_path: plugins
-    plugin_bin: usa_plugin.py
-    plugin_name: usa_plugin
-    plugin_proto: IPlugin
+    plugin_bin: vfs_plugin.py
+    plugin_name: vfs_plugin
+    plugin_proto: IVSPlg
   account:
-    password: Zl265498
-    username: Max0105888
+    password: '#XsLPZK5t1mN'
+    username: ie_nl_rj12u7@text.skin
   proxy_pool:
-  - cloud:proxy-cheap
+  - local:local_multi_pool
   query_wait:
     mode: Random
     fixed_wait: 10
-    random_max: 600
-    random_min: 60
+    random_max: 180
+    random_min: 120
   login_interval: 3600
-  session_max_life: 3600
-  active_time_start: 00:00
-  active_time_end: '23:30'
+  session_max_life: 1800
+  active_time_start: 01:00
+  active_time_end: '10:00'
   appointment_types:
-  - city: Wuhan
+  - city: Dublin
     weight: 10
-    country: USA
+    country: Netherlands
     visa_type: Tourist
-    routing_key: slot.wuh.us.tourist
+    routing_key: slot.dub.nl.tourist
   user_preferences:
-    expected_date_end: '2026-08-05'
-    expected_date_start: '2026-06-01'
+    email: ofodilenodebe@gmail.com
+    phone: 0834318190
+    gender: female
+    birthday: '2000-12-18'
+    last_name: CHIBO OFODILE
+    first_name: CHINODEBEM
+    nationality: Nigeria
+    passport_no: B01478864
+    _admin_bypass:
+      at: '2026-09-17T15:13:48.511032'
+      by: usr-c1f46c54
+      reason: admin manual order
+      enabled: true
+    expected_end_date: '2026-11-17'
+    phone_country_code: '353'
+    expected_start_date: '2026-09-17'
+    passport_expiry_date: '2027-12-19'
+    social_media_account: 淘宝黄牛
   free_config:
-    usa_url: https://www.usvisascheduling.com
-    location: WUHAN
-    security:
-      1_quest:
-        a: zhou
-        q: What is your mother's surname?
-      2_quest:
-        a: kfc
-        q: What is your least favorite food?
-      3_quest:
-        a: '123456'
-        q: Who was your childhood hero?
-    applicant: jinhao ma
-  version: 2
+    language: en
+    apt_configs:
+      slot.dub.nl.tourist:
+        address: Cunningham House, 130 Francis Street, Dublin 8  D08 H48R
+        vac_code: NTDB
+        center_name: Netherlands Visa Application Center - Dublin
+        category_code: TA
+        category_name: All Short stay Categories
+        subcategory_code: To
+        subcategory_name: Tourist
+    country_code: irl
+    country_name: Ireland
+    culture_code: en-US
+    mission_code: nld
+    mission_name: Netherlands
+  version: 12
   updated_by: 769858626@qq.com
-  created_at: '2026-08-23T15:08:27'
-  updated_at: '2026-08-23T16:16:36'
-- id: 4
-  node_id: yecaoyun
+  created_at: '2026-08-23T15:08:28'
+  updated_at: '2026-10-08T14:54:10'
+- id: 3
+  node_id: jerry_win11_pc
   order_id: null
-  identifier: de.dublin
-  enable: 1
+  identifier: vfs.cn.it
+  enable: 0
   debug: 1
   plugin_config:
     lib_path: plugins
-    plugin_bin: de_plugin.py
-    plugin_name: de_plugin
-    plugin_proto: IPlugin
+    plugin_bin: vfs_plugin.py
+    plugin_name: vfs_plugin
+    plugin_proto: IVSPlg
   account:
-    username: guest
-    password: ''
+    password: Visafly@111
+    username: italyvisa888@text.skin
   proxy_pool:
-  - local:local_de
+  - proxy-cheap
   query_wait:
     mode: Random
     fixed_wait: 10
-    random_max: 10
-    random_min: 10
-  login_interval: 3600
+    random_max: 180
+    random_min: 120
+  login_interval: 7200
   session_max_life: 1800
-  active_time_start: 00:00
-  active_time_end: '23:59'
+  active_time_start: 01:00
+  active_time_end: '10:00'
   appointment_types:
-  - city: Dublin
+  - city: Changsha
+    weight: 0
+    country: Italy
+    visa_type: Tourist
+    routing_key: slot.csx.it.tourist
+  - city: Beijing
     weight: 10
-    country: Germany
+    country: Italy
     visa_type: Tourist
-    routing_key: slot.dub.de.tourist
+    routing_key: slot.bjs.it.tourist
   user_preferences:
-    first_name: Jingyi
-    last_name: Yang
-    passport_no: EJ1897974
-    passport_expiry_date: '2033-01-03'
-    birthday: '2005-04-26'
-    travel_date: '2027-01-25'
-    email: jingyiyang@riam.ie
-    phone_no: '+353876193877'
-    expected_start_date: '2026-10-01'
-    expected_end_date: '2026-12-31'
+    email: italyvisa666@text.skin
+    phone: 019074224604
+    gender: female
+    birthday: '1997-09-09'
+    last_name: ZHAO
+    first_name: LINJIE
+    nationality: China
+    passport_no: EE4571001
+    expected_end_date: '2026-07-03'
+    passport_image_url: data/passport.jpg
+    phone_country_code: '86'
+    expected_start_date: '2026-06-12'
+    passport_expiry_date: '2028-10-08'
+    social_media_account: '13370148298'
   free_config:
-    base_url: https://ie-appointment.visametric.com
-    consularid: 1
-    city: 6
-    office: 1
-    officetype: 1
-    service_type_id: 1
-    language_id: 2
-    view_set_app_country: Schengen - Tourism/Family&Friend Visit/Transit Visa/Other
-      Purposes
-    view_set_app_office: Dublin
-    view_set_app_service_type: NORMAL
-    nationality: 2
-    use_alias_email: true
-  version: 1
+    language: en
+    apt_configs:
+      slot.bjs.it.tourist:
+        address: East 101, Floor B1, Block C, Guanghua Lu SOHO II, No. 9 Guanghua
+          Lu, Chaoyang District
+        vac_code: BJII
+        center_name: Italy Visa Application Center, Beijing
+        category_code: Beijing Italy
+        category_name: Beijing Italy
+        subcategory_code: BJ Italy Standard
+        subcategory_name: Standard Beijing Italy
+      slot.csx.it.tourist:
+        address: 1F, Changsha Rongchuang Steigenberger Hotel, No. 3-9, Xueyuan Road,
+          Changsha County, Changsha City
+        vac_code: CGA
+        center_name: Italy Visa Application Center, Changsha
+        category_code: Schengen Visa
+        category_name: SchengenVisa
+        subcategory_code: 'Schengen '
+        subcategory_name: C visa / Schengen visa
+    country_code: chn
+    country_name: China
+    culture_code: en-US
+    mission_code: ita
+    mission_name: Italy
+  version: 5
   updated_by: 769858626@qq.com
-  created_at: '2026-09-20T22:30:00'
-  updated_at: '2026-09-20T22:30:00'
+  created_at: '2026-08-23T15:08:28'
+  updated_at: '2026-10-08T14:54:07'

+ 1 - 1
config/mihomo_config.yaml

@@ -1,5 +1,5 @@
 mixed-port: 16000
-allow-lan: false
+allow-lan: true
 mode: rule
 log-level: info
 ipv6: false

+ 4 - 4
docker-compose.yml

@@ -56,7 +56,7 @@ services:
       - CHROME_BIN=/opt/ungoogled-chromium/chrome
       - MIHOMO_BIN=/bin/mihomo
       - PROXY_HOST=proxy
-      - NODE_ID=${NODE_ID:-testnode}
+      - NODE_ID=${NODE_ID:-jerry_win11_pc}
     deploy:
       resources:
         limits:
@@ -85,7 +85,7 @@ services:
       - CHROME_BIN=/opt/ungoogled-chromium/chrome
       - MIHOMO_BIN=/bin/mihomo
       - PROXY_HOST=proxy
-      - NODE_ID=${NODE_ID:-testnode}
+      - NODE_ID=${NODE_ID:-jerry_win11_pc}
     deploy:
       resources:
         limits:
@@ -114,7 +114,7 @@ services:
       - CHROME_BIN=/opt/ungoogled-chromium/chrome
       - MIHOMO_BIN=/bin/mihomo
       - PROXY_HOST=proxy
-      - NODE_ID=${NODE_ID:-testnode}
+      - NODE_ID=${NODE_ID:-jerry_win11_pc}
     deploy:
       resources:
         limits:
@@ -133,7 +133,7 @@ services:
       - ./logs:/app/logs
     environment:
       - TZ=Asia/Shanghai
-      - NODE_ID=${NODE_ID:-testnode}
+      - NODE_ID=${NODE_ID:-jerry_win11_pc}
     deploy:
       resources:
         limits:

+ 1 - 0
keygens/__init__.py

@@ -0,0 +1 @@
+"""Visa registration and application tools."""

+ 6 - 1
francevisa_keygen.py → keygens/francevisa_keygen.py

@@ -20,6 +20,12 @@ Authentication Realm: Keycloak Usager (https://connect.france-visas.gouv.fr/real
 import os
 import re
 import sys
+
+# Allow direct execution from either the project root or this directory.
+ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+if ROOT_DIR not in sys.path:
+    sys.path.insert(0, ROOT_DIR)
+
 import json
 import time
 import uuid
@@ -33,7 +39,6 @@ from datetime import datetime, timezone, timedelta
 from typing import Optional, Dict, Any, List, Tuple, Union
 from urllib.parse import urljoin, urlparse, parse_qs, unquote
 
-ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
 
 # 解决 Windows GBK 终端乱码问题
 if sys.platform == "win32":

+ 865 - 0
keygens/ita_keygen.py

@@ -0,0 +1,865 @@
+#!/usr/bin/env python3
+"""
+keygens/ita_keygen.py
+意大利 Prenot@Mi (https://prenotami.esteri.it/) 自动注册机器人。
+功能:
+1. 自动生成爱尔兰都柏林本地化人设与 @text.skin 邮箱凭据;
+2. 驱动 Chromium 浏览器打开 https://prenotami.esteri.it/Account/Register;
+3. 自动关闭引导弹窗,填入 14 项完整表单字段,包括密码前端加密与下拉映射;
+4. 自动等待并穿透 Cloudflare Turnstile 人机验证盾;
+5. 提交表单并等待跳转至 /Account/SentEmail;
+6. 调用云端邮件接口轮询激活邮件,提取 ConfirmEmail 链接并在浏览器中打开完成激活;
+7. 激活成功后自动上报账号到云端账号池(默认 ie.it.sentinel)。
+使用方法:
+    .venv/bin/python keygens/ita_keygen.py --dry-run             # 仅填表与盾测试,不最终提交
+    .venv/bin/python keygens/ita_keygen.py --target 1           # 真实注册 1 个账号并入库
+    .venv/bin/python keygens/ita_keygen.py --target 5           # 批量注册 5 个账号
+"""
+import os
+import sys
+import re
+import json
+import time
+import random
+import string
+import logging
+import argparse
+import requests
+import uuid
+import shutil
+from datetime import datetime, timezone, timedelta
+
+# 切换项目根路径
+PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+if PROJECT_ROOT not in sys.path:
+    sys.path.insert(0, PROJECT_ROOT)
+from DrissionPage import ChromiumPage
+from DrissionPage.errors import PageDisconnectedError, AlertExistsError
+from utils.plugin_utils import init_chromium_options, get_free_port
+from utils.cloudflare_bypass_for_scraping import CloudflareBypasser
+from utils.mouse import HumanMouse
+from utils.keyboard import HumanKeyboard
+from core_types import Proxy
+logging.basicConfig(
+    level=logging.INFO,
+    format='%(asctime)s [%(levelname)s] %(message)s',
+    datefmt='%H:%M:%S'
+)
+logger = logging.getLogger("ItaRegistrar")
+# 常量配置
+HOME_URL = "https://prenotami.esteri.it/"
+REGISTER_URL = "https://prenotami.esteri.it/Account/Register"
+DEFAULT_POOL_NAME = "ie.it.sentinel"
+DEFAULT_MASTER_EMAIL = "hujiarui8@gmail.com"
+DEFAULT_UPLOAD_URL = "https://api.text.skin/api/account/add"
+DEFAULT_UPLOAD_TOKEN = "tok_e946329a60ff45ba807f3f41b0e8b7fc"
+DEFAULT_EMAIL_FETCH_URL = "https://api.text.skin/api/email-authorizations/fetch"
+DEFAULT_ADDRESS_FILE = os.path.join(PROJECT_ROOT, "data", "random-ireland-address-2026-09-22.json")
+EMAIL_SENDER = "noreply-prenotami at esteri.it"
+
+# 爱尔兰本土常见名库(男女合集)
+IRISH_FIRST_NAMES = [
+    "Cillian", "Aoife", "Conor", "Saoirse", "Liam", "Niamh", "Fionn", "Ciara",
+    "Sean", "Roisin", "Eoin", "Orla", "Oisin", "Maeve", "Patrick", "Darragh",
+    "Cian", "Siobhan", "Ronan", "Aisling", "Tadhg", "Clodagh", "Cathal", "Sinead",
+    "Cormac", "Fiona", "Niall", "Grainne", "Colm", "Deirdre", "Brian", "Emer",
+    "Aidan", "Sorcha", "Caoimhe", "Padraig", "Daithi", "Donnacha", "Rory", "Finbar"
+]
+# 爱尔兰本土常见姓氏库
+IRISH_LAST_NAMES = [
+    "Murphy", "Kelly", "OBrien", "Walsh", "Smith", "ONeill", "Gallagher",
+    "Doyle", "McCarthy", "Byrne", "Ryan", "Quinn", "Lynch", "Brennan",
+    "Daly", "Nolan", "Connolly", "Higgins", "Flynn", "Kavanagh", "Cullen",
+    "Connors", "Dunne", "Kennedy", "Maguire", "Maher", "Sweeney", "Farrell",
+    "OConnor", "ODwyer", "OShea", "Keane", "Power", "Fitzgerald", "Brady"
+]
+# 爱尔兰本土主要城镇/出生地
+IRISH_BIRTH_PLACES = [
+    "Dublin", "Cork", "Galway", "Limerick", "Waterford", "Drogheda",
+    "Dundalk", "Swords", "Bray", "Navan", "Kilkenny", "Ennis", "Carlow",
+    "Tralee", "Newbridge", "Portlaoise", "Athlone", "Mullingar", "Wexford",
+    "Sligo", "Clonmel", "Letterkenny", "Killarney", "Castlebar", "Tullamore"
+]
+# 备用爱尔兰常用街道(当 JSON 地址耗尽或不存在时动态生成不重复地址)
+BACKUP_STREETS = [
+    "Grafton Street", "O'Connell Street", "Henry Street", "Dame Street",
+    "Dawson Street", "Kildare Street", "Baggot Street", "Leeson Street",
+    "Patrick Street", "Oliver Plunkett Street", "Shop Street", "Eyre Square",
+    "O'Connell Avenue", "George's Street", "The Quay", "Main Street",
+    "Church Street", "High Street", "Castle Street", "Market Square"
+]
+BACKUP_CITIES_POSTCODES = [
+    ("Dublin", "D02"), ("Dublin", "D01"), ("Dublin", "D04"), ("Dublin", "D08"),
+    ("Cork", "T12"), ("Galway", "H91"), ("Limerick", "V94"), ("Waterford", "X91")
+]
+
+class ItaRegistrationBot:
+    def __init__(self, args):
+        self.args = args
+        self.page = None
+        self.tunnel = None
+        self.workspace = os.path.join(PROJECT_ROOT, "data", "temp_reg_browser")
+        # 去重追踪集合
+        self.used_emails = set()
+        self.used_passwords = set()
+        self.used_phones = set()
+        self.used_addresses = set()
+        # 加载外部地址池
+        self.address_pool = self._load_address_pool()
+    
+    def _log(self, msg: str):
+        logger.info(f"[ItaBot] {msg}")
+    
+    def _load_address_pool(self) -> list:
+        """加载提供的 JSON 地址文件"""
+        addr_file = getattr(self.args, "address_file", DEFAULT_ADDRESS_FILE)
+        pool = []
+        if os.path.exists(addr_file):
+            try:
+                with open(addr_file, "r", encoding="utf-8") as f:
+                    raw_data = json.load(f)
+                    if isinstance(raw_data, list):
+                        for item in raw_data:
+                            street = item.get("streetAddress") or item.get("address")
+                            city = item.get("city") or "Dublin"
+                            cap = item.get("postcode") or item.get("cap") or "D02 YF90"
+                            dob = item.get("dateOfBirth")
+                            if street:
+                                pool.append({
+                                    "street": street,
+                                    "city": city,
+                                    "cap": cap,
+                                    "dob": dob
+                                })
+                self._log(f"Loaded {len(pool)} addresses from {os.path.basename(addr_file)}")
+            except Exception as e:
+                self._log(f"Failed to load address file {addr_file}: {e}")
+        else:
+            self._log(f"Address file {addr_file} not found, will use dynamic generator.")
+        random.shuffle(pool)
+        return pool
+
+    def _get_unique_address(self) -> tuple:
+        """获取一个唯一的爱尔兰地址 (street, city, cap, optional_dob)"""
+        # 1. 优先从加载的 JSON 地址池中消耗
+        while self.address_pool:
+            item = self.address_pool.pop(0)
+            key = f"{item['street']}|{item['city']}|{item['cap']}".lower()
+            if key not in self.used_addresses:
+                self.used_addresses.add(key)
+                return item['street'], item['city'], item['cap'], item.get('dob')
+        # 2. 地址池耗尽或不存在时,生成动态且不重复的真实爱尔兰地址
+        for _ in range(100):
+            num = random.randint(1, 380)
+            street_name = random.choice(BACKUP_STREETS)
+            street = f"{num} {street_name}"
+            city, prefix = random.choice(BACKUP_CITIES_POSTCODES)
+            eir_suffix = "".join(random.choices(string.ascii_uppercase + string.digits, k=4))
+            cap = f"{prefix} {eir_suffix}"
+            key = f"{street}|{city}|{cap}".lower()
+            if key not in self.used_addresses:
+                self.used_addresses.add(key)
+                return street, city, cap, None
+        # 兜底保底
+        rand_id = "".join(random.choices(string.digits, k=4))
+        return f"{rand_id} Grafton Street", "Dublin", "D02 YF90", None
+
+
+    def _generate_unique_password(self) -> str:
+        """
+        生成严格满足 Prenot@Mi 规范的高强度且不重复的密码:
+        8-20 位,至少包含大写、小写、数字、特殊符号
+        """
+        for _ in range(100):
+            uppers = "".join(random.choices(string.ascii_uppercase, k=2))
+            lowers = "".join(random.choices(string.ascii_lowercase, k=6))
+            digits = "".join(random.choices(string.digits, k=3))
+            symbol = random.choice(["!", "@", "#", "$", "%", "*"])
+            chars = list(uppers + lowers + digits + symbol)
+            random.shuffle(chars)
+            pwd = "".join(chars)
+            if pwd not in self.used_passwords:
+                self.used_passwords.add(pwd)
+                return pwd
+        return f"ItaPass@{random.randint(1000, 9999)}!"
+
+    def _generate_unique_phone(self) -> str:
+        """随机生成合法且不重复的爱尔兰手机号(9位:83/85/86/87/89开头)"""
+        for _ in range(100):
+            mobile_prefix = random.choice(["83", "85", "86", "87", "89"])
+            suffix = "".join(random.choices(string.digits, k=7))
+            phone = f"{mobile_prefix}{suffix}"
+            if phone not in self.used_phones:
+                self.used_phones.add(phone)
+                return phone
+        return f"85{random.randint(1000000, 9999999)}"
+
+    def _generate_birth_date(self, dob_candidate: str = None) -> str:
+        """生成确保年龄 > 20 岁的生日(格式:dd/mm/yyyy)"""
+        if dob_candidate:
+            # 尝试转换 YYYY-MM-DD 为 dd/mm/yyyy
+            try:
+                parts = dob_candidate.strip().split("-")
+                if len(parts) == 3:
+                    y, m, d = int(parts[0]), int(parts[1]), int(parts[2])
+                    # 确保当前年份(2026)时年龄 > 20(出生年 <= 2005)
+                    if y <= 2005:
+                        return f"{d:02d}/{m:02d}/{y}"
+            except Exception:
+                pass
+        # 随机出生年(1972 - 2004,确保当前年龄在 22 到 54 岁之间)
+        year = random.randint(1972, 2004)
+        month = random.randint(1, 12)
+        day = random.randint(1, 28)
+        return f"{day:02d}/{month:02d}/{year}"
+
+    def generate_account_profile(self) -> dict:
+        """生成全面满足本土化、年龄>20、地址不重复、密码不重复、随机手机号的账号数据"""
+        first_name = random.choice(IRISH_FIRST_NAMES)
+        last_name = random.choice(IRISH_LAST_NAMES)
+        birth_place = random.choice(IRISH_BIRTH_PLACES)
+        # 确保邮箱唯一且与姓名契合
+        clean_first = re.sub(r"[^a-z0-9]", "", first_name.lower())
+        clean_last = re.sub(r"[^a-z0-9]", "", last_name.lower())
+        rand_num = random.randint(1000, 9999)
+        email = f"{clean_first}{clean_last}{rand_num}@{self.args.email_domain}"
+        while email in self.used_emails:
+            rand_num = random.randint(1000, 9999)
+            email = f"{clean_first}{clean_last}{rand_num}@{self.args.email_domain}"
+        self.used_emails.add(email)
+        # 唯一强密码
+        password = self._generate_unique_password()
+        # 唯一真实地址(优先从 json 加载)
+        address, town, cap, dob_from_addr = self._get_unique_address()
+        # 年龄 > 20 岁生日 (dd/mm/yyyy)
+        birth_date = self._generate_birth_date(dob_from_addr)
+        # 随机爱尔兰手机号
+        phone = self._generate_unique_phone()
+        return {
+            "first_name": first_name,
+            "last_name": last_name,
+            "birth_place": birth_place,
+            "birth_date": birth_date,
+            "email": email,
+            "password": password,
+            "address": address,
+            "cap": cap,
+            "town": town,
+            "nation_value": "103",         # IRLANDA
+            "prefix": "353",
+            "phone": phone,
+            "consulate_value": "101",      # IRLANDA DUBLINO AMBASCIATA D'ITALIA
+        }
+
+    def _init_browser(self):
+        """初始化 ChromiumPage"""
+        session_id = uuid.uuid4().hex[:8]
+        self.workspace = os.path.join(PROJECT_ROOT, "data", "temp_reg_browser", f"session_{session_id}")
+        os.makedirs(self.workspace, exist_ok=True)
+        proxy_obj = None
+        if self.args.proxy:
+            proxy_clean = self.args.proxy.replace("http://", "").replace("https://", "")
+            parts = proxy_clean.split(":")
+            if len(parts) == 2:
+                proxy_obj = Proxy(ip=parts[0], port=int(parts[1]), proto="http")
+            elif len(parts) == 4:
+                proxy_obj = Proxy(ip=parts[0], port=int(parts[1]), username=parts[2], password=parts[3], proto="http")
+        co, self.tunnel = init_chromium_options(
+            user_data_path=self.workspace,
+            username_seed=f"ita_reg_{uuid.uuid4().hex[:8]}",
+            proxy=proxy_obj,
+            headless=self.args.headless,
+            window_size="1440,900",
+            logger=self._log
+        )
+        self.page = ChromiumPage(co)
+        self.page.set.timeouts(page_load=self.args.timeout, script=self.args.timeout)
+        try:
+            self.page.run_cdp(
+                "Page.addScriptToEvaluateOnNewDocument",
+                source="window.alert = function(msg){ console.log('[Alert suppressed]:', msg); };"
+            )
+        except Exception as e:
+            self._log(f"CDP alert suppression non-fatal: {e}")
+        # 初始化高仿真拟人鼠标与键盘控制器
+        self.mouse = HumanMouse(self.page, debug=False)
+        self.keyboard = HumanKeyboard(self.page)
+        try:
+            viewport = self.page.rect.viewport_size
+            self.mouse.move(random.randint(50, max(60, viewport[0] - 50)), random.randint(50, max(60, viewport[1] - 50)))
+        except Exception:
+            pass
+
+    def _close_welcome_modal(self):
+        """关闭初始引导弹窗 #register-modal"""
+        try:
+            close_btn = self.page.ele('#register-modal button.close', timeout=2)
+            if close_btn and close_btn.states.is_displayed:
+                self._log("Closing #register-modal via close button...")
+                close_btn.click()
+                time.sleep(1)
+            # 原生 DOM 彻底清理 modal 遮罩,无需强赖 jQuery
+            self.page.run_js('''
+                const modal = document.getElementById("register-modal");
+                if (modal) {
+                    modal.style.display = "none";
+                    modal.classList.remove("show");
+                }
+                document.querySelectorAll(".modal-backdrop").forEach(b => b.remove());
+                document.body.classList.remove("modal-open");
+                if (window.$ && typeof $("#register-modal").modal === "function") {
+                    try { $("#register-modal").modal("hide"); } catch(e){}
+                }
+            ''')
+            time.sleep(0.5)
+        except Exception as e:
+            self._log(f"Modal check non-fatal: {e}")
+
+    def _fill_registration_form(self, acc: dict):
+        """填入 14 项完整表单(深度拟人化鼠标点击 + 键盘击键)"""
+        self._log(f"Filling personal info for {acc['first_name']} {acc['last_name']} ({acc['email']}) with human-like mouse & keyboard...")
+        def _human_input(selector, val):
+            el = self.page.ele(selector, timeout=5)
+            if el:
+                try:
+                    self.mouse.human_click_ele(el)
+                except Exception:
+                    try:
+                        el.click()
+                    except Exception:
+                        pass
+                time.sleep(random.uniform(0.1, 0.25))
+                el.clear()
+                self.keyboard.type_text(val, humanize=True)
+                time.sleep(random.uniform(0.15, 0.35))
+            else:
+                self._log(f"Warning: selector {selector} not found")
+        # 文本项 (姓名、出生地)
+        _human_input('#Name', acc['first_name'])
+        _human_input('#Surname', acc['last_name'])
+        _human_input('#BirthPlace', acc['birth_place'])
+        # Flatpickr 出生日期 (鼠标点击输入框 + 原生 DOM 驱动)
+        bdate_el = self.page.ele('#BirthDate', timeout=5)
+        if bdate_el:
+            try:
+                self.mouse.human_click_ele(bdate_el)
+            except Exception:
+                pass
+        self.page.run_js('''
+            const d = arguments[0];
+            const el = document.getElementById("BirthDate");
+            if (el) {
+                el.value = d;
+                if (el._flatpickr) {
+                    try { el._flatpickr.setDate(d, true); } catch(e){}
+                }
+                el.dispatchEvent(new Event('input', {bubbles: true}));
+                el.dispatchEvent(new Event('change', {bubbles: true}));
+            }
+            if (window.$) {
+                try { $("#BirthDate").val(d).trigger("change"); } catch(e){}
+            }
+        ''', acc['birth_date'])
+        time.sleep(random.uniform(0.2, 0.4))
+
+
+        # 账号凭据 (邮箱、密码、确认密码)
+        _human_input('#Email', acc['email'])
+        _human_input('#Password1', acc['password'])
+        _human_input('#ConfirmPassword1', acc['password'])
+        # 地址与邮编
+        _human_input('#HomeAddress', acc['address'])
+        _human_input('#CAP', acc['cap'])
+        _human_input('#Town', acc['town'])
+        # 国家下拉框 (Nation=103 / IRLANDA)
+        nation_el = self.page.ele('#Nation', timeout=5)
+        if nation_el:
+            try:
+                self.mouse.human_click_ele(nation_el)
+            except Exception:
+                pass
+        self.page.run_js('''
+            const nVal = arguments[0];
+            const sel = document.getElementById("Nation");
+            if (sel) {
+                sel.value = nVal;
+                sel.dispatchEvent(new Event('change', {bubbles: true}));
+            }
+            if (window.$ && typeof $("#Nation").selectpicker === "function") {
+                try { $("#Nation").val(nVal).selectpicker("refresh").trigger("change"); } catch(e){}
+            }
+        ''', acc['nation_value'])
+        time.sleep(random.uniform(0.3, 0.6))
+        # 手机号与区号
+        pref_el = self.page.ele('#prefix', timeout=5)
+        if pref_el:
+            try:
+                self.mouse.human_click_ele(pref_el)
+            except Exception:
+                pass
+        self.page.run_js('''
+            const pref = arguments[0];
+            const el = document.getElementById("prefix");
+            if (el) {
+                el.value = pref;
+                el.dispatchEvent(new Event('change', {bubbles: true}));
+                el.dispatchEvent(new Event('input', {bubbles: true}));
+            }
+            if (window.$) {
+                try { $("#prefix").val(pref).trigger("change"); } catch(e){}
+            }
+        ''', acc['prefix'])
+        _human_input('#PhoneNumber', acc['phone'])
+
+        # 使馆下拉框 (Consulate=101 / IRLANDA DUBLINO AMBASCIATA D'ITALIA)
+        consulate_el = self.page.ele('#Consulate', timeout=5)
+        if not consulate_el:
+            raise ValueError("Registration consulate selector is missing")
+        # Use the select API without leaving a native dropdown open while filling
+        # subsequent controls; the caller also verifies the selected consulate.
+        consulate_el.select.by_value(acc['consulate_value'])
+        time.sleep(random.uniform(0.3, 0.6))
+        # 勾选隐私协议
+        agreement = self.page.ele('#PersonalDataAgreement', timeout=5)
+        if agreement and not agreement.states.is_checked:
+            try:
+                self.mouse.human_click_ele(agreement)
+            except Exception:
+                agreement.click()
+        self.page.run_js('''
+            const agree = document.getElementById("PersonalDataAgreement");
+            if (agree && !agree.checked) {
+                agree.checked = true;
+                agree.dispatchEvent(new Event('change', {bubbles: true}));
+            }
+            if (window.$) {
+                try { $("#PersonalDataAgreement").prop("checked", true).trigger("change"); } catch(e){}
+            }
+        ''')
+        time.sleep(random.uniform(0.4, 0.8))
+        self._log("All 14 form fields populated successfully with realistic human interactions.")
+
+    def _wait_and_bypass_turnstile(self, max_wait: int = 90) -> bool:
+        """等待或穿透 Cloudflare Turnstile 人机验证(对齐 plugins/ita_plugin.py 标准策略)"""
+        self._log("Waiting for Cloudflare Turnstile verification...")
+        start_t = time.time()
+        last_logged = 0
+        bypasser = CloudflareBypasser(self.page, log=True, logger=self._log)
+        click_attempted_basic = False
+        # 平滑滚动使 Turnstile 容器处于视口中央,激活前台渲染
+        try:
+            self.page.run_js('''
+                const cf = document.querySelector(".cf-turnstile");
+                if (cf) cf.scrollIntoView({behavior: "smooth", block: "center"});
+            ''')
+            time.sleep(0.5)
+            # 拟人化鼠标移至 Turnstile 区域,提供生物特征活跃度
+            cf_ele = self.page.ele('.cf-turnstile', timeout=1)
+            if cf_ele and hasattr(self, 'mouse'):
+                rect = cf_ele.rect
+                mid_x = rect.location[0] + rect.size[0] / 2
+                mid_y = rect.location[1] + rect.size[1] / 2
+                self.mouse.move(mid_x, mid_y)
+        except Exception as e:
+            self._log(f"Turnstile viewport scroll non-fatal: {e}")
+        while time.time() - start_t < max_wait:
+            # 处理可能残留的 alert 弹窗
+            try:
+                if self.page.states.has_alert:
+                    self.page.handle_alert(accept=True)
+            except Exception:
+                pass
+
+            # 1. 检查页面中 Turnstile token 是否已就绪,以及提交按钮状态
+            status = self.page.run_js('''
+                const el = document.querySelector('input[name="cf-turnstile-response"]');
+                const btn = document.getElementById("btnRegister");
+                let resp = "";
+                if (el && el.value) {
+                    resp = el.value;
+                } else if (typeof turnstile !== "undefined") {
+                    try {
+                        resp = turnstile.getResponse() || "";
+                    } catch(e){}
+                }
+                return {
+                    token: resp,
+                    btn_disabled: btn ? btn.disabled : true
+                };
+            ''') or {}
+            token = status.get("token", "")
+            btn_disabled = status.get("btn_disabled", True)
+            # 只要拿到 token 或者按钮已经解除 disabled,都代表 Turnstile 成功
+            if token or not btn_disabled:
+                token_disp = token[:20] if token else "already_unlocked"
+                self._log(f"✅ Cloudflare Turnstile verified successfully (token: {token_disp}...).")
+                # 确保提交按钮解除 disabled 并调用回调
+                self.page.run_js('''
+                    const btn = document.getElementById("btnRegister");
+                    if (btn) btn.disabled = false;
+                    if (typeof turnstileCallback === "function") {
+                        try { turnstileCallback(); } catch(e){}
+                    }
+                    if (window.$) {
+                        try { $("#btnRegister").prop("disabled", false); } catch(e){}
+                    }
+                ''')
+                return True
+
+            elapsed = int(time.time() - start_t)
+            if elapsed - last_logged >= 5:
+                last_logged = elapsed
+                self._log(f"Waiting for Turnstile... ({elapsed}s/{max_wait}s, URL: {self.page.url})")
+            # 策略:严格对齐 plugins/ita_plugin.py
+            # 1. 前 5 秒被动等待(TURNSTILE_PASSIVE_SECONDS = 5)
+            # 2. 5 秒后尝试一次定向穿透点击(is_dfs=False,耗时 <0.2s,不进行耗时阻塞的全局 DFS)
+            if elapsed >= 5 and not click_attempted_basic:
+                click_attempted_basic = True
+                self._log("Turnstile pending after 5s. Triggering CloudflareBypasser targeted click (is_dfs=False)...")
+                try:
+                    clicked = bypasser.click_verification_button(is_dfs=False)
+                    self._log(f"CloudflareBypasser targeted click result: {clicked}")
+                except Exception as e:
+                    self._log(f"CloudflareBypasser click error: {e}")
+            time.sleep(1.0)
+        self._log(f"⚠️ Turnstile not resolved within {max_wait}s.")
+        return False
+
+    def _fetch_activation_link(self, email: str, sent_at_utc: str, max_wait: int = 120) -> str:
+        """通过云端 API 轮询激活邮件并提取 ConfirmEmail 链接"""
+        self._log(f"Polling cloud API for activation email to {email} (since UTC {sent_at_utc})...")
+        start_time = time.time()
+        headers = {
+            "Authorization": f"Bearer {self.args.upload_token}",
+            "Accept": "application/json"
+        }
+        # SimpleLogin 转发会把发件人改写为包含 'at' 的格式: "Prenotami - noreply-prenotami at esteri.it"
+        # 经实机验证,直接以 "noreply-prenotami at esteri.it" 查收件人,不加多余关键词,5秒内即可命中
+        sender_candidates = [
+            "noreply-prenotami at esteri.it",
+            "noreply-prenotami@esteri.it"
+        ]
+        while time.time() - start_time < max_wait:
+            for sdr in sender_candidates:
+                params = {
+                    "email": self.args.master_email,
+                    "sender": sdr,
+                    "recipient": email,
+                    "sentDate": sent_at_utc,
+                    "expiry": "3600",
+                    "onlyText": False
+                }
+                try:
+                    resp = requests.post(self.args.email_fetch_url, headers=headers, params=params, json={}, timeout=25)
+                    if resp.status_code == 200:
+                        data = resp.json()
+                        if data.get("code") == 0:
+                            body = data.get("data", {}).get("body", "")
+                            match = re.search(r'https?://prenotami\.esteri\.it/Account/ConfirmEmail\?[^\s"\'<>]+', body)
+                            if match:
+                                link = match.group(0).replace("http://", "https://")
+                                self._log(f"✅ Found activation link: {link}")
+                                return link
+                except requests.exceptions.Timeout:
+                    pass
+                except Exception as e:
+                    self._log(f"Email poll exception ({sdr}): {e}")
+            elapsed = int(time.time() - start_time)
+            self._log(f"Waiting for activation email to arrive... ({elapsed}s/{max_wait}s)")
+            time.sleep(3)
+        return ""
+
+    def _activate_account_in_browser(self, link: str) -> bool:
+        """在当前浏览器会话中打开激活链接"""
+        self._log(f"Opening activation link in browser session: {link}")
+        try:
+            activate_tab = self.page.new_tab(link)
+        except Exception as e:
+            self._log(f"Failed to open new tab, navigating in current page: {e}")
+            self.page.get(link)
+            activate_tab = self.page
+        try:
+            time.sleep(5)
+            curr_url = ""
+            curr_html = ""
+            try:
+                curr_url = activate_tab.url or ""
+                curr_html = activate_tab.html or ""
+            except Exception:
+                pass
+            if "radware" in curr_html.lower() and "captcha" in curr_html.lower():
+                self._log("Radware challenge encountered on activation, waiting 6s...")
+                time.sleep(6)
+                try:
+                    curr_url = activate_tab.url or ""
+                except Exception:
+                    pass
+            self._log(f"Activation tab reached URL: {curr_url}")
+            return True
+        finally:
+            if activate_tab != self.page:
+                try:
+                    activate_tab.close()
+                except Exception:
+                    pass
+
+    def upload_account_to_server(self, acc: dict) -> bool:
+        """将激活后的账号上报至云端数据库"""
+        self._log(f"Uploading account {acc['email']} to pool {self.args.pool_name}...")
+        headers = {
+            "Authorization": f"Bearer {self.args.upload_token}",
+            "Content-Type": "application/json",
+            "Accept": "application/json"
+        }
+        payload = {
+            "pool_name": self.args.pool_name,
+            "username": acc["email"],
+            "password": acc["password"],
+            "extra_data": {
+                "full_name": f"{acc['first_name']} {acc['last_name']}",
+                "birth_date": acc["birth_date"],
+                "birth_place": acc["birth_place"],
+                "address": acc["address"],
+                "cap": acc["cap"],
+                "town": acc["town"],
+                "mobile": f"+{acc['prefix']}{acc['phone']}",
+                "consulate": "IRLANDA DUBLINO AMBASCIATA D'ITALIA",
+                "created_at": datetime.now().strftime("%Y-%m-%d %H:%M:%S")
+            },
+            "status": "active"
+        }
+        try:
+            resp = requests.post(self.args.upload_url, json=payload, headers=headers, timeout=15)
+            if resp.status_code == 200 and resp.json().get("code") == 0:
+                self._log(f"✅ Successfully registered and uploaded account: {acc['email']}")
+                return True
+            else:
+                self._log(f"❌ Upload failed: Status {resp.status_code}, Body: {resp.text}")
+                return False
+        except Exception as e:
+            self._log(f"❌ Upload error: {e}")
+            return False
+
+
+    def run_single(self, account_profile=None, *, upload=True) -> bool:
+        """注册一个账户;真实申请人由调用方提供完整资料,并单独保存凭据。"""
+        if account_profile is not None and upload:
+            raise ValueError("Applicant registration requires upload=False; do not add it to the sentinel pool")
+        acc = dict(account_profile) if account_profile is not None else self.generate_account_profile()
+        self._log("=" * 65)
+        self._log(f"Starting Registration: {acc['first_name']} {acc['last_name']} | {acc['email']}")
+        self._log("=" * 65)
+        try:
+            self._init_browser()
+            # 1. 先访问首页建立合法会话与安全 Cookie(绕过直接冷启动注册页时的 Radware 防火墙拦截)
+            self._log(f"Establishing session on home page {HOME_URL}...")
+            self.page.get(HOME_URL)
+            time.sleep(3)
+            # 2. 跳转至注册页面
+            self._log(f"Navigating to registration page {REGISTER_URL}...")
+            self.page.get(REGISTER_URL)
+            time.sleep(3)
+            # 3. 检查是否出现 Radware 拦截
+            curr_url = self.page.url or ""
+            if "perfdrive" in curr_url or "validate" in curr_url:
+                self._log("⚠️ Encountered Radware challenge, waiting 5s...")
+                time.sleep(5)
+            # 4. 关闭初始引导弹窗
+            self._close_welcome_modal()
+            # 5. 确保表单核心元素已就绪
+            if not self.page.wait.ele_displayed('#Name', timeout=15):
+                self._close_welcome_modal()
+                if not self.page.wait.ele_displayed('#Name', timeout=10):
+                    self._log(f"❌ Form element #Name not displayed. Current URL: {self.page.url}")
+                    return False
+
+            self._fill_registration_form(acc)
+            # 等待 Turnstile 验证(对齐 ita_plugin 预留充裕人机挑战交互窗口)
+            turnstile_ok = self._wait_and_bypass_turnstile(max_wait=90)
+            if not turnstile_ok:
+                self._log("❌ Turnstile verification failed. Aborting current attempt.")
+                return False
+            if self.args.dry_run:
+                self._log("🔍 [DRY-RUN] Form filled and Turnstile verified. Skipping submit & upload.")
+                time.sleep(5)
+                return True
+            # 拟人化提交点击
+            self._log("Preparing form submission...")
+            sent_at_utc = (datetime.now(timezone.utc) - timedelta(minutes=5)).strftime("%Y-%m-%d %H:%M:%S")
+            # 确保隐藏字段 Password / ConfirmPassword / hiddenOtherMailOrPhone 深度同步
+            self.page.run_js('''
+                const pw = arguments[0];
+                const pEl = document.getElementById("Password");
+                const cpEl = document.getElementById("ConfirmPassword");
+                if (pEl) pEl.value = btoa(pw);
+                if (cpEl) cpEl.value = btoa(pw);
+                const omEl = document.getElementById("OtherMailOrPhone");
+                const homEl = document.getElementById("hiddenOtherMailOrPhone");
+                if (omEl && homEl) homEl.value = omEl.value;
+            ''', acc['password'])
+            btn_submit = self.page.ele('#btnRegister', timeout=10)
+            if not btn_submit:
+                self._log("❌ Could not find submit button #btnRegister")
+                return False
+
+            self._log("Simulating human pre-submit check (0.8 ~ 1.5s)...")
+            time.sleep(random.uniform(0.8, 1.5))
+            self._log("Submitting form with HumanMouse click...")
+            try:
+                self.mouse.human_click_ele(btn_submit)
+            except Exception as e:
+                self._log(f"Human click fallback: {e}")
+                try:
+                    btn_submit.click()
+                except Exception:
+                    pass
+            # 等待跳转至 SentEmail(捕获 PageDisconnectedError 并在页面导航重连后自愈)
+            reached_sent_email = False
+            start_submit_wait = time.time()
+            max_submit_wait = 45
+            while time.time() - start_submit_wait < max_submit_wait:
+                time.sleep(1.5)
+                # 处理可能出现的 Alert 弹窗
+                try:
+                    if self.page.states.has_alert:
+                        alert_msg = self.page.states.has_alert
+                        self._log(f"Handling browser alert: {alert_msg}")
+                        self.page.handle_alert(accept=True)
+                except Exception:
+                    pass
+
+                # 安全读取当前页面 URL
+                curr_url = ""
+                try:
+                    curr_url = self.page.url or ""
+                except PageDisconnectedError:
+                    self._log("Page disconnected during POST navigation, waiting 2s for tab reconnect...")
+                    time.sleep(2)
+                    try:
+                        self.page.reconnect(wait=0.5)
+                        curr_url = self.page.url or ""
+                    except Exception:
+                        pass
+                except Exception as e:
+                    self._log(f"Waiting for URL change ({e})...")
+                if "SentEmail" in curr_url:
+                    self._log(f"✅ Reached SentEmail confirmation page: {curr_url}")
+                    reached_sent_email = True
+                    break
+                # 若超过 8 秒仍在 Register 页且未发生跳转,触发 JS submit 兜底
+                if account_profile is None and "Register" in curr_url and (time.time() - start_submit_wait > 8):
+                    self._log("Register page still active after 8s, triggering direct submit fallback...")
+                    try:
+                        self.page.run_js('''
+                            const form = document.getElementById("register-form");
+                            if (form) {
+                                if (window.$ && typeof $("#btnRegister").click === "function") {
+                                    try { $("#btnRegister").click(); } catch(e){}
+                                } else {
+                                    try { form.submit(); } catch(e){}
+                                }
+                            }
+                        ''')
+                    except Exception:
+                        pass
+
+            if not reached_sent_email:
+                curr_u = ""
+                try:
+                    curr_u = self.page.url
+                except Exception:
+                    pass
+                self._log(f"⚠️ Page did not clearly show SentEmail, current url: {curr_u}")
+            # 轮询获取激活链接
+            link = self._fetch_activation_link(acc['email'], sent_at_utc, max_wait=120)
+            if not link:
+                self._log(f"❌ Failed to receive activation email for {acc['email']}.")
+                return False
+            # 打开链接激活
+            activated = self._activate_account_in_browser(link)
+            if not activated:
+                self._log(f"❌ Activation tab failed for {acc['email']}.")
+                return False
+            # 上报入库
+            return self.upload_account_to_server(acc) if upload else True
+        finally:
+            self.cleanup()
+
+    def cleanup(self):
+        """释放浏览器与临时目录"""
+        if self.page:
+            try:
+                self.page.quit()
+            except Exception:
+                pass
+            self.page = None
+        if self.tunnel:
+            try:
+                self.tunnel.stop()
+            except Exception:
+                pass
+            self.tunnel = None
+        if hasattr(self, 'workspace') and self.workspace and os.path.exists(self.workspace):
+            try:
+                shutil.rmtree(self.workspace, ignore_errors=True)
+            except Exception:
+                pass
+
+def parse_args():
+    parser = argparse.ArgumentParser(description="Prenot@Mi 意大利签证账号全自动注册机器人")
+    parser.add_argument("--target", type=int, default=1, help="需要成功注册的账号数量")
+    parser.add_argument("--interval", type=int, default=600, help="账号注册之间的冷却等待时间(秒,默认 600 秒即 10 分钟)")
+    parser.add_argument("--proxy", type=str, default="http://127.0.0.1:7897", help="代理服务器地址 (如 http://127.0.0.1:7897)")
+    parser.add_argument("--pool-name", type=str, default=DEFAULT_POOL_NAME, help="云端账号池名称")
+    parser.add_argument("--master-email", type=str, default=DEFAULT_MASTER_EMAIL, help="接收验证邮件的主邮箱")
+    parser.add_argument("--email-domain", type=str, default="text.skin", help="生成的邮箱域名")
+    parser.add_argument("--address-file", type=str, default=DEFAULT_ADDRESS_FILE, help="真实爱尔兰地址 JSON 文件路径")
+    parser.add_argument("--upload-url", type=str, default=DEFAULT_UPLOAD_URL, help="账号上报接口 URL")
+    parser.add_argument("--upload-token", type=str, default=DEFAULT_UPLOAD_TOKEN, help="接口 Bearer Token")
+    parser.add_argument("--email-fetch-url", type=str, default=DEFAULT_EMAIL_FETCH_URL, help="邮件读取接口 URL")
+    parser.add_argument("--timeout", type=int, default=40, help="页面加载与交互超时时间(秒)")
+    parser.add_argument("--headless", action="store_true", help="是否以无头模式运行")
+    parser.add_argument("--dry-run", action="store_true", help="演练模式:填写表单与过盾,不点击最终提交与入库")
+    return parser.parse_args()
+
+def main():
+    args = parse_args()
+    bot = ItaRegistrationBot(args)
+    target_success = args.target
+    max_attempts = max(args.target * 2, args.target + 3)
+    attempt = 0
+    success_count = 0
+    fail_count = 0
+    print("=" * 70)
+    print("🇮🇹 [Prenot@Mi Registration Bot] 自动化注册任务启动")
+    print(f"目标成功数量: {target_success} | 冷却间隔: {args.interval}s ({args.interval // 60}m) | 账号池: {args.pool_name}")
+    print(f"演练模式: {args.dry_run} | 网络代理: {args.proxy} | 邮件主箱: {args.master_email}")
+    print("=" * 70)
+    while success_count < target_success and attempt < max_attempts:
+        attempt += 1
+        logger.info(f"=== [Attempt {attempt} | Success Progress: {success_count}/{target_success}] Starting Registration ===")
+        ok = bot.run_single()
+        if ok:
+            success_count += 1
+            logger.info(f"✅ [Account {success_count}/{target_success}] Registration Succeeded! (Total Success: {success_count}, Failed: {fail_count})")
+        else:
+            fail_count += 1
+            logger.warning(f"❌ [Attempt {attempt}] Registration Failed! (Total Success: {success_count}, Failed: {fail_count})")
+        # 若尚未达成目标数量,进入冷却等待(默认 10 分钟)
+        if success_count < target_success and attempt < max_attempts:
+            wait_sec = args.interval
+            logger.info(f"⏳ Cooldown: Waiting {wait_sec}s ({wait_sec // 60}m) before next registration attempt...")
+            remain = wait_sec
+            while remain > 0:
+                sleep_chunk = min(30, remain)
+                time.sleep(sleep_chunk)
+                remain -= sleep_chunk
+                if remain > 0 and remain % 60 == 0:
+                    logger.info(f"⏳ Cooldown in progress: {remain}s ({remain // 60}m) remaining before next attempt...")
+    print("\n" + "=" * 70)
+    print("🎯 [注册任务结束汇总]")
+    print(f"目标数量: {target_success} | 实际尝试: {attempt} | 成功: {success_count} | 失败: {fail_count}")
+    print("=" * 70)
+
+if __name__ == "__main__":
+    main()

+ 6 - 1
supersaas_keygen.py → keygens/supersaas_keygen.py

@@ -17,6 +17,12 @@ Target URL: https://www.supersaas.com/schedule/login/GreekEmbassyInDublin/Visas
 import os
 import re
 import sys
+
+# Allow direct execution from either the project root or this directory.
+ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+if ROOT_DIR not in sys.path:
+    sys.path.insert(0, ROOT_DIR)
+
 import json
 import yaml
 import time
@@ -76,7 +82,6 @@ DUBLIN_ADDRESSES = [
 ]
 
 
-ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
 
 
 # ==============================================================================

+ 6 - 1
tls_keygen.py → keygens/tls_keygen.py

@@ -3,6 +3,12 @@ import json
 import yaml
 import os
 import sys
+
+# Allow direct execution from either the project root or this directory.
+ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+if ROOT_DIR not in sys.path:
+    sys.path.insert(0, ROOT_DIR)
+
 import re
 import uuid
 import socket
@@ -27,7 +33,6 @@ from utils.keyboard import HumanKeyboard
 from utils.fingerprint_utils import FingerprintGenerator
 from utils.fake_utils import generate_random_account_detail
     
-ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
 
     
 def load_proxies(pool_name):

+ 6 - 1
vfs_keygen.py → keygens/vfs_keygen.py

@@ -1,5 +1,11 @@
 import os
 import sys
+
+# Allow direct execution from either the project root or this directory.
+ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+if ROOT_DIR not in sys.path:
+    sys.path.insert(0, ROOT_DIR)
+
 import re
 import uuid
 import random
@@ -125,7 +131,6 @@ class BrowserResponse:
         return self._json
 
 
-ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
 
 
 def load_proxies(pool_name):

+ 6 - 2
plugins/ita_plugin.py

@@ -1532,8 +1532,12 @@ class ItaLoginFlow(BaseFlow):
     def server_error(self):
         raise BizLogicError("Italy authentication server is temporarily unavailable")
 
-    @guard(title="just a moment", priority=5)
-    @guard(title="cloudflare", priority=5)
+    @guard(predicate=lambda f: "error.cshtml" in f.page.url.lower() or "aspxerrorpath" in f.page.url.lower(), priority=5)
+    def asp_error(self):
+        raise BizLogicError(f"Italy authentication failed: redirected to Error.cshtml ({self.page.url})")
+
+    @guard(title="just a moment", priority=6)
+    @guard(title="cloudflare", priority=6)
     def verification_pending(self):
         self.log("Waiting for the website's human verification")
         time.sleep(5)

+ 1 - 0
scripts/__init__.py

@@ -0,0 +1 @@
+"""Dependency and environment maintenance tools."""

+ 8 - 1
deps_registry.py → scripts/deps_registry.py

@@ -4,11 +4,18 @@
 负责解析 config/registry.yaml 配置文件,提供结构化的依赖元数据访问接口。
 """
 import os
+import sys
+
+# Allow direct execution from either the project root or this directory.
+ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+if ROOT_DIR not in sys.path:
+    sys.path.insert(0, ROOT_DIR)
+
 import yaml
 from dataclasses import dataclass
 from typing import List, Optional
 
-DEFAULT_CONFIG_PATH = os.path.join(os.path.dirname(__file__), "config", "registry.yaml")
+DEFAULT_CONFIG_PATH = os.path.join(ROOT_DIR, "config", "registry.yaml")
 
 @dataclass
 class Dependency:

+ 26 - 14
download_deps.py → scripts/download_deps.py

@@ -5,10 +5,17 @@
 """
 import os
 import sys
+
+# Allow direct execution from either the project root or this directory.
+ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+if ROOT_DIR not in sys.path:
+    sys.path.insert(0, ROOT_DIR)
+
 import platform
+import argparse
 import requests
 import time
-from deps_registry import registry, Dependency
+from scripts.deps_registry import registry, Dependency
 
 if sys.platform == "win32":
     try:
@@ -22,7 +29,7 @@ try:
 except ImportError:
     tqdm = None
 
-SAVE_DIR = os.path.join(os.path.dirname(__file__), "downloads")
+SAVE_DIR = os.path.join(ROOT_DIR, "downloads")
 os.makedirs(SAVE_DIR, exist_ok=True)
 
 def get_current_platform() -> str:
@@ -156,18 +163,23 @@ def download_dependency(dep: Dependency, proxies: dict | None = None):
         raise e
 
 def main():
+    parser = argparse.ArgumentParser(description="下载项目所需的二进制依赖")
+    parser.add_argument("platform", nargs="?", help="linux / windows / darwin / all(别名:docker / win / mac)")
+    proxy_group = parser.add_mutually_exclusive_group()
+    proxy_group.add_argument("--no-proxy", action="store_true", help="禁用代理")
+    proxy_group.add_argument("--proxy", help="指定代理地址")
+    # Keep accepting the legacy --linux / --windows style platform arguments.
+    platform_flags = {"--docker", "--linux", "--win", "--windows", "--mac", "--darwin", "--all"}
+    args = [arg[2:] if arg.lower() in platform_flags else arg for arg in sys.argv[1:]]
+    options = parser.parse_args(args)
     # 代理判定:支持 --no-proxy 或 --proxy <addr>,默认自动读取系统代理
     proxies = get_effective_proxies()
-    args = sys.argv[1:]
 
-    if "--no-proxy" in args:
-        args.remove("--no-proxy")
+    if options.no_proxy:
         proxies = None
         print("[代理状态] 用户已禁用代理,使用直连模式", flush=True)
-    elif any(a.startswith("--proxy=") for a in args):
-        p_arg = [a for a in args if a.startswith("--proxy=")][0]
-        args.remove(p_arg)
-        p_val = p_arg.split("=", 1)[1]
+    elif options.proxy is not None:
+        p_val = options.proxy
         if not p_val.startswith(("http://", "https://", "socks5://")):
             p_val = f"http://{p_val}"
         proxies = {"http": p_val, "https": p_val}
@@ -178,9 +190,9 @@ def main():
     else:
         print("[代理状态] 未检测到代理设置,使用直连模式", flush=True)
 
-    # 目标平台判定:支持传参覆盖(如 python download_deps.py linux / windows / all),默认自动检测宿主机
-    if args:
-        arg = args[0].lower().replace("--", "")
+    # 目标平台判定:支持传参覆盖(如 python scripts/download_deps.py linux / windows / all),默认自动检测宿主机
+    if options.platform:
+        arg = options.platform.lower().replace("--", "")
         if arg in ("docker", "linux"):
             target = "linux"
         elif arg in ("win", "windows"):
@@ -192,7 +204,7 @@ def main():
     else:
         target = get_current_platform()
 
-    print(f"[目标平台] [{target}] (可通过命令行指定: python download_deps.py linux / windows / darwin / all)\n", flush=True)
+    print(f"[目标平台] [{target}] (可通过命令行指定: python scripts/download_deps.py linux / windows / darwin / all)\n", flush=True)
 
     deps = registry.get_by_platform(target)
     if not deps:
@@ -208,4 +220,4 @@ def main():
             print(f"下载失败 [{dep.name} - {dep.version}]: {e}", flush=True)
 
 if __name__ == "__main__":
-    main()
+    main()

+ 2 - 0
scripts/powershell.cmd

@@ -0,0 +1,2 @@
+@echo off
+C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe %*

+ 1 - 1
start_proxy.py

@@ -276,7 +276,7 @@ def start_service(args):
     bin_path = find_mihomo_bin(args.bin)
     if not bin_path:
         print("❌ 未在 downloads/ 目录或系统中找到 mihomo 二进制程序!")
-        print("👉 请先运行: python download_deps.py 下载所需依赖。")
+        print("👉 请先运行: python scripts/download_deps.py 下载所需依赖。")
         sys.exit(1)
 
     config_path = find_config_file(args.config)