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