I went trough the description pages like http://thepiratebay.se/torrent/$i by increasing the $i and saving the magnet if pirate bay didn't return 404 error. I went trough the pages as unlogged user, though, so that might be the reason why I got only 1.5m torrents.
I didn't know pirate bay has hidden porn torrents; there is TONS of porn in the scrape already.
The script is in perl, I will post it to pastebin in a moment.
edit: allright, the script itself is here http://pastebin.com/8RXXthXB
as you can see, it's not very complicated.