package client import ( "math/rand" "github.com/bogdanfinn/tls-client/profiles" ) // ============================================================ // 指纹配置文件 - Super Max Plus Ultra 版 // 整合 tls-client, spoofed-round-tripper, azuretls, surf 高成功率指纹 // ============================================================ // FingerprintType 指纹类型 type FingerprintType int const ( FingerprintTLSClient FingerprintType = iota // bogdanfinn/tls-client FingerprintSpoofedRT // juzeon/spoofed-round-tripper FingerprintAzureTLS // Noooste/azuretls-client ) // BrowserFingerprint 浏览器指纹完整配置 type BrowserFingerprint struct { Browser string Version string Platform string Mobile bool Type FingerprintType TLSProfile profiles.ClientProfile // tls-client / spoofed-round-tripper AzureBrowser string // azuretls-client browser type } // ============================================================ // Firefox 指纹池 (100% 成功率) - tls-client // ============================================================ var firefoxFingerprints = []BrowserFingerprint{ // 最新版本 {Browser: "firefox", Version: "135", Platform: "Windows", Type: FingerprintTLSClient, TLSProfile: profiles.Firefox_135}, {Browser: "firefox", Version: "135", Platform: "macOS", Type: FingerprintTLSClient, TLSProfile: profiles.Firefox_135}, {Browser: "firefox", Version: "135", Platform: "Linux", Type: FingerprintTLSClient, TLSProfile: profiles.Firefox_135}, {Browser: "firefox", Version: "133", Platform: "Windows", Type: FingerprintTLSClient, TLSProfile: profiles.Firefox_133}, {Browser: "firefox", Version: "133", Platform: "macOS", Type: FingerprintTLSClient, TLSProfile: profiles.Firefox_133}, {Browser: "firefox", Version: "133", Platform: "Linux", Type: FingerprintTLSClient, TLSProfile: profiles.Firefox_133}, {Browser: "firefox", Version: "132", Platform: "Windows", Type: FingerprintTLSClient, TLSProfile: profiles.Firefox_132}, {Browser: "firefox", Version: "132", Platform: "macOS", Type: FingerprintTLSClient, TLSProfile: profiles.Firefox_132}, {Browser: "firefox", Version: "123", Platform: "Windows", Type: FingerprintTLSClient, TLSProfile: profiles.Firefox_123}, {Browser: "firefox", Version: "120", Platform: "Windows", Type: FingerprintTLSClient, TLSProfile: profiles.Firefox_120}, {Browser: "firefox", Version: "120", Platform: "macOS", Type: FingerprintTLSClient, TLSProfile: profiles.Firefox_120}, {Browser: "firefox", Version: "117", Platform: "Windows", Type: FingerprintTLSClient, TLSProfile: profiles.Firefox_117}, {Browser: "firefox", Version: "110", Platform: "Windows", Type: FingerprintTLSClient, TLSProfile: profiles.Firefox_110}, {Browser: "firefox", Version: "108", Platform: "Windows", Type: FingerprintTLSClient, TLSProfile: profiles.Firefox_108}, {Browser: "firefox", Version: "106", Platform: "Windows", Type: FingerprintTLSClient, TLSProfile: profiles.Firefox_106}, {Browser: "firefox", Version: "105", Platform: "Windows", Type: FingerprintTLSClient, TLSProfile: profiles.Firefox_105}, {Browser: "firefox", Version: "104", Platform: "Windows", Type: FingerprintTLSClient, TLSProfile: profiles.Firefox_104}, {Browser: "firefox", Version: "102", Platform: "Windows", Type: FingerprintTLSClient, TLSProfile: profiles.Firefox_102}, } // ============================================================ // Safari 指纹池 (100% 成功率) - tls-client // ============================================================ var safariFingerprints = []BrowserFingerprint{ // macOS Safari {Browser: "safari", Version: "16.0", Platform: "macOS", Type: FingerprintTLSClient, TLSProfile: profiles.Safari_16_0}, {Browser: "safari", Version: "15.6.1", Platform: "macOS", Type: FingerprintTLSClient, TLSProfile: profiles.Safari_15_6_1}, // iOS Safari {Browser: "safari", Version: "18.5", Platform: "iOS", Mobile: true, Type: FingerprintTLSClient, TLSProfile: profiles.Safari_IOS_18_5}, {Browser: "safari", Version: "18.0", Platform: "iOS", Mobile: true, Type: FingerprintTLSClient, TLSProfile: profiles.Safari_IOS_18_0}, {Browser: "safari", Version: "17.0", Platform: "iOS", Mobile: true, Type: FingerprintTLSClient, TLSProfile: profiles.Safari_IOS_17_0}, {Browser: "safari", Version: "16.0", Platform: "iOS", Mobile: true, Type: FingerprintTLSClient, TLSProfile: profiles.Safari_IOS_16_0}, {Browser: "safari", Version: "15.6", Platform: "iOS", Mobile: true, Type: FingerprintTLSClient, TLSProfile: profiles.Safari_IOS_15_6}, {Browser: "safari", Version: "15.5", Platform: "iOS", Mobile: true, Type: FingerprintTLSClient, TLSProfile: profiles.Safari_IOS_15_5}, // iPadOS Safari {Browser: "safari", Version: "15.6", Platform: "iPadOS", Mobile: true, Type: FingerprintTLSClient, TLSProfile: profiles.Safari_Ipad_15_6}, } // ============================================================ // Opera 指纹池 (高成功率) - tls-client // ============================================================ var operaFingerprints = []BrowserFingerprint{ {Browser: "opera", Version: "91", Platform: "Windows", Type: FingerprintTLSClient, TLSProfile: profiles.Opera_91}, {Browser: "opera", Version: "90", Platform: "Windows", Type: FingerprintTLSClient, TLSProfile: profiles.Opera_90}, {Browser: "opera", Version: "89", Platform: "Windows", Type: FingerprintTLSClient, TLSProfile: profiles.Opera_89}, } // ============================================================ // OkHttp 指纹池 (100% 成功率 - Android 原生) - tls-client // ============================================================ var okhttpFingerprints = []BrowserFingerprint{ {Browser: "okhttp", Version: "13", Platform: "Android", Mobile: true, Type: FingerprintTLSClient, TLSProfile: profiles.Okhttp4Android13}, {Browser: "okhttp", Version: "12", Platform: "Android", Mobile: true, Type: FingerprintTLSClient, TLSProfile: profiles.Okhttp4Android12}, {Browser: "okhttp", Version: "11", Platform: "Android", Mobile: true, Type: FingerprintTLSClient, TLSProfile: profiles.Okhttp4Android11}, {Browser: "okhttp", Version: "10", Platform: "Android", Mobile: true, Type: FingerprintTLSClient, TLSProfile: profiles.Okhttp4Android10}, {Browser: "okhttp", Version: "9", Platform: "Android", Mobile: true, Type: FingerprintTLSClient, TLSProfile: profiles.Okhttp4Android9}, {Browser: "okhttp", Version: "8", Platform: "Android", Mobile: true, Type: FingerprintTLSClient, TLSProfile: profiles.Okhttp4Android8}, {Browser: "okhttp", Version: "7", Platform: "Android", Mobile: true, Type: FingerprintTLSClient, TLSProfile: profiles.Okhttp4Android7}, } // ============================================================ // Chrome 指纹池 (测试通过的版本) - tls-client // 注意: 新版 Chrome (120+) 在 tls-client 中被检测,只保留旧版本 // ============================================================ var chromeFingerprints = []BrowserFingerprint{ // 只保留测试通过的旧版本 {Browser: "chrome", Version: "112", Platform: "Windows", Type: FingerprintTLSClient, TLSProfile: profiles.Chrome_112}, {Browser: "chrome", Version: "111", Platform: "Windows", Type: FingerprintTLSClient, TLSProfile: profiles.Chrome_111}, } // ============================================================ // juzeon/spoofed-round-tripper 指纹池 // ============================================================ var spoofedRTFingerprints = []BrowserFingerprint{ {Browser: "firefox", Version: "135", Platform: "Windows", Type: FingerprintSpoofedRT, TLSProfile: profiles.Firefox_135}, {Browser: "safari", Version: "16.0", Platform: "macOS", Type: FingerprintSpoofedRT, TLSProfile: profiles.Safari_16_0}, } // ============================================================ // Noooste/azuretls-client 指纹池 (HTTP/2 + HTTP/3 支持) // 支持最新浏览器版本,自动更新指纹 // ============================================================ var azureTLSFingerprints = []BrowserFingerprint{ // Chrome - 最新版本 (自动获取) {Browser: "chrome", Version: "latest", Platform: "Windows", Type: FingerprintAzureTLS, AzureBrowser: "chrome"}, {Browser: "chrome", Version: "latest", Platform: "macOS", Type: FingerprintAzureTLS, AzureBrowser: "chrome"}, {Browser: "chrome", Version: "latest", Platform: "Linux", Type: FingerprintAzureTLS, AzureBrowser: "chrome"}, // Firefox - 最新版本 {Browser: "firefox", Version: "latest", Platform: "Windows", Type: FingerprintAzureTLS, AzureBrowser: "firefox"}, {Browser: "firefox", Version: "latest", Platform: "macOS", Type: FingerprintAzureTLS, AzureBrowser: "firefox"}, {Browser: "firefox", Version: "latest", Platform: "Linux", Type: FingerprintAzureTLS, AzureBrowser: "firefox"}, // Safari - 最新版本 {Browser: "safari", Version: "latest", Platform: "macOS", Type: FingerprintAzureTLS, AzureBrowser: "safari"}, // Edge - 最新版本 {Browser: "edge", Version: "latest", Platform: "Windows", Type: FingerprintAzureTLS, AzureBrowser: "edge"}, // iOS Safari {Browser: "safari", Version: "latest", Platform: "iOS", Mobile: true, Type: FingerprintAzureTLS, AzureBrowser: "ios"}, // Opera {Browser: "opera", Version: "latest", Platform: "Windows", Type: FingerprintAzureTLS, AzureBrowser: "opera"}, } // ============================================================ // 合并所有指纹 - 均衡权重分配 // ============================================================ var allFingerprints []BrowserFingerprint func init() { allFingerprints = make([]BrowserFingerprint, 0, 100) // ============================================================ // 权重策略: tls-client ~50%, azuretls ~30%, spoofed-rt ~20% // ============================================================ // tls-client Firefox allFingerprints = append(allFingerprints, firefoxFingerprints...) // tls-client Safari allFingerprints = append(allFingerprints, safariFingerprints...) // tls-client Opera allFingerprints = append(allFingerprints, operaFingerprints...) // tls-client OkHttp (Android) allFingerprints = append(allFingerprints, okhttpFingerprints...) // tls-client Chrome allFingerprints = append(allFingerprints, chromeFingerprints...) // spoofed-round-tripper (权重加倍) allFingerprints = append(allFingerprints, spoofedRTFingerprints...) allFingerprints = append(allFingerprints, spoofedRTFingerprints...) allFingerprints = append(allFingerprints, spoofedRTFingerprints...) // azuretls-client (权重加倍,最新浏览器指纹) allFingerprints = append(allFingerprints, azureTLSFingerprints...) allFingerprints = append(allFingerprints, azureTLSFingerprints...) allFingerprints = append(allFingerprints, azureTLSFingerprints...) } // GetRandomFingerprint 获取随机指纹 func GetRandomFingerprint() BrowserFingerprint { return allFingerprints[rand.Intn(len(allFingerprints))] } // GetRandomDesktopFingerprint 获取随机桌面端指纹 func GetRandomDesktopFingerprint() BrowserFingerprint { desktopFps := make([]BrowserFingerprint, 0) for _, fp := range allFingerprints { if !fp.Mobile { desktopFps = append(desktopFps, fp) } } if len(desktopFps) == 0 { return allFingerprints[rand.Intn(len(allFingerprints))] } return desktopFps[rand.Intn(len(desktopFps))] } // GetTotalFingerprintCount 获取总指纹数量 func GetTotalFingerprintCount() int { return len(allFingerprints) } // GetUniqueFingerprintCount 获取去重后的指纹数量 func GetUniqueFingerprintCount() int { unique := make(map[string]bool) for _, fp := range allFingerprints { key := fp.Browser + fp.Version + fp.Platform unique[key] = true } return len(unique) }