You've already forked favicon-api-async
1. API外部接口可配置
2. 失败的url保存到文件中
This commit is contained in:
20
setting.py
20
setting.py
@@ -16,6 +16,10 @@ default_icon_path = os.path.join(icon_root_path, 'favicon.png')
|
||||
default_icon_file = FileUtil.read_file(default_icon_path, mode='rb')
|
||||
# 定义referer日志文件路径
|
||||
referer_log_file = os.path.join(icon_root_path, 'data', 'referer.txt')
|
||||
# 定义失败URL日志文件路径
|
||||
failed_urls_file = os.path.join(icon_root_path, 'data', 'failedurls.txt')
|
||||
# 失败URL保存阈值,当失败URL数量达到此值的倍数时保存到文件
|
||||
FAILED_URLS_SAVE_THRESHOLD = 10
|
||||
|
||||
# 时间常量
|
||||
time_of_1_minus = 1 * 60
|
||||
@@ -33,3 +37,19 @@ time_of_1_days = 1 * 24 * 60 * 60
|
||||
time_of_7_days = 7 * time_of_1_days
|
||||
time_of_15_days = 15 * time_of_1_days
|
||||
time_of_30_days = 30 * time_of_1_days
|
||||
|
||||
# 图标获取接口配置
|
||||
# 格式: (模板URL, 名称)
|
||||
# 支持的变量: {domain} - 域名, {base_url} - 基础URL
|
||||
FAVICON_APIS = [
|
||||
# gstatic.cn 接口
|
||||
('https://t3.gstatic.cn/faviconV2?client=SOCIAL&fallback_opts=TYPE,SIZE,URL&type=FAVICON&size=128&url={base_url}',
|
||||
'gstatic接口'),
|
||||
|
||||
# 第三方API
|
||||
('https://favicon.is/{domain}', '第三方API'),
|
||||
('https://ico.kucat.cn/get.php?url={base_url}', '第三方API'),
|
||||
|
||||
# 网站默认位置,放在最后
|
||||
('', '网站默认位置/favicon.ico'),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user