30 lines
658 B
Bash
Executable File
30 lines
658 B
Bash
Executable File
#!/bin/bash
|
|
|
|
QBT_URL="http://localhost:8080"
|
|
TRACKERS="myanonamouse|leo-test|nordicq"
|
|
|
|
API_KEY="qbt_Fw6R39WuJVY7rdhv2IXIc5n8Yfhc"
|
|
|
|
for HASH in $(
|
|
curl -s \
|
|
-H "Authorization: Bearer $API_KEY" \
|
|
"$QBT_URL/api/v2/torrents/info" \
|
|
| jq -r '.[].hash'
|
|
)
|
|
do
|
|
if curl -s \
|
|
-H "Authorization: Bearer $API_KEY" \
|
|
"$QBT_URL/api/v2/torrents/trackers?hash=$HASH" \
|
|
| jq -r '.[].url' \
|
|
| grep -Eq "$TRACKERS"
|
|
then
|
|
curl -s \
|
|
-H "Authorization: Bearer $API_KEY" \
|
|
--data "hashes=$HASH&value=true" \
|
|
"$QBT_URL/api/v2/torrents/setForceStart" \
|
|
>/dev/null
|
|
|
|
echo "Force Start: $HASH"
|
|
fi
|
|
done
|