Update downloader.py,change to tls-client

This commit is contained in:
DongXishan 2024-09-23 20:27:25 +09:00 committed by GitHub
parent 213474c40c
commit 0fabdefb7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,6 @@
import time
from requests import Session
from tls_client import Session
# which need login cookie
# user info, not necessarily
@ -25,7 +25,7 @@ from requests import Session
# "rur": ""
# }
cookie = {
# your login cookie
# your cookie
}
PARAMS = r'("app_id":\s*"[^"]+")|("claim":\s*"[^"]+")|("csrf_token":\s*"[^"]+")|(["LSD",[],{"token":\s*"[^"]+")'
@ -46,7 +46,7 @@ proxy = {
class Ins:
def __init__(self, cookies: dict):
self.cookies = cookies
self.session = Session()
self.session = Session(client_identifier="chrome_104", random_tls_extension_order=True)
self.session.proxies.update(proxy)
self.headers = {
'sec-fetch-mode': 'cors',