-
Notifications
You must be signed in to change notification settings - Fork 7
/
config.py
48 lines (36 loc) · 1.14 KB
/
config.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# -*- coding: UTF-8 -*-
import os
# mongodb 连接配置
# MONGO_URI = 'mongodb://%s:%s@%s:%s/admin' % ('username', 'password', 'ip', 'port')
MONGODB_URI = 'mongodb://%s:%s@%s:%s/admin' % ('root', '123456', '127.0.0.1', '27017')
# 重要,不要修改
CLIENT_ID = '8d5227e0aaaa4797a763ac64e0c3b8'
CLIENT_SECRET = 'ecbefbf6b17e47ecb9035107866380'
# 登录参数
LOGIN_DATA = {
'client_id': CLIENT_ID,
'grant_type': 'password',
'source': 'com.zhihu.android',
'timestamp': '',
'username': '',
'password': ''
}
# token 默认保存地址
TOKEN_PATH = os.environ['HOME'] + '/zhihu_crawler/zhihu.token'
# 日志文件
LOG_PATH = os.environ['HOME'] + '/zhihu_crawler/zhihu.log'
# LOG_PATH = 'zhihu.log'
# 知乎 API 根地址
API_URL = 'https://api.zhihu.com'
# 是否需要验证码
CAPTCHA_URL = API_URL + '/captcha'
# 登录
LOGIN_URL = API_URL + '/sign_in'
# 个人信息
MYSELF_PROFILE_URL = API_URL + '/people/self'
# 用户相关操作 {} 填入用户 ID
PEOPLE_URL = API_URL + '/people/{}'
# 我关注的用户
PEOPLE_FOLLOWEES_URL = PEOPLE_URL + '/followees'
# 关注我的用户
PEOPLE_FOLLOWERS_URL = PEOPLE_URL + '/followers'