qinglong
qinglong copied to clipboard
自定义推送建议
Qinglong version
2.16.5
Steps to reproduce
content内容会包含换行(无论是脚本传递的content还是在内部
hitokoto = push_config.get("HITOKOTO")
text = one() if hitokoto else ""
content += "\n\n" + text
),导致在lines = body.split("\n")
的时候就已经出现问题
What is expected?
建议如果是application/json
就直接使用WEBHOOK_BODY
里的内容
改成
if content_type == "application/json":
data = json.dumps(json.loads(body.replace('\n','\\n')))
return data
What is actually happening?
btw: key = line[:i].strip().lower()
这里也会把key转成小写
#2199
System Info
No response
Any additional comments?
No response
https://github.com/whyour/qinglong/pull/2278 我也遇到了body的json分割问题,不过我是按照qinglong系统的webhook的格式来做,export WEBHOOK_BODY='title:$title \n text:$content'
,目前已提交了pr
@sxd1140 https://github.com/whyour/qinglong/blob/develop/sample/notify.py 可以使用这个文件试试