Last active
March 29, 2020 20:25
-
-
Save hvmonteiro/36f6c38cd03761b87d4ddf5ba7a8e13f to your computer and use it in GitHub Desktop.
Quick dirty script to download showrss.info list and send it to transmission torrent
This file contains 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 | |
USERID="12345" | |
TRACKERS_FILE="/tmp/showrss.info" | |
TRANSMISSION_BIN="/storage/.kodi/addons/service.downloadmanager.transmission/bin/transmission-remote" | |
TRACKERS_LIBFILE="/var/media/storage/backups/get-showrss-info.data" | |
curl -s 'http://showrss.info/user/${USERID}.rss?magnets=true&namespaces=true&name=null&quality=null&re=null' | grep -o '<enclosure url="[^"]*' | grep -o '[^"]*$' > "$TRACKERS_FILE" | |
#sed 's/&/\\&/g;s/;/\\;/g' | |
touch "$TRACKERS_LIBFILE" | |
while IFS= read -r line; do | |
fgrep -q "$line" "$TRACKERS_LIBFILE" | |
if [ $? -ne 0 ]; then | |
echo "Adding '$line' ..." | |
"$TRANSMISSION_BIN" -a "$line" | |
if [ $? -eq 0 ]; then | |
echo "$line" >> "$TRACKERS_LIBFILE" | |
else | |
echo "Error adding tracker!" | |
fi | |
fi | |
done < "$TRACKERS_FILE" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It was written to be used in XBMC/KODI, but works wherever there's a bash shell and curl.