Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- trCMD="transmission-remote localhost:9091 -n USER:PASS"
- WDIR='/home/USER/public/transmission'
- ruLog='/home/USER/jobs/katLog.txt'
- atURL='http://feed.rutracker.org/atom/f/1087.atom'
- uAgent='User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:45.0) Gecko/20100101 Firefox/45.0'
- aceptX='Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
- aceptL='Accept-Language: pt-PT,pt;q=0.8,en;q=0.5,en-US;q=0.3'
- keepA='Connection: keep-alive'
- ruFeed () { DELAY; curl -sm10 "$atURL" -H 'Host: feed.rutracker.org' -H "$uAgent" -H "$aceptX" -H "$aceptL" -H "$keepA"; }
- ScraP () { DELAY; curl -sm10 "$ruTpic" -H 'Host: rutracker.org' -H "$uAgent" -H "$aceptX" -H "$aceptL" -H "$keepA"; }
- dFiltR () { urlencode -d "$(egrep -o 'magnet:.*[0-9A-F]{40}.*3Fmagnet' <<< "$ruScrap")"; }
- DELAY () { sleep `shuf -i 3-9 -n 1`; }
- myDMin() { echo `date +"%d%#b %R"`; }
- while :; do
- while read ruRSS; do
- ruTpic="${ruRSS##* }"; viewt="${ruTpic##*\?}"
- fRLS="${ruRSS%% *}" ; ruRLS="${fRLS//\//.}"
- [[ $ruRLS =~ ^(http:|<.xml) ]] && continue
- #[[ ! $ruRLS =~ ^SolidWorks.*SP ]] && continue
- grep -q " $viewt " "$ruLog" && continue
- ruScrap="$(ScraP)"; mgnet="$(dFiltR)"
- echo "`myDMin` $viewt $mgnet $ruRLS" | tee -a "$ruLog"
- $trCMD -a "$mgnet" -w"$WDIR" -sr 2.00 1>/dev/null
- done < <(sed -n 's/\[CDATA\[/\n/gp'<<<`ruFeed` | sed -r 's/ +/./g ; s/\.?[([].*href="(.*)"..>.*/ \1/ ; s/\&/\&/g')
- sleep `shuf -i 550-700 -n 1`
- done
Advertisement
Add Comment
Please, Sign In to add comment