-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
34 lines (29 loc) · 1003 Bytes
/
config.py
File metadata and controls
34 lines (29 loc) · 1003 Bytes
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
配置文件
包含项目的各种配置参数
"""
# 网站配置
BASE_URL_TEMPLATE = "https://www.trjvod.com/index.php/vod/play/id/{}"
REQUEST_TIMEOUT = 10
MAX_RETRIES = 3
# 下载配置
DOWNLOAD_DIR = "downloads"
STREAMLINK_THREADS = 4
STREAMLINK_QUALITY = "best"
# HTTP请求头
DEFAULT_HEADERS = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
'Accept-Encoding': 'gzip, deflate',
'Connection': 'keep-alive',
'Upgrade-Insecure-Requests': '1',
}
# 文件名清理规则
FILENAME_INVALID_CHARS = ['<', '>', ':', '"', '/', '\\', '|', '?', '*']
FILENAME_REPLACEMENT_CHAR = '_'
# 日志配置
LOG_LEVEL = 'INFO'
LOG_FORMAT = '%(asctime)s - %(levelname)s - %(message)s'