Added TorrentReactor.net search

This commit is contained in:
Correl Roush 2011-09-17 20:45:11 -04:00
parent 7787f75223
commit 673a24f92f
3 changed files with 22 additions and 3 deletions

View file

@ -20,6 +20,7 @@
<string id="201">Search BTJunkie.org</string>
<string id="202">Search ThePirateBay.org</string>
<string id="203">Search Mininova.org</string>
<string id="204">Search Torrentreactor.net</string>
<string id="290">Searching...</string>
<string id="291">No results found</string>
<string id="292">Could not connect to search site</string>

View file

@ -113,6 +113,7 @@ class TransmissionGUI(xbmcgui.WindowXMLDialog):
(_(201), search.BTJunkie),
(_(202), search.TPB),
(_(203), search.Mininova),
(_(204), search.TorrentReactor),
]
selected = xbmcgui.Dialog().select(_(0), [i[0] for i in engines])
if selected < 0:

View file

@ -71,6 +71,23 @@ class TPB(Search):
'leechers': leechers,
})
return torrents
class TorrentReactor(Search):
def __init__(self):
self.search_uri = 'http://www.torrentreactor.net/rss.php?search=%s'
def search(self, terms):
torrents = []
url = self.search_uri % '+'.join(terms.split(' '))
f = urlopen(url)
soup = BeautifulStoneSoup(f.read())
for item in soup.findAll('item'):
(seeds, leechers) = re.findall('Status: (\d+) seeders, (\d+) leecher', item.description.text)[0]
torrents.append({
'url': item.enclosure['url'],
'name': item.title.text,
'seeds': int(seeds),
'leechers': int(leechers),
})
return torrents
if __name__ == '__main__':
s = TPB()