mirror of
https://github.com/correl/Transmission-XBMC.git
synced 2024-11-22 03:00:15 +00:00
Added EZTV.
This commit is contained in:
parent
ac9490610f
commit
c9f0c56f85
9 changed files with 68 additions and 7 deletions
|
@ -109,6 +109,10 @@ msgctxt "#32207"
|
|||
msgid "Search LimeTorrents"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#32208"
|
||||
msgid "Search EZTV"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#32290"
|
||||
msgid "Searching..."
|
||||
msgstr ""
|
||||
|
|
|
@ -123,7 +123,11 @@ msgctxt "#32207"
|
|||
msgid "Search LimeTorrents"
|
||||
msgstr ""
|
||||
|
||||
#empty strings from id 32208 to 32289
|
||||
msgctxt "#32208"
|
||||
msgid "Search EZTV"
|
||||
msgstr ""
|
||||
|
||||
#empty strings from id 32209 to 32289
|
||||
|
||||
msgctxt "#32290"
|
||||
msgid "Searching..."
|
||||
|
|
|
@ -122,7 +122,11 @@ msgctxt "#32207"
|
|||
msgid "Search LimeTorrents"
|
||||
msgstr "LimeTorrents durchsuchen"
|
||||
|
||||
# empty strings from id 208 to 289
|
||||
msgctxt "#32208"
|
||||
msgid "Search EZTV"
|
||||
msgstr "EZTV durchsuchen"
|
||||
|
||||
# empty strings from id 209 to 289
|
||||
msgctxt "#32290"
|
||||
msgid "Searching..."
|
||||
msgstr "Suche läuft..."
|
||||
|
|
|
@ -109,6 +109,10 @@ msgctxt "#32207"
|
|||
msgid "Search LimeTorrents"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#32208"
|
||||
msgid "Search EZTV"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#32290"
|
||||
msgid "Searching..."
|
||||
msgstr ""
|
||||
|
|
|
@ -109,6 +109,10 @@ msgctxt "#32207"
|
|||
msgid "Search LimeTorrents"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#32208"
|
||||
msgid "Search EZTV"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#32290"
|
||||
msgid "Searching..."
|
||||
msgstr ""
|
||||
|
|
|
@ -109,6 +109,10 @@ msgctxt "#32207"
|
|||
msgid "Search LimeTorrents"
|
||||
msgstr "Искать на LimeTorrents"
|
||||
|
||||
msgctxt "#32208"
|
||||
msgid "Search EZTV"
|
||||
msgstr "Искать на EZTV"
|
||||
|
||||
msgctxt "#32290"
|
||||
msgid "Searching..."
|
||||
msgstr "Поиск..."
|
||||
|
|
|
@ -109,6 +109,10 @@ msgctxt "#32207"
|
|||
msgid "Search LimeTorrents"
|
||||
msgstr "Buscar en LimeTorrents"
|
||||
|
||||
msgctxt "#32208"
|
||||
msgid "Search EZTV"
|
||||
msgstr "Buscar en EZTV"
|
||||
|
||||
msgctxt "#32290"
|
||||
msgid "Searching..."
|
||||
msgstr "Buscando..."
|
||||
|
|
|
@ -117,6 +117,7 @@ class TransmissionGUI(xbmcgui.WindowXMLDialog):
|
|||
(_(32205), search.L337x),
|
||||
(_(32206), search.YTS),
|
||||
(_(32207), search.Lime),
|
||||
(_(32208), search.EZTV),
|
||||
]
|
||||
selected = xbmcgui.Dialog().select(_(32000), [i[0] for i in engines])
|
||||
if selected < 0:
|
||||
|
|
|
@ -2,7 +2,7 @@ import sys
|
|||
import re
|
||||
import socket
|
||||
from urllib2 import urlopen, Request, URLError, HTTPError
|
||||
from urllib import quote, quote_plus
|
||||
from urllib import quote, quote_plus, urlencode
|
||||
from BeautifulSoup import BeautifulSoup, BeautifulStoneSoup
|
||||
|
||||
socket.setdefaulttimeout(15)
|
||||
|
@ -152,9 +152,41 @@ class Lime(Search):
|
|||
'leechers': int(leechers)
|
||||
})
|
||||
return torrents
|
||||
class EZTV(Search):
|
||||
def __init__(self):
|
||||
self.user_agent = 'Mozilla/5.0'
|
||||
self.uri_prefix = 'https://eztv.ch'
|
||||
self.search_uri = self.uri_prefix + '/search/'
|
||||
def search(self, terms):
|
||||
torrents = []
|
||||
data = {'SearchString': '', 'SearchString1': terms, 'search': 'Search'}
|
||||
req = Request(self.search_uri, urlencode(data))
|
||||
req.add_header('User-Agent', self.user_agent)
|
||||
f = urlopen(req)
|
||||
soup = BeautifulStoneSoup(f.read())
|
||||
for (c, item) in enumerate(soup.findAll('a', {'class': 'magnet'})):
|
||||
if c == 30: break
|
||||
info = item.findPrevious('a')
|
||||
link = self.uri_prefix + info['href']
|
||||
item_req = Request(link)
|
||||
item_req.add_header('User-Agent', self.user_agent)
|
||||
item_f = urlopen(item_req)
|
||||
item_soup = BeautifulStoneSoup(item_f.read())
|
||||
sp = item_soup.findAll('span', {'class': re.compile('^stat_')})
|
||||
if sp:
|
||||
sp = [int(i.text.replace(',', '')) for i in sp]
|
||||
else:
|
||||
sp = [0, 0]
|
||||
torrents.append({
|
||||
'url': item['href'],
|
||||
'name': info.text,
|
||||
'seeds': sp[0],
|
||||
'leechers': sp[1]
|
||||
})
|
||||
return torrents
|
||||
|
||||
if __name__ == '__main__':
|
||||
sites = [Mininova(), TPB(), Kickass(), L337x(), YTS(), Lime()]
|
||||
sites = [Mininova(), TPB(), Kickass(), L337x(), YTS(), Lime(), EZTV()]
|
||||
terms = 'transmission'
|
||||
if len(sys.argv) > 1:
|
||||
terms = sys.argv[1]
|
||||
|
@ -165,6 +197,6 @@ if __name__ == '__main__':
|
|||
print 'Total found = ' + str(len(torrents))
|
||||
for counter, file in enumerate(torrents):
|
||||
print '[{:3},{:3}] {:33} "{:33}"'.format(file['seeds'], file['leechers'],
|
||||
file['name'][:33], file['url'][:33])
|
||||
if counter == 4:
|
||||
break
|
||||
file['name'].encode('ascii', 'replace')[:33],
|
||||
file['url'][:33])
|
||||
if counter == 9: break
|
||||
|
|
Loading…
Reference in a new issue