-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathconfig.py
32 lines (23 loc) · 923 Bytes
/
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
from config_local import *
import os
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
import logging
logging.basicConfig(format = u'%(filename)s[LINE:%(lineno)d]# %(levelname)-8s [%(asctime)s] %(message)s', level = logging.DEBUG)
Base = declarative_base()
DATA_DIRECTORY_NO_RSS = './data/norss/'
DATA_DIRECTORY = './data/rss'
if not os.path.exists(DATA_DIRECTORY):
os.makedirs(DATA_DIRECTORY)
if not os.path.exists(DATA_DIRECTORY_NO_RSS):
os.makedirs(DATA_DIRECTORY_NO_RSS)
DB_NAME = './data/instabot.db'
engine = create_engine('sqlite+pysqlcipher://:{0}@/{1}?cipher=aes-256-cfb&kdf_iter=64000'.format(KEY, DB_NAME), echo=False)
Session = sessionmaker(bind=engine)
TIME_SLEEP = 5 * 60
TIME_SLEEP_INSTALOADER_PARSER = 10 * 60
TIME_SLEEP_SENDER = 30
TIME_SLEEP_REGISTER = 30
SEND_JSON_DATA = True
SEND_COMMENTS_DATA = True