|
@@ -7,9 +7,11 @@ Created on 2025-02-08
|
|
@author: Dzr
|
|
@author: Dzr
|
|
"""
|
|
"""
|
|
import json
|
|
import json
|
|
-import execjs
|
|
|
|
-from pathlib import Path
|
|
|
|
import random
|
|
import random
|
|
|
|
+from pathlib import Path
|
|
|
|
+
|
|
|
|
+import execjs
|
|
|
|
+import requests
|
|
|
|
|
|
|
|
|
|
def random_fp():
|
|
def random_fp():
|
|
@@ -56,6 +58,51 @@ def get_fingerprint():
|
|
return ctx.call('getFingerprint', fp_data)
|
|
return ctx.call('getFingerprint', fp_data)
|
|
|
|
|
|
|
|
|
|
|
|
+def check_fingerprint(fp, cookies, referer, proxies=None):
|
|
|
|
+ url = 'https://cg.95306.cn/proxy/portal/elasticSearch/checkRequestNumValidateCode'
|
|
|
|
+
|
|
|
|
+ headers = {
|
|
|
|
+ 'Accept': '*/*',
|
|
|
|
+ 'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
|
|
|
|
+ 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
|
|
|
+ 'Origin': 'https://cg.95306.cn',
|
|
|
|
+ 'Referer': referer,
|
|
|
|
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36',
|
|
|
|
+ 'X-Requested-With': 'XMLHttpRequest',
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ data = {
|
|
|
|
+ 'mhId': fp,
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ try:
|
|
|
|
+ response = requests.post(
|
|
|
|
+ url,
|
|
|
|
+ cookies=cookies,
|
|
|
|
+ headers=headers,
|
|
|
|
+ data=data,
|
|
|
|
+ proxies=proxies,
|
|
|
|
+ timeout=10
|
|
|
|
+ )
|
|
|
|
+ response.raise_for_status()
|
|
|
|
+ return True
|
|
|
|
+ except requests.RequestException:
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+def fetch_alteon_pcgmh(proxies=None):
|
|
|
|
+ url = 'https://cg.95306.cn/assets/crmsc/js/v4.js'
|
|
|
|
+ headers = {
|
|
|
|
+ 'Accept': '*/*',
|
|
|
|
+ 'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
|
|
|
|
+ 'Origin': 'https://cg.95306.cn',
|
|
|
|
+ 'Referer': 'https://cg.95306.cn/assets/crmsc/js/getMhId.js',
|
|
|
|
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36',
|
|
|
|
+ }
|
|
|
|
+ response = requests.get(url, headers=headers, proxies=proxies, timeout=10)
|
|
|
|
+ return response.cookies.get('AlteonPcgmh')
|
|
|
|
+
|
|
|
|
+
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
for _ in range(3):
|
|
for _ in range(3):
|
|
print(get_fingerprint())
|
|
print(get_fingerprint())
|