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

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <?xml version="1.0" encoding="utf-8" standalone="yes"?>
<strings> <strings>
<string id="0">Transmission</string> <string id="0">Transmission</string>
<string id="1">Connecting to Transmission</string> <string id="1">Connecting to Transmission</string>
<string id="2">Transmission Error</string> <string id="2">Transmission Error</string>
<string id="3">Open settings dialog?</string> <string id="3">Open settings dialog?</string>
<!-- Buttons --> <!-- Buttons -->
<string id="101">Add</string> <string id="101">Add</string>
<string id="102">Remove</string> <string id="102">Remove</string>
@ -14,12 +14,13 @@
<string id="105">Pause All</string> <string id="105">Pause All</string>
<string id="106">Start All</string> <string id="106">Start All</string>
<string id="107">Exit</string> <string id="107">Exit</string>
<!-- Adding / Search --> <!-- Adding / Search -->
<string id="200">Browse for torrent file</string> <string id="200">Browse for torrent file</string>
<string id="201">Search BTJunkie.org</string> <string id="201">Search BTJunkie.org</string>
<string id="202">Search ThePirateBay.org</string> <string id="202">Search ThePirateBay.org</string>
<string id="203">Search Mininova.org</string> <string id="203">Search Mininova.org</string>
<string id="204">Search Torrentreactor.net</string>
<string id="290">Searching...</string> <string id="290">Searching...</string>
<string id="291">No results found</string> <string id="291">No results found</string>
<string id="292">Could not connect to search site</string> <string id="292">Could not connect to search site</string>

View file

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

View file

@ -71,6 +71,23 @@ class TPB(Search):
'leechers': leechers, 'leechers': leechers,
}) })
return torrents 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__': if __name__ == '__main__':
s = TPB() s = TPB()