Blame contrib/get-all-torrents

Packit Service a2489d
#!/bin/bash
Packit Service a2489d
Packit Service a2489d
RATE_LIMIT="2m:1m"
Packit Service a2489d
Packit Service a2489d
if [ $# -lt 2 ]; then
Packit Service a2489d
   echo "Usage: $0 index-URL store-directory"
Packit Service a2489d
   exit 1
Packit Service a2489d
fi
Packit Service a2489d
Packit Service a2489d
index="$1" # e.g. https://kat.cr/movies/
Packit Service a2489d
store="$2"
Packit Service a2489d
Packit Service a2489d
urls="$(lynx "$index" -dump -listonly | grep magnet: | awk 'BEGIN {ORS=" "} {print "\""$2"\""}')"
Packit Service a2489d
exec lftp -e "set limit-total-rate $RATE_LIMIT; set cmd:interactive yes; \
Packit Service a2489d
torrent -O \"$store\" --only-new $urls &"