-
Notifications
You must be signed in to change notification settings - Fork 8
/
constant.py
30 lines (27 loc) · 1.03 KB
/
constant.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# encoding: utf-8
"""
@author: john
@contact: [email protected]
@file: constant.py
@time: 2021/9/2 下午11:45
@desc:
"""
__all__ = ['COMMON_HEADERS', 'GEEK_BANG_URL', 'GEEK_BANG_NETLOC', 'GEEK_TIME_URL', 'GEEK_TIME_NETLOC']
from urllib.parse import urlparse
COMMON_HEADERS = {
'Accept': 'application/json, text/plain, */*',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
'Cache-Control': 'no-cache',
'Connection': 'keep-alive',
'Pragma': 'no-cache',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-origin',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) '
'AppleWebKit/537.36 (KHTML, like Gecko)Chrome/81.0.4044.122 Safari/537.36'
}
GEEK_BANG_URL = 'https://account.geekbang.org'
GEEK_BANG_NETLOC = urlparse(GEEK_BANG_URL)[1]
GEEK_TIME_URL = 'https://time.geekbang.org'
GEEK_TIME_NETLOC = urlparse(GEEK_TIME_URL)[1]