Last active
March 16, 2020 21:56
-
-
Save droM4X/e4c5c486ebea0df538f6030091381094 to your computer and use it in GitHub Desktop.
Set upload limit to Qbittorrent if Kodi is playing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PLAYING=`curl -s -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1}' http://localhost:8081/jsonrpc | jq -r '.result'` | |
if [ ${#PLAYING} -gt 2 ]; | |
then | |
curl -s -X POST -F 'limit=5192' http://localhost:8080/api/v2/transfer/setUploadLimit | |
else | |
curl -s -X POST -F 'limit=NaN' http://localhost:8080/api/v2/transfer/setUploadLimit | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment