forked from whusnoopy/renrenBackup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
89 lines (70 loc) · 2.75 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# coding: utf8
from datetime import datetime
import os
import sys
class LocalConfig:
# pylint: disable=R0903
py3 = sys.version_info[0] >= 3
if getattr(sys, 'frozen', False):
run_dir = os.path.dirname(sys.executable)
else:
run_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(run_dir)
LOGGING_CONF = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"console": {"format": "%(message)s"},
"file": {
"format": "[%(asctime)s][%(levelname)s][%(pathname)s:%(lineno)s][%(funcName)s]: %(message)s"
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "INFO",
"formatter": "console",
},
"log_file": {
"class": "logging.handlers.WatchedFileHandler",
"level": "DEBUG",
"formatter": "file",
"filename": f"log/renrenBackup_{datetime.now():%Y%m%d_%H%M%S}.log",
"encoding": "utf-8",
},
},
"loggers": {
"": {
"handlers": ["console", "log_file"],
"level": "DEBUG",
}
},
}
crawler = None
DATABASE = "renren_bak.db"
BAK_OUTPUT_TAR = "backup.tar"
BAD_IMAGE_MD5 = "ced9341d5a30f1a00256488285612337"
COOKIE_FILE = "./.cookies.json"
ITEMS_PER_PAGE = 20
TIMEOUT = 15
RETRY_TIMES = 3
DEFAULT_HEAD_PIC = "./static/gif/men_tiny.gif"
RR_PICS = {"rrfmn", "rrimg", "xnpic"}
ENCRYPT_KEY_URL = "http://login.renren.com/ajax/getEncryptKey"
LOGIN_URL = "https://rrwapi.renren.com/account/v1/loginByPassword"
ICODE_API = "https://rrwapi.renren.com/icode/v1/getBase64ImgCode"
ICODE_FILEPATH = "./static/icode.jpg"
HOMEPAGE_URL = "http://www.renren.com/personal/{uid}/details"
COMMENT_URL = "http://comment.renren.com/comment/xoa2"
GLOBAL_COMMENT_URL = "http://comment.renren.com/comment/xoa2/global"
LIKE_URL = "http://like.renren.com/showlikedetail"
STATUS_URL = "https://rrwapi.renren.com/feed/v1/homepage"
GOSSIP_PAGE_URL = "http://gossip.renren.com/list/{uid}"
GOSSIP_URL = "https://rrwapi.renren.com/messageboard/v1/getMessageList"
ALBUM_LIST_URL = "https://rrwapi.renren.com/feed/v1/albums"
ALBUM_SUMMARY_URL = "https://rrwapi.renren.com/feed/v1/album"
PHOTO_INFO_URL = "http://photo.renren.com/photo/{uid}/photo-{photo_id}/layer"
BLOG_LIST_URL = "https://rrwapi.renren.com/feed/v1/blogs"
# BLOGS_PER_PAGE = 10
BLOG_DETAIL_URL = "https://renren.com/feed/{blog_id}/{uid}"
config = LocalConfig