mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 04:47:48 +08:00
添加自定义的请求头功能
This commit is contained in:
+3
-12
@@ -50,18 +50,9 @@ def gen_fake_header():
|
|||||||
Generate fake request headers
|
Generate fake request headers
|
||||||
"""
|
"""
|
||||||
ua = random.choice(user_agents)
|
ua = random.choice(user_agents)
|
||||||
headers = {
|
headers = dict()
|
||||||
'Accept': 'text/html,application/xhtml+xml,'
|
headers['User-Agent'] = ua
|
||||||
'application/xml;q=0.9,*/*;q=0.8',
|
headers.update(settings.headers)
|
||||||
'Accept-Encoding': 'gzip, deflate',
|
|
||||||
'Accept-Language': 'en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7',
|
|
||||||
'Cache-Control': 'max-age=0',
|
|
||||||
'DNT': '1',
|
|
||||||
'Referer': 'https://www.google.com/',
|
|
||||||
'Upgrade-Insecure-Requests': '1',
|
|
||||||
'User-Agent': ua,
|
|
||||||
'X-Forwarded-For': '127.0.0.1'
|
|
||||||
}
|
|
||||||
return headers
|
return headers
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -165,3 +165,16 @@ subdomains_common = {'i', 'w', 'm', 'en', 'us', 'zh', 'w3', 'app', 'bbs',
|
|||||||
'web', 'www', 'job', 'docs', 'news', 'blog', 'data',
|
'web', 'www', 'job', 'docs', 'news', 'blog', 'data',
|
||||||
'help', 'live', 'mall', 'blogs', 'files', 'forum',
|
'help', 'live', 'mall', 'blogs', 'files', 'forum',
|
||||||
'store', 'mobile'}
|
'store', 'mobile'}
|
||||||
|
|
||||||
|
# 请求头设置
|
||||||
|
headers = {
|
||||||
|
'Accept': 'text/html,application/xhtml+xml,'
|
||||||
|
'application/xml;q=0.9,*/*;q=0.8',
|
||||||
|
'Accept-Encoding': 'gzip, deflate',
|
||||||
|
'Accept-Language': 'en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7',
|
||||||
|
'Cache-Control': 'max-age=0',
|
||||||
|
'DNT': '1',
|
||||||
|
'Referer': 'https://www.google.com/',
|
||||||
|
'Upgrade-Insecure-Requests': '1',
|
||||||
|
'X-Forwarded-For': '127.0.0.1'
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user