kuaishou/config.py

57 lines
1.7 KiB
Python
Raw Permalink Normal View History

2024-05-11 15:45:43 +00:00
#!/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 = {
'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7',
'Cache-Control': 'no-cache',
'Connection': 'keep-alive',
'Origin': 'https://www.kuaishou.com',
'Pragma': 'no-cache',
'Referer': 'https://www.kuaishou.com/short-video/3xfeau2qk9pv6aw',
'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',
'accept': '*/*',
'content-type': 'application/json',
'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"'
}
INFO_COLUMNS = ['authorName', 'content', 'commentId', 'authorId', 'status', 'likedCount', 'realLikedCount',
'timestamp', 'replyTo']
RESULT_COLUMNS = ['authorName', 'content', 'level', 'authorId', 'status', 'likedCount', 'realLikedCount',
'timestamp', 'commentId', 'photo_id', 'replyTo']
RESULT_COLUMNS_CH = ['昵称', '评论内容', '级别', '用户链接', '评论状态', '红心数', '真实红心数',
'评论时间', '评论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