|
本帖最后由 s450586793 于 2021-9-28 21:45 编辑
起因是看了L大这篇文章:qBittorrent下载完成TTS播报 - 『Node-RED』综合讨论区 - 『瀚思彼岸』» 智能家居技术论坛 - Powered by Discuz! (hassbian.com)
想着稍加修改,就可以让qb下载完成后发送消息给企业微信了
调试了一天的http in 跟 http respense了,然而在docker的qb下载完成后调用wget时,docker日志提示:
Connecting to 192.168.0.233:1880 (192.168.0.233:1880)
wget: server returned error: HTTP/1.1 404 Not Found
-------------------------------------------------------------------------------------------
然后用浏览器直接输入wget http://node-red用户:node-red密码@192 ... omplete?category=%L\&size=%Z -O temp.tmp &&rm temp.tmp
这个链接,永远是回复Cannot GET /download_complete
并且在http in节点后面挂了msg输出.完全没有动静,感觉就是这个链接没有触发ode的http in
求大佬指点.....
下面是我的flow
[{"id":"21596348b99296a4","type":"http in","z":"3c397a342b1c9915","name":"下载完成","url":"/download_complete","method":"get","upload":false,"swaggerDoc":"","x":100,"y":100,"wires":[["1b1df969100b1275","b8350fd9bbba7c96"]]},{"id":"b8350fd9bbba7c96","type":"function","z":"3c397a342b1c9915","name":"推送内容","func":"var name_dict = {\"Movie\":\"电影\",\"TV\":\"电视剧\",\"Adult\":\"未知\",\"video\":\"视频\"};\nvar size = (msg.payload.size/1.0e9).toFixed(2);\nvar message = `${name_dict[msg.payload.category]}下载完成,本次共计下载${size}GB`;\nmsg.payload = {};\nmsg.payload.data = {\"message\":message,\"miai_num\":\"0\"};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":280,"y":100,"wires":[["2689dfbdfc192f31"]]},{"id":"adc68c3a726e9169","type":"http response","z":"3c397a342b1c9915","name":"返回操作状态","statusCode":"200","headers":{},"x":600,"y":100,"wires":[]},{"id":"2689dfbdfc192f31","type":"template","z":"3c397a342b1c9915","name":"HTML","field":"payload","fieldType":"msg","format":"json","syntax":"plain","template":"{\"msg\":\"ok\"}","output":"str","x":430,"y":100,"wires":[["adc68c3a726e9169"]]},{"id":"1b1df969100b1275","type":"debug","z":"3c397a342b1c9915","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":290,"y":160,"wires":[]}]
|
|