Automate exact release search with Prowlarr
If you are determined to find very particular releases, this script based on Prowlarr API will help you.
If you are determined to find very particular releases, this script based on Prowlarr API will help you.
- Start by listing all the releases name one per line in a file named
release-list.txt
- Create the script below with
nano searchlist-prowlarr.sh && chmod +x searchlist-prowlarr.sh
- Don't forget to replace your Prowlarr instance URL, Port and API key
#!/bin/bash
# ==============================================================================
# Title : Search Prowlarr from a file
# Description : /
# ==============================================================================
BASEURL="http://YOURIP:YOURPORT"
APIKEY="YOURAPIKEY"
EXECUTION_PATH=$PWD
FILEPATH="$PWD/release-list.txt"
FILENAME=""
CHECKMARK="\u2714"
CROSS="\u274c"
fields=""
awk '{ sub("\r$", ""); print }' "${FILEPATH}" > "${FILEPATH}2" && mv "${FILEPATH}2" "${FILEPATH}" #FORCE TO UNIX EOL
while IFS= read -r line; do
FILENAME="${line}"
echo -n "Searching $FILENAME"
result=$(curl -s "${BASEURL}/api/v1/search?apikey=$APIKEY&query=$FILENAME")
count=$(echo "$result" | jq "[.[] | select(has(\"downloadUrl\") and .title == \"$FILENAME\") | .indexer] | length")
if [[ "$count" -gt "0" ]]; then
echo -e "\\r${CHECKMARK} Searching $FILENAME"
results=$(echo "$result" | jq ".[] | select(has(\"downloadUrl\") and .title == \"$FILENAME\") | .indexer,.downloadUrl")
echo -e "$results"
else
echo -e "\\r${CROSS} Searching $FILENAME"
fi
sleep 30
done < "${FILEPATH}"