54 lines
1.7 KiB
Python
54 lines
1.7 KiB
Python
|
#!/usr/bin/env python
|
|||
|
# -*- coding: UTF-8 -*-
|
|||
|
"""
|
|||
|
@Project :redbook
|
|||
|
@File :config.py
|
|||
|
@IDE :PyCharm
|
|||
|
@Author :rengengchen
|
|||
|
@Time :2024/4/17 16:42
|
|||
|
"""
|
|||
|
import os
|
|||
|
|
|||
|
HEAD = {
|
|||
|
'authority': 'www.douyin.com',
|
|||
|
'accept': 'application/json, text/plain, */*',
|
|||
|
'accept-language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7',
|
|||
|
'cache-control': 'no-cache',
|
|||
|
'pragma': 'no-cache',
|
|||
|
'referer': 'https://www.douyin.com/',
|
|||
|
'sec-ch-ua': '"Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24"',
|
|||
|
'sec-ch-ua-mobile': '?0',
|
|||
|
'sec-ch-ua-platform': '"Windows"',
|
|||
|
'sec-fetch-dest': 'empty',
|
|||
|
'sec-fetch-mode': 'cors',
|
|||
|
'sec-fetch-site': 'same-origin',
|
|||
|
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36'
|
|||
|
}
|
|||
|
|
|||
|
INFO_COLUMNS = ['nickname', 'text', 'cid', 'signature', 'uid', 'short_id', 'status', 'digg_count', 'create_time',
|
|||
|
'level', 'aweme_id', 'reply_id']
|
|||
|
RESULT_COLUMNS = ['nickname', 'text', 'ip_label', 'level', 'signature', 'uid', 'short_id', 'status', 'digg_count',
|
|||
|
'create_time', 'cid', 'aweme_id', 'reply_id']
|
|||
|
RESULT_COLUMNS_CH = ['昵称', '评论内容', 'ip归属地', '级别', '用户签名', '用户id', '用户短id', '评论状态', '红心数',
|
|||
|
'评论时间', '评论id', '视频id', '回复评论id']
|
|||
|
KEYWORDS = []
|
|||
|
RESULT_PATH = os.path.abspath('./')
|
|||
|
ENCODING = 'gbk'
|
|||
|
|
|||
|
|
|||
|
def modify_result_path(v):
|
|||
|
global RESULT_PATH
|
|||
|
RESULT_PATH = v
|
|||
|
|
|||
|
|
|||
|
def modify_filter_words(v):
|
|||
|
global KEYWORDS
|
|||
|
for v1 in v:
|
|||
|
if v1:
|
|||
|
KEYWORDS.append(v1)
|
|||
|
|
|||
|
|
|||
|
def modify_encoding(v):
|
|||
|
global ENCODING
|
|||
|
ENCODING = v
|