reprogrammed script based from TPB

Reprogrammed several times trying to get the right code for Nyaa, TPB
seems to be the closest script to work with nyaa, but recent code is
still having problems and not working properly.