极客浏览器(geekez-browser)指纹批量生成脚本importjsonimportuuidimportrandomimporttimeimportargparseimportos# # 高质量指纹数据库真实设备分布加权# SCREEN_PROFILES[{width:1920,height:1080,weight:30},{width:1366,height:768,weight:20},{width:1536,height:864,weight:15},{width:1440,height:900,weight:10},{width:1280,height:720,weight:8},{width:2560,height:1440,weight:7},{width:1600,height:900,weight:5},{width:1280,height:800,weight:3},{width:3840,height:2160,weight:2},]PLATFORM_PROFILES[{platform:Win32,weight:65,hardwareConcurrency:[4,8,12,16],deviceMemory:[4,8,16]},{platform:MacIntel,weight:20,hardwareConcurrency:[8,10,12],deviceMemory:[8,16]},{platform:Linux x86_64,weight:10,hardwareConcurrency:[4,8,16],deviceMemory:[4,8]},{platform:Win64,weight:5,hardwareConcurrency:[8,16,32],deviceMemory:[8,16,32]},]LANGUAGE_PROFILES[{languages:[en-US,en],weight:40,tz_key:en-US},{languages:[zh-CN,zh,en-US,en],weight:20,tz_key:zh-CN},{languages:[en-GB,en],weight:8,tz_key:en-GB},{languages:[ja-JP,ja],weight:6,tz_key:ja-JP},{languages:[ko-KR,ko],weight:5,tz_key:ko-KR},{languages:[de-DE,de,en],weight:5,tz_key:de-DE},{languages:[fr-FR,fr,en],weight:4,tz_key:fr-FR},{languages:[es-ES,es,en],weight:4,tz_key:es-ES},{languages:[pt-BR,pt,en],weight:4,tz_key:pt-BR},{languages:[ru-RU,ru,en],weight:4,tz_key:ru-RU},]TIMEZONE_MAP{en-US:[America/New_York,America/Chicago,America/Los_Angeles,America/Denver],zh-CN:[Asia/Shanghai,Asia/Chongqing],en-GB:[Europe/London],ja-JP:[Asia/Tokyo],ko-KR:[Asia/Seoul],de-DE:[Europe/Berlin],fr-FR:[Europe/Paris],es-ES:[Europe/Madrid,America/Mexico_City],pt-BR:[America/Sao_Paulo],ru-RU:[Europe/Moscow,Asia/Yekaterinburg],}def weighted_choice(profiles): totalsum(p[weight]forpinprofiles)rrandom.uniform(0, total)cumulative0forpinprofiles: cumulativep[weight]ifrcumulative:returnpreturnprofiles[-1]def generate_fingerprint():# 平台ppweighted_choice(PLATFORM_PROFILES)hwrandom.choice(pp[hardwareConcurrency])memrandom.choice(pp[deviceMemory])# 分辨率spweighted_choice(SCREEN_PROFILES)sw,shsp[width], sp[height]# window 略小于 screen模拟任务栏wwsw - random.choice([0,10,20])whsh- random.choice([40,60,80,100])# 语言 时区联动lpweighted_choice(LANGUAGE_PROFILES)tz_listTIMEZONE_MAP.get(lp[tz_key],[Auto])timezonerandom.choice(tz_list)# Canvas 噪声小幅非零偏移canvas_noise{r:random.choice([-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7]),g:random.choice([-5,-4,-3,-2,-1,1,2,3,4,5]),b:random.choice([-4,-3,-2,-1,1,2,3,4]),a:random.choice([-1,0,1]),}# Audio noise对数均匀分布1e-9 ~ 5e-8exprandom.uniform(-9, -7.3)audio_noiserandom.uniform(1.0,9.9)*(10** exp)return{platform:pp[platform],screen:{width:sw,height:sh},window:{width:ww,height:wh},languages:lp[languages],hardwareConcurrency:hw,deviceMemory:mem,canvasNoise:canvas_noise,audioNoise:audio_noise,noiseSeed:random.randint(1000000,99999999),timezone:timezone,}def generate_profiles(count,proxy_listNone,name_prefixenv,start_index1): profiles[]proxy_listproxy_list or[]now_msint(time.time()*1000)foriinrange(count): idxstart_index i namef{name_prefix}{idx}proxy_strproxy_list[i]ifilen(proxy_list)elsefpgenerate_fingerprint()profile{id:str(uuid.uuid4()),name:name,proxyStr:proxy_str,tags:[name_prefix, name],fingerprint:fp,preProxyOverride:default,isSetup:False,createdAt:now_ms i *100,}profiles.append(profile)proxy_hint✓proxyifproxy_strelseno-proxyprint(f [{idx:4}] {name:12} | {fp[platform]:14} | f{fp[screen][width]}x{fp[screen][height]:6} | fCPU:{fp[hardwareConcurrency]:3} MEM:{fp[deviceMemory]}GB | f{fp[languages][0]:8} | {fp[timezone]:30} | {proxy_hint})returnprofiles def main(): parserargparse.ArgumentParser(description极客浏览器批量生成高质量指纹环境)parser.add_argument(--count,typeint,default10,help生成数量 (默认10))parser.add_argument(--prefix,typestr,defaultenv,help环境名前缀 (默认env))parser.add_argument(--start,typeint,default1,help起始编号 (默认1))parser.add_argument(--proxy-file,typestr,defaultNone,help代理列表文件每行一条)parser.add_argument(--output,typestr,defaultprofiles.json,help输出文件 (默认profiles.json))parser.add_argument(--merge,actionstore_true,help追加到已有profiles.json)argsparser.parse_args()proxy_list[]ifargs.proxy_file and os.path.exists(args.proxy_file): with open(args.proxy_file,r,encodingutf-8)as f: proxy_list[l.strip()forlinfifl.strip()]print(f 已读取代理 {len(proxy_list)} 条)print(f\n 生成 {args.count} 个高质量指纹环境 (前缀{args.prefix}, 起始{args.start})\n)print(f {#:4} {名称:12} {平台:14} {分辨率:12} {CPU/内存:10} {语言:8} {时区:30} 代理)print( -*105)new_profilesgenerate_profiles(countargs.count,proxy_listproxy_list,name_prefixargs.prefix,start_indexargs.start,)# 合并模式final_profilesnew_profilesifargs.merge and os.path.exists(args.output): with open(args.output,r,encodingutf-8)as f: existingjson.load(f)final_profilesexisting new_profiles print(f\n 合并: 原有 {len(existing)} 新增 {len(new_profiles)} 共 {len(final_profiles)} 个)with open(args.output,w,encodingutf-8)as f: json.dump(final_profiles, f,ensure_asciiFalse,indent2)print(f\n{*60})print(f✅ 完成生成 {len(new_profiles)} 个环境 → {os.path.abspath(args.output)})print(f\n 下一步)print(f 复制 {args.output} 到)print(f C:\\Users\\qinqin\\AppData\\Roaming\\geekez-browser\\BrowserProfiles\\)print(f 重启极客浏览器即可看到所有环境 )print(f{*60}\n)if__name____main__:main()