mirror of
https://github.com/correl/Transmission-XBMC.git
synced 2025-01-08 03:00:16 +00:00
Added TorrentReactor.net search
This commit is contained in:
parent
7787f75223
commit
673a24f92f
3 changed files with 22 additions and 3 deletions
|
@ -1,11 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<strings>
|
||||
<string id="0">Transmission</string>
|
||||
|
||||
|
||||
<string id="1">Connecting to Transmission</string>
|
||||
<string id="2">Transmission Error</string>
|
||||
<string id="3">Open settings dialog?</string>
|
||||
|
||||
|
||||
<!-- Buttons -->
|
||||
<string id="101">Add</string>
|
||||
<string id="102">Remove</string>
|
||||
|
@ -14,12 +14,13 @@
|
|||
<string id="105">Pause All</string>
|
||||
<string id="106">Start All</string>
|
||||
<string id="107">Exit</string>
|
||||
|
||||
|
||||
<!-- Adding / Search -->
|
||||
<string id="200">Browse for torrent file</string>
|
||||
<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>
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue