Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # apt-get install lynx-cur
- # Edit /etc/lynx-cur/local.cfg
- # SET_COOKIES:TRUE
- # ACCEPT_ALL_COOKIES:TRUE
- # PERSISTENT_COOKIES:TRUE
- # COOKIE_FILE:~/.lynx_cookies
- # COOKIE_SAVE_FILE:~/.lynx_cookies
- # FORCE_COOKIE_PROMPT:yes
- # manual login to make cookie and script
- # lynx -cmd_log=/home/btdir/btlogin "http://www.btnext.com"
- # crontab -e
- # 10,40 * * * * /usr/local/bin/getbtnext
- cd /home/btdir
- # get list Infantil/Juvenil
- lynx -dump -listonly -nonumbers "http://www.btnext.com/?a=5&c=bagaba" | sed -n '/\.next$/p' > btnew.log
- # check if user is logged out
- if [ `ls -l btnew.log | awk '{print $5}'` -eq 0 ]; then
- # login script
- lynx -cmd_script=/home/btdir/btlogin "http://www.btnext.com"
- lynx -dump -listonly -nonumbers "http://www.btnext.com/?a=5&c=bagaba" | sed -n '/\.next$/p' > btnew.log
- fi
- # find difference between done and new
- grep -Fxvf btdone.log btnew.log > btdownl.log
- # apend done list to new one
- cat btdone.log | sed '/^$/d' >> btnew.log
- # delete duplicates
- awk '!x[$0]++' btnew.log > btdone.log
- rm btnew.log
- cat btdownl.log | while read torurl
- do
- # download .next file
- lynx -source "$torurl" > temp.next
- # get release name
- torname=$(tr -cd '[:print:]' < temp.next | sed -e 's/^.*:name[0-9][0-9]*://g;s/[0-9][0-9]*:piece length.*$//g')
- # filter just PT 720p x264
- if [[ "$torname" == *.PT.*720[pP]*[xX]264* ]]; then
- if [ ! -f "next/$torname.next" ]; then
- mv temp.next "next/$torname.next"
- echo -e "\n\e[92mSTRING MATCH ADDING \e[39m$torname"
- export DISPLAY=:1.0
- # add .next to GUI
- nohup wine /home/tools/BTNext/BTNext.exe "/home/btdir/next/$torname.next" > /dev/null 2>&1&
- sleep 4
- else
- echo -e "\n\e[93mALREADY BEEN ADDED \e[39m$torname"
- sleep 2
- rm "temp.next"
- fi
- else
- echo -e "\n\e[91mDOES NOT COMPLIES \e[39m$torname"
- sleep 2
- rm "temp.next"
- fi
- done
- rm btdownl.log
Add Comment
Please, Sign In to add comment