This ThePirateBay.se torrent search script is based on the quite modular Torrentz.eu one I've made a while ago. You can find it on my GitHub as will be usual for all of my future scripts and stuff, so don't forget to add me to your watch list :).
This deprecates the old TPB search script.
I'll greatly appreciate any feedback, so don't hesitate to leave a comment if you'd like to. Improvement ideas are also welcome ;).
You can also modify and reuse all my scripts listed in the repo if you feel like it as they're licensed under GPLv3.