Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- cd ~/torrents
- echo ---get cookie
- curl -b /tmp/cookies.txt -c /tmp/cookies.txt -o /tmp/login.html -d "username=kuzyara&password=kolobok&returnto=/" "http://x-torrents.org/signin"
- echo ---get top leechers search page
- curl -b /tmp/cookies.txt -c /tmp/cookies.txt -o /tmp/results.html "http://x-torrents.org/browse.php?search=&search_method=0&search_in=0&cat=4&incldead=0&sort=8&type=desc"
- echo ---parse links
- cat /tmp/results.html | grep -oP '(?<=class="class10" ><a href="/torrent/).*?(?=")' > /tmp/links.txt
- cat /tmp/links.txt | while read link
- do
- echo ---get current torrent page
- curl -b /tmp/cookies.txt -c /tmp/cookies.txt "http://x-torrents.org/torrent/$link" > /tmp/curr_page.html
- echo ---parse .torrent url
- torrentfile=`cat /tmp/curr_page.html | grep -oP '(?<=<td valign="top" align="left"><a class="index" href=").*?(?=")'`
- echo ---get .torrent file
- curl -b /tmp/cookies.txt -c /tmp/cookies.txt -O "http://x-torrents.org$torrentfile"
- done
Advertisement
Add Comment
Please, Sign In to add comment