Merge pull request #133 from zlaazlaa/main

Add fake-useragent
This commit is contained in:
LibraHp_0928 2024-11-12 08:45:35 +08:00 committed by GitHub
commit e9a0f1c012
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -7,3 +7,4 @@ pyarrow==14.0.1
openpyxl==3.1.2
pyzbar~=0.1.9
qrcode~=7.4.2
fake-useragent

View File

@ -3,7 +3,9 @@ from tqdm import tqdm
import util.LoginUtil as Login
import requests
import json
from fake_useragent import UserAgent
ua = UserAgent()
# 登陆后获取到的cookies
cookies = Login.cookie()
# 获取g_tk
@ -26,8 +28,7 @@ headers = {
'sec-fetch-site': 'none',
'sec-fetch-user': '?1',
'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 '
'Safari/537.36 Edg/121.0.0.0',
'user-agent': ua.safari,
}