qinglong icon indicating copy to clipboard operation
qinglong copied to clipboard

自定义推送建议

Open sxd1140 opened this issue 1 year ago • 2 comments

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

sxd1140 avatar Dec 08 '23 04:12 sxd1140

https://github.com/whyour/qinglong/pull/2278 我也遇到了body的json分割问题,不过我是按照qinglong系统的webhook的格式来做,export WEBHOOK_BODY='title:$title \n text:$content',目前已提交了pr

xylplm avatar Feb 20 '24 08:02 xylplm

@sxd1140 https://github.com/whyour/qinglong/blob/develop/sample/notify.py 可以使用这个文件试试

whyour avatar Feb 25 '24 07:02 whyour