kuzyara

x-torrents.org2

Feb 15th, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.96 KB | None | 0 0
  1. #!/bin/bash
  2. cd ~/torrents
  3. echo ---get cookie
  4. curl -b /tmp/cookies.txt -c /tmp/cookies.txt -o /tmp/login.html -d "username=kuzyara&password=kolobok&returnto=/" "http://x-torrents.org/signin"
  5. echo ---get top leechers search page
  6. 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"
  7. echo ---parse links
  8. cat /tmp/results.html | grep -oP '(?<=class="class10" ><a href="/torrent/).*?(?=")' > /tmp/links.txt
  9. cat /tmp/links.txt | while read link
  10. do
  11.   echo ---get current torrent page
  12.   curl -b /tmp/cookies.txt -c /tmp/cookies.txt "http://x-torrents.org/torrent/$link" > /tmp/curr_page.html
  13.   echo ---parse .torrent url
  14.   torrentfile=`cat /tmp/curr_page.html | grep -oP '(?<=<td valign="top" align="left"><a class="index" href=").*?(?=")'`
  15.   echo ---get .torrent file
  16.   curl -b /tmp/cookies.txt -c /tmp/cookies.txt -O "http://x-torrents.org$torrentfile"
  17. done
Advertisement
Add Comment
Please, Sign In to add comment