qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
28.03k stars 3.95k forks source link

Run external program on torrent added ERROR #19185

Open feroxes opened 1 year ago

feroxes commented 1 year ago

qBittorrent & operating system versions

qBittorrent: 4.5.3-r0-2 Operating system: Home Assistant

What is the problem?

Trying to execute command on torrent added but got an error: curl: (3) unmatched close brace/bracket in URL position 31: "switch.passage_switch_center"}'

Examples of commands I have tried to use: 1) curl -X POST -H "Authorization: Bearer TOKEN -H "Content-Type: application/json" -d "{-backslash-"entity_id-backslash-": -backslash-"switch.passage_switch_center-backslash-"}" http://x.x.x.x:port/api/services/switch/toggle

-backslash- == \ github do not show it correctly

2) curl -X POST -H "Authorization: Bearer TOKEN -H "Content-Type: application/json" -d ‘{“entity_id": "switch.passage_switch_center”}’ http://x.x.x.x:PORT/api/services/switch/toggle

Both returns the same error.

Steps to reproduce

  1. Go to Settings
  2. Go to Downloads tab
  3. Enable "Run external program on torrent added:"
  4. Put command to the input field with correct token, home assistant address and entity_id
  5. Save settings
  6. Add torrent
  7. Check logs

Additional context

No response

Log(s) & preferences file(s)

No response

glassez commented 1 year ago

@Chocobo1, could you comment?

Chocobo1 commented 1 year ago

I would try to put the command into a shell script file and invoke the script instead: /bin/sh <full_path_to_script>