Advertisement
tamouse

scraping torrent posting sites

Nov 16th, 2011
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.64 KB | None | 0 0
  1. # search pirate bay for torrents
  2. function tpb() {
  3.     wget -U Mozilla -qO - $(echo "http://thepiratebay.org/search/$@/0/7/0" | sed 's/ /\%20/g') \
  4.     | grep -o 'http\:\/\/torrents\.thepiratebay\.org\/.*\.torrent' | tac;
  5. }
  6.  
  7. # search kickasstorrents
  8. # sample torrent link returned from search:
  9. #http://torcache.net/torrent/886F7439A3D04852C50A291CF317DA61C53553BD.torrent?title=[kat.ph]breaking.bad.s04e11.hdtv.xvid.asap.eztv
  10. function kat() {
  11.     wget -U Mozilla -qO - $(echo "http://www.kat.ph/usearch/$@" | sed 's/ /\%20/g') \
  12.     | grep -E -o 'http://torcache.net/torrent/.*\.torrent\?title=[^"'\'']+' | tac
  13. }
  14.  
  15. # search btjunkie
  16. function btj() {
  17.     wget -U Mozilla -qO - $(echo "http://btjunkie.org/search?q=$@" | sed 's/ /+/g') \
  18.     | grep -E -o 'http://dl.btjunkie.org/torrent/.*/download.torrent' | tac
  19. }
  20.  
  21. # search demonoid
  22. # search string template: http://www.demonoid.me/files/?category=0&subcategory=All&quality=All&seeded=0&external=2&query=Breaking+Bad&to=1&uid=0&sort=
  23. # demonoid's search results are not as pretty or useful as the others, so we capture the name of the torrent which preceeds the actual torrent download link
  24. # we take both values and output the title as a comment after the torrent file link
  25. function dem() {
  26.     echo 'http://www.demonoid.me/files/?category=0&subcategory=All&quality=All&seeded=0&external=2&query='$@'&to=1&uid=0&sort=' | sed 's/ /+/g' \
  27.     | xargs wget -U Mozilla -qO -  \
  28.     | perl -ne 'm|/files/details| && m|\<a href=.*?\>([^<]+)\</a\>| && (print "$1\t") ; m|/files/download| && m|(/files/download/[0-9]+/[0-9]+/)| && (print "$1\n")' \
  29.     | awk -F "\t" '{print "http://www.demonoid.me" $2 " # " $1}' |tac
  30. }
  31.  
  32.  
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement