Download internal/browserfp/browserfp.go from qwen2api/aurora: direct link, hf CLI and curl.
- Browser
- Download file 7.74 kB
-
https://huggingface.co/spaces/qwen2api/aurora/resolve/main/internal/browserfp/browserfp.go
- Command line
-
hf download hf://spaces/qwen2api/aurora/internal/browserfp/browserfp.go
-
curl -L -o browserfp.go https://huggingface.co/spaces/qwen2api/aurora/resolve/main/internal/browserfp/browserfp.go
7.74 kB
| package browserfp | |
| import ( | |
| "math/rand" | |
| "strings" | |
| "time" | |
| ) | |
| // โโโ Language โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| // Language ๆต่งๅจ่ฏญ่จๆก็ฎใ | |
| type Language struct { | |
| Code string // "en-US" | |
| JoinList string // "en-US,en" | |
| } | |
| // Slice ่ฟๅ [][]string ็ []string ๅฝขๅผใ | |
| func (l Language) Slice() []string { return strings.Split(l.JoinList, ",") } | |
| // LanguageJoin ่ฟๅ code ๅฏนๅบ็ languagesJoin ๅญ็ฌฆไธฒใ | |
| func LanguageJoin(code string) string { | |
| for _, l := range Languages { | |
| if l.Code == code { | |
| return l.JoinList | |
| } | |
| } | |
| return code + ",en" | |
| } | |
| // LanguageSlices ๆๆ Language ็ [][]string ๅฝขๅผใ | |
| func LanguageSlices() [][]string { | |
| out := make([][]string, len(Languages)) | |
| for i, l := range Languages { | |
| out[i] = l.Slice() | |
| } | |
| return out | |
| } | |
| // โโโ ้็จๆฐๆฎๆฑ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| // UserAgents ็ๅฎ Chrome UA ๆฑ ใ | |
| var UserAgents = []string{ | |
| "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36", | |
| "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36", | |
| "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36", | |
| "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36", | |
| "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36", | |
| } | |
| // Languages ๆต่งๅจ navigator.languages ็ปๅใ | |
| var Languages = []Language{ | |
| {"en-US", "en-US,en"}, | |
| {"zh-CN", "zh-CN,zh"}, | |
| {"en-GB", "en-GB,en"}, | |
| {"ja", "ja,en"}, | |
| {"de", "de,en"}, | |
| {"fr", "fr,en"}, | |
| {"es", "es,en"}, | |
| {"ko", "ko,en"}, | |
| } | |
| // Platforms ๆต่งๅจ navigator.platform ๅผใ | |
| var Platforms = []string{"Win32", "Win32", "MacIntel", "Linux x86_64", "Linux armv8l", "Linux i686"} | |
| // DocumentKeys document ไธ own-enumerable ๅฑๆงๅๆฑ ใ | |
| var DocumentKeys = []string{ | |
| "_reactListening8in7sfyhjvp", "_reactListeningo743lnnpvdg", | |
| "_reactContainer$5pyziap1brc", "__reactContainer$b63yiita51i", | |
| "location", "cookie", "referrer", "currentScript", "body", "head", "documentElement", | |
| } | |
| // WindowKeys window ๅ จๅฑๅฑๆงๅๆฑ ใ | |
| var WindowKeys = []string{ | |
| "onchange", "onclick", "onload", "onerror", "onresize", | |
| "onmouseover", "onmouseout", "onfocus", "onblur", "onscroll", | |
| "onkeydown", "onkeyup", "onkeypress", | |
| "requestIdleCallback", "requestAnimationFrame", "setTimeout", | |
| "fetch", "console", "Promise", "Map", "Set", "WeakMap", "WeakSet", | |
| "crypto", "performance", "navigator", "document", "location", "history", | |
| "localStorage", "sessionStorage", "indexedDB", | |
| "Image", "XMLHttpRequest", "FormData", "Headers", "Request", "Response", | |
| "alert", "confirm", "prompt", "close", "focus", "blur", | |
| "addEventListener", "removeEventListener", "dispatchEvent", | |
| "scrollTo", "scrollBy", "scroll", "matchMedia", "getComputedStyle", | |
| "getSelection", "find", "stop", "open", "print", "captureEvents", | |
| "releaseEvents", "queueMicrotask", "reportError", "structuredClone", | |
| "isSecureContext", "crossOriginIsolated", "originAgentCluster", | |
| "speechSynthesis", "MediaSource", "Blob", "File", "FileReader", | |
| "Atomics", "SharedArrayBuffer", "WebAssembly", "BigInt", "Symbol", "Proxy", | |
| } | |
| // NavigatorProbes "X in navigator" ๆขๆตๆ ผๅผใ | |
| var NavigatorProbes = []string{ | |
| "windowControlsOverlayโ[object WindowControlsOverlay]", | |
| "geolocationโ[object Geolocation]", | |
| "clipboardโ[object Clipboard]", | |
| "mediaDevicesโ[object MediaDevices]", | |
| "permissionsโ[object Permissions]", | |
| "bluetoothโ[object Bluetooth]", | |
| "usbโ[object USB]", | |
| "serialโ[object Serial]", | |
| "hidโ[object HID]", | |
| "presentationโ[object Presentation]", | |
| "credentialsโ[object CredentialsContainer]", | |
| } | |
| // ScriptURLs sentinel SDK ่ๆฌ URL ๆฑ ใ | |
| // ๆต่งๅจไธญ hPt(Array.from(document.scripts).map(e=>e?.src).filter(e=>e)) | |
| // ไผ้ๆบ้ไธไธช script URLใ | |
| var ScriptURLs = []string{ | |
| "https://chatgpt.com/backend-api/sentinel/sdk.js", | |
| "https://chatgpt.com/sentinel/20260423af3c/sdk.js", | |
| } | |
| // DefaultBuildID ๅฝๅ chatgpt.com ็ data-build ๅฑๆงใ | |
| const DefaultBuildID = "prod-dbbd612ddb47498515c3eecf8579bcafa0066e07" | |
| // VendorForPlatform ่ฟๅ็ปๅฎๅนณๅฐ็ navigator.vendor ๅผใ | |
| func VendorForPlatform(platform string) string { | |
| if platform == "MacIntel" { | |
| return "Apple Computer, Inc." | |
| } | |
| return "Google Inc." | |
| } | |
| // โโโ Profile โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| // Profile ๆต่งๅจๆ็บน้ ็ฝฎใ | |
| type Profile struct { | |
| WebGLUnmaskedRenderer string | |
| WebGLUnmaskedVendor string | |
| Language string | |
| BuildID string | |
| Platform string | |
| ScreenWidth int | |
| ScreenHeight int | |
| ScreenAvailHeight int | |
| ScreenColorDepth int | |
| HardwareConcurrency int | |
| DeviceMemory int | |
| JSHeapSizeLimit int64 | |
| NetworkDownlink float64 | |
| NetworkRTT int | |
| TimezoneOffset int | |
| DevicePixelRatio float64 | |
| } | |
| // โโโ ๅ จๅฑๅไพ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| var current *Profile | |
| // Init ๅฏๅจๆถ่ฐ็จไธๆฌก๏ผ็ๆๅ จๅฑๅฏไธ็ Profileใ | |
| func Init() { current = Generate(nil) } | |
| // Get ่ฟๅๅ จๅฑๅฏไธ็ Profileใ | |
| func Get() *Profile { return current } | |
| // Generate ไป็ๅฎๆฐๆฎๆฑ ไธญ้ๆบ็ๆ Profileใ | |
| func Generate(rng *rand.Rand) *Profile { | |
| if rng == nil { | |
| rng = rand.New(rand.NewSource(time.Now().UnixNano())) | |
| } | |
| lang := Languages[rng.Intn(len(Languages))] | |
| platform := Platforms[rng.Intn(len(Platforms))] | |
| sr := screenResolutions[rng.Intn(len(screenResolutions))] | |
| sw, sh := sr[0]+rng.Intn(101)-50, sr[1]+rng.Intn(101)-50 | |
| if sw < 1024 { | |
| sw = 1024 | |
| } | |
| if sh < 600 { | |
| sh = 600 | |
| } | |
| vendorIdx := rng.Intn(len(webglUnmaskedVendors)) | |
| return &Profile{ | |
| WebGLUnmaskedVendor: webglUnmaskedVendors[vendorIdx], | |
| WebGLUnmaskedRenderer: webglUnmaskedRenderersMap[vendorIdx][rng.Intn(len(webglUnmaskedRenderersMap[vendorIdx]))], | |
| Language: lang.Code, | |
| BuildID: DefaultBuildID, | |
| Platform: platform, | |
| ScreenWidth: sw, | |
| ScreenHeight: sh, | |
| ScreenAvailHeight: sh - (20 + rng.Intn(40)), | |
| ScreenColorDepth: 24, | |
| HardwareConcurrency: pickInt(rng, []int{4, 8, 12, 16, 20, 24, 32}), | |
| DeviceMemory: pickInt(rng, []int{4, 8, 16, 32}), | |
| JSHeapSizeLimit: pickInt64(rng, []int64{2_147_483_648, 4_294_967_296, 8_589_934_592, 17_179_869_184}), | |
| NetworkDownlink: networkDownlinks[rng.Intn(len(networkDownlinks))], | |
| NetworkRTT: networkRTTs[rng.Intn(len(networkRTTs))], | |
| DevicePixelRatio: devicePixelRatios[rng.Intn(len(devicePixelRatios))], | |
| TimezoneOffset: (rng.Intn(23) - 12) * 60, | |
| } | |
| } | |
| // โโโ ๅ ้จ่พ ๅฉ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| func pickStr(rng *rand.Rand, opts []string) string { return opts[rng.Intn(len(opts))] } | |
| func pickInt(rng *rand.Rand, opts []int) int { return opts[rng.Intn(len(opts))] } | |
| func pickInt64(rng *rand.Rand, opts []int64) int64 { return opts[rng.Intn(len(opts))] } |