mirror of
https://github.com/correl/Transmission-XBMC.git
synced 2024-11-21 19:18:41 +00:00
Add KickassTorrents search
This commit is contained in:
parent
3f5d1e7ef8
commit
6d6d8d88b4
5 changed files with 20 additions and 0 deletions
|
@ -23,6 +23,7 @@
|
|||
<string id="200">Browse for torrent file</string>
|
||||
<string id="202">Search ThePirateBay.org</string>
|
||||
<string id="203">Search Mininova.org</string>
|
||||
<string id="204">Search KickassTorrents</string>
|
||||
<string id="290">Searching...</string>
|
||||
<string id="291">No results found</string>
|
||||
<string id="292">Could not connect to search site</string>
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
<string id="200">Выбрать торрент-файл</string>
|
||||
<string id="202">Искать на ThePirateBay.org</string>
|
||||
<string id="203">Искать на Mininova.org</string>
|
||||
<string id="204">Искать на KickassTorrents</string>
|
||||
<string id="290">Поиск...</string>
|
||||
<string id="291">Ничего не найдено</string>
|
||||
<string id="292">Не удалось соединиться с поисковым сайтом</string>
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
<string id="200">Buscar un archivo torrent</string>
|
||||
<string id="202">Buscar en ThePirateBay.org</string>
|
||||
<string id="203">Buscar en Mininova.org</string>
|
||||
<string id="204">Buscar en KickassTorrents</string>
|
||||
<string id="290">Buscando...</string>
|
||||
<string id="291">No se han encontrado resultados</string>
|
||||
<string id="292">No se puede conectar con el buscador</string>
|
||||
|
|
|
@ -115,6 +115,7 @@ class TransmissionGUI(xbmcgui.WindowXMLDialog):
|
|||
(_(200), None),
|
||||
(_(202), search.TPB),
|
||||
(_(203), search.Mininova),
|
||||
(_(204), search.Kickass),
|
||||
]
|
||||
selected = xbmcgui.Dialog().select(_(0), [i[0] for i in engines])
|
||||
if selected < 0:
|
||||
|
|
|
@ -50,6 +50,22 @@ class TPB(Search):
|
|||
'leechers': leechers,
|
||||
})
|
||||
return torrents
|
||||
class Kickass(Search):
|
||||
def __init__(self):
|
||||
self.search_uri = 'http://kickass.to/usearch/%s/?field=seeders&sorder=desc&rss=1'
|
||||
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'):
|
||||
torrents.append({
|
||||
'url': item.enclosure['url'],
|
||||
'name': item.title.text,
|
||||
'seeds': int(item.find('torrent:seeds').text),
|
||||
'leechers': int(item.find('torrent:peers').text),
|
||||
})
|
||||
return torrents
|
||||
|
||||
if __name__ == '__main__':
|
||||
s = TPB()
|
||||
|
|
Loading…
Reference in a new issue