Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # TRANSMISSION RSS DOWNLOAD MOVIES WHIT IMDB FILTER
- mkdir -p /home/getrss
- cd /home/getrss
- # get 720p rss list
- lynx -dump -width 999 "http://www.torrentday.com/torrents/rss?download;l11;u=####;tp=########" | sed 's/\(http:\)/\n\1/g' | sed 's/\(?torrent\)/\n\1/g' | sed -n '/http:/p' | sed -nr '/2012|2013|2014/p' | sed '/1080p/d' > new.log
- # find difference between done and new
- grep -Fxvf done.log new.log > filter.log
- # apend done list to new one
- cat done.log | sed '/^$/d' >> new.log
- # delete duplicates
- awk '!x[$0]++' new.log > done.log
- rm new.log
- # search IMDb for rating and votes
- cat filter.log | while read tname
- do
- MOVIENAME=$(echo "$tname" | cut -d "/" -f4 | tr -s '.' ' ' | sed -e 's/\(.*\)\([0-9][0-9][0-9][0-9]\)\( .*$\)/\1\2/' | sed 's/&/and/g')
- IMDbID=$(lynx -dump -nonumbers -nolist "https://duckduckgo.com/?q=$MOVIENAME imdb" | sed -n '/imdb.com/{p;q;}' | cut -d "/" -f3)
- imdbRat=$(curl -s http://www.omdbapi.com/?i=$IMDbID | sed 's/\",\"/\n/g ; s/\":\"/: /g ; s/{\"//g' | sed -n '/imdbRating:/p' | cut -d' ' -f2 | tr -d '.')
- imdbVot=$(curl -s http://www.omdbapi.com/?i=$IMDbID | sed 's/\",\"/\n/g ; s/\":\"/: /g ; s/{\"//g' | sed -n '/imdbVotes:/p' | cut -d' ' -f2 | tr -d ',')
- if [ "$imdbRat" -ge "60" ] && [ "$imdbVot" -ge "5000" ]; then
- echo "http://$tname?torrent_pass=########" >> downl.log
- echo -e "MOVIE: $MOVIENAME\nIMDb: www.imdb.com/title/$IMDbID\nRating: $imdbRat from $imdbVot\n" >> justify.log
- fi
- done
- rm filter.log
- # download new entries
- cat downl.log | while read torurl
- do
- rlsname=$(echo "$torurl" | cut -d "/" -f6 | sed -e 's/\.torrent.*$//g')
- echo -e "\nAdding $rlsname"
- transmission-remote localhost:9091 -n USER:PASS -a "$torurl" -sr 2.00 1>/dev/null
- sleep 1
- tornumb=$(transmission-remote localhost:9091 -n USER:PASS -l | sed -e '$!{h;d;}' -e x | awk '{print $1}') 1>/dev/null
- sleep 1
- transmission-remote localhost:9091 -n USER:PASS -t $tornumb -u3000 1>/dev/null
- done
- rm downl.log
Add Comment
Please, Sign In to add comment