Replaced all tabs.
This commit is contained in:
@@ -16,7 +16,7 @@ config = [{
|
|||||||
'type': 'enabler',
|
'type': 'enabler',
|
||||||
'default': False,
|
'default': False,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'username',
|
'name': 'username',
|
||||||
'default': '',
|
'default': '',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -46,64 +46,64 @@ class SceneAccess(TorrentProvider):
|
|||||||
if data:
|
if data:
|
||||||
|
|
||||||
cat_ids = self.getCatId(quality['identifier'])
|
cat_ids = self.getCatId(quality['identifier'])
|
||||||
|
|
||||||
try:
|
|
||||||
cookiejar = cookielib.CookieJar()
|
|
||||||
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookiejar))
|
|
||||||
urllib2.install_opener(opener)
|
|
||||||
params = urllib.urlencode(dict(username=''+self.conf('username'), password=''+self.conf('password'), submit='come on in'))
|
|
||||||
f = opener.open('https://www.sceneaccess.eu/login', params)
|
|
||||||
data = f.read()
|
|
||||||
f.close()
|
|
||||||
f = opener.open(searchUrl)
|
|
||||||
data = f.read()
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
except (IOError, URLError):
|
try:
|
||||||
|
cookiejar = cookielib.CookieJar()
|
||||||
|
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookiejar))
|
||||||
|
urllib2.install_opener(opener)
|
||||||
|
params = urllib.urlencode(dict(username=''+self.conf('username'), password=''+self.conf('password'), submit='come on in'))
|
||||||
|
f = opener.open('https://www.sceneaccess.eu/login', params)
|
||||||
|
data = f.read()
|
||||||
|
f.close()
|
||||||
|
f = opener.open(searchUrl)
|
||||||
|
data = f.read()
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
except (IOError, URLError):
|
||||||
log.error('Failed to open %s.' % url)
|
log.error('Failed to open %s.' % url)
|
||||||
return results
|
return results
|
||||||
|
|
||||||
html = BeautifulSoup(data)
|
html = BeautifulSoup(data)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
resultsTable = html.find('table', attrs = {'id' : 'torrents-table'})
|
resultsTable = html.find('table', attrs = {'id' : 'torrents-table'})
|
||||||
entries = resultsTable.findAll('tr', attrs = {'class' : 'tt_row'})
|
entries = resultsTable.findAll('tr', attrs = {'class' : 'tt_row'})
|
||||||
for result in entries:
|
for result in entries:
|
||||||
new = {
|
new = {
|
||||||
'type': 'torrent',
|
'type': 'torrent',
|
||||||
'check_nzb': False,
|
'check_nzb': False,
|
||||||
'description': '',
|
'description': '',
|
||||||
'provider': self.getName(),
|
'provider': self.getName(),
|
||||||
}
|
}
|
||||||
|
|
||||||
link = result.find('td', attrs = {'class' : 'ttr_name'}).find('a')
|
link = result.find('td', attrs = {'class' : 'ttr_name'}).find('a')
|
||||||
new['name'] = link['title']
|
new['name'] = link['title']
|
||||||
new['id'] = link['href'].replace('details?id=', '')
|
new['id'] = link['href'].replace('details?id=', '')
|
||||||
url = result.find('td', attrs = {'class' : 'td_dl'}).find('a')
|
url = result.find('td', attrs = {'class' : 'td_dl'}).find('a')
|
||||||
new['url'] = self.urls['download'] % url['href']
|
new['url'] = self.urls['download'] % url['href']
|
||||||
new['size'] = self.parseSize(result.find('td', attrs = {'class' : 'ttr_size'}).contents[0])
|
new['size'] = self.parseSize(result.find('td', attrs = {'class' : 'ttr_size'}).contents[0])
|
||||||
new['seeders'] = int(result.find('td', attrs = {'class' : 'ttr_seeders'}).find('a').string)
|
new['seeders'] = int(result.find('td', attrs = {'class' : 'ttr_seeders'}).find('a').string)
|
||||||
leechers = result.find('td', attrs = {'class' : 'ttr_leechers'}).find('a')
|
leechers = result.find('td', attrs = {'class' : 'ttr_leechers'}).find('a')
|
||||||
if leechers:
|
if leechers:
|
||||||
new['leechers'] = int(leechers.string)
|
new['leechers'] = int(leechers.string)
|
||||||
else:
|
else:
|
||||||
new['leechers'] = 0
|
new['leechers'] = 0
|
||||||
|
|
||||||
new['imdbid'] = movie['library']['identifier']
|
new['imdbid'] = movie['library']['identifier']
|
||||||
new['extra_score'] = self.extra_score
|
new['extra_score'] = self.extra_score
|
||||||
new['score'] = fireEvent('score.calculate', new, movie, single = True)
|
new['score'] = fireEvent('score.calculate', new, movie, single = True)
|
||||||
is_correct_movie = fireEvent('searcher.correct_movie', nzb = new, movie = movie, quality = quality,
|
is_correct_movie = fireEvent('searcher.correct_movie', nzb = new, movie = movie, quality = quality,
|
||||||
imdb_results = True, single_category = False, single = True)
|
imdb_results = True, single_category = False, single = True)
|
||||||
|
|
||||||
if is_correct_movie:
|
if is_correct_movie:
|
||||||
new['download'] = self.download
|
new['download'] = self.download
|
||||||
results.append(new)
|
results.append(new)
|
||||||
self.found(new)
|
self.found(new)
|
||||||
return results
|
return results
|
||||||
|
|
||||||
except:
|
except:
|
||||||
log.info("No results found at SceneAccess")
|
log.info("No results found at SceneAccess")
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def extra_score(self, nzb):
|
def extra_score(self, nzb):
|
||||||
url = self.urls['detail'] % nzb['id']
|
url = self.urls['detail'] % nzb['id']
|
||||||
@@ -123,9 +123,9 @@ class SceneAccess(TorrentProvider):
|
|||||||
imdbDiv = str(imdbDiv).decode("utf-8", "replace")
|
imdbDiv = str(imdbDiv).decode("utf-8", "replace")
|
||||||
imdbIdAlt = re.sub('tt[0]*', 'tt', imdbId)
|
imdbIdAlt = re.sub('tt[0]*', 'tt', imdbId)
|
||||||
|
|
||||||
if 'imdb.com/title/' + imdbId in imdbDiv or 'imdb.com/title/' + imdbIdAlt in imdbDiv:
|
if 'imdb.com/title/' + imdbId in imdbDiv or 'imdb.com/title/' + imdbIdAlt in imdbDiv:
|
||||||
return 50
|
return 50
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def download(self, url = '', nzb_id = ''):
|
def download(self, url = '', nzb_id = ''):
|
||||||
torrent = self.urlopen(url)
|
torrent = self.urlopen(url)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ config = [{
|
|||||||
'type': 'enabler',
|
'type': 'enabler',
|
||||||
'default': False,
|
'default': False,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'username',
|
'name': 'username',
|
||||||
'default': '',
|
'default': '',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -39,77 +39,77 @@ class SceneHD(TorrentProvider):
|
|||||||
data = self.getCache(cache_key, searchUrl)
|
data = self.getCache(cache_key, searchUrl)
|
||||||
|
|
||||||
if data:
|
if data:
|
||||||
|
|
||||||
try:
|
|
||||||
cookiejar = cookielib.CookieJar()
|
|
||||||
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookiejar))
|
|
||||||
urllib2.install_opener(opener)
|
|
||||||
params = urllib.urlencode(dict(username=''+self.conf('username'), password=''+self.conf('password'), ssl='yes'))
|
|
||||||
f = opener.open('http://scenehd.org/takelogin.php', params)
|
|
||||||
data = f.read()
|
|
||||||
f.close()
|
|
||||||
f = opener.open(searchUrl)
|
|
||||||
data = f.read()
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
except (IOError, URLError):
|
try:
|
||||||
|
cookiejar = cookielib.CookieJar()
|
||||||
|
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookiejar))
|
||||||
|
urllib2.install_opener(opener)
|
||||||
|
params = urllib.urlencode(dict(username=''+self.conf('username'), password=''+self.conf('password'), ssl='yes'))
|
||||||
|
f = opener.open('http://scenehd.org/takelogin.php', params)
|
||||||
|
data = f.read()
|
||||||
|
f.close()
|
||||||
|
f = opener.open(searchUrl)
|
||||||
|
data = f.read()
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
except (IOError, URLError):
|
||||||
log.error('Failed to open %s.' % url)
|
log.error('Failed to open %s.' % url)
|
||||||
return results
|
return results
|
||||||
|
|
||||||
html = BeautifulSoup(data)
|
html = BeautifulSoup(data)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
resultsTable = html.findAll('table')[6]
|
resultsTable = html.findAll('table')[6]
|
||||||
entries = resultsTable.findAll('tr')
|
entries = resultsTable.findAll('tr')
|
||||||
for result in entries[1:]:
|
for result in entries[1:]:
|
||||||
new = {
|
new = {
|
||||||
'type': 'torrent',
|
'type': 'torrent',
|
||||||
'check_nzb': False,
|
'check_nzb': False,
|
||||||
'description': '',
|
'description': '',
|
||||||
'provider': self.getName(),
|
'provider': self.getName(),
|
||||||
}
|
}
|
||||||
|
|
||||||
allCells = result.findAll('td')
|
allCells = result.findAll('td')
|
||||||
new['size'] = self.parseSize(allCells[7].string.replace('GiB', 'GB'))
|
new['size'] = self.parseSize(allCells[7].string.replace('GiB', 'GB'))
|
||||||
new['seeders'] = allCells[10].find('a').string
|
new['seeders'] = allCells[10].find('a').string
|
||||||
leechers = allCells[11].find('a')
|
leechers = allCells[11].find('a')
|
||||||
if leechers:
|
if leechers:
|
||||||
new['leechers'] = leechers.string
|
new['leechers'] = leechers.string
|
||||||
else:
|
else:
|
||||||
new['leechers'] = allCells[11].string
|
new['leechers'] = allCells[11].string
|
||||||
|
|
||||||
detailLink = allCells[2].find('a')
|
detailLink = allCells[2].find('a')
|
||||||
details = detailLink['href']
|
details = detailLink['href']
|
||||||
new['id'] = details.replace('details.php?id=', '')
|
new['id'] = details.replace('details.php?id=', '')
|
||||||
new['name'] = detailLink['title']
|
new['name'] = detailLink['title']
|
||||||
|
|
||||||
imdbLink = allCells[1].find('a')
|
imdbLink = allCells[1].find('a')
|
||||||
if imdbLink:
|
if imdbLink:
|
||||||
new['imdbresult'] = imdbLink['href'].replace('http://www.imdb.com/title/','').rstrip('/')
|
new['imdbresult'] = imdbLink['href'].replace('http://www.imdb.com/title/','').rstrip('/')
|
||||||
else:
|
else:
|
||||||
new['imdbresult'] = 'tt00000000'
|
new['imdbresult'] = 'tt00000000'
|
||||||
|
|
||||||
new['url'] = self.urls['download'] % new['id']
|
new['url'] = self.urls['download'] % new['id']
|
||||||
new['imdbid'] = movie['library']['identifier']
|
new['imdbid'] = movie['library']['identifier']
|
||||||
new['extra_score'] = self.extra_score
|
new['extra_score'] = self.extra_score
|
||||||
new['score'] = fireEvent('score.calculate', new, movie, single = True)
|
new['score'] = fireEvent('score.calculate', new, movie, single = True)
|
||||||
is_correct_movie = fireEvent('searcher.correct_movie', nzb = new, movie = movie, quality = quality,
|
is_correct_movie = fireEvent('searcher.correct_movie', nzb = new, movie = movie, quality = quality,
|
||||||
imdb_results = True, single_category = False, single = True)
|
imdb_results = True, single_category = False, single = True)
|
||||||
|
|
||||||
if is_correct_movie:
|
if is_correct_movie:
|
||||||
new['download'] = self.download
|
new['download'] = self.download
|
||||||
results.append(new)
|
results.append(new)
|
||||||
self.found(new)
|
self.found(new)
|
||||||
return results
|
return results
|
||||||
|
|
||||||
except:
|
except:
|
||||||
log.info("No results found at SceneHD")
|
log.info("No results found at SceneHD")
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def extra_score(self, nzb):
|
def extra_score(self, nzb):
|
||||||
imdbIdAlt = re.sub('tt[0]*', 'tt', nzb['imdbresult'])
|
imdbIdAlt = re.sub('tt[0]*', 'tt', nzb['imdbresult'])
|
||||||
if nzb['imdbresult'] == nzb['imdbid'] or imdbIdAlt == nzb['imdbid']:
|
if nzb['imdbresult'] == nzb['imdbid'] or imdbIdAlt == nzb['imdbid']:
|
||||||
return 50
|
return 50
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def download(self, url = '', nzb_id = ''):
|
def download(self, url = '', nzb_id = ''):
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ config = [{
|
|||||||
'type': 'enabler',
|
'type': 'enabler',
|
||||||
'default': False,
|
'default': False,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'username',
|
'name': 'username',
|
||||||
'default': '',
|
'default': '',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class TorrentLeech(TorrentProvider):
|
|||||||
'test' : 'http://torrentleech.org/',
|
'test' : 'http://torrentleech.org/',
|
||||||
'detail' : 'http://torrentleech.org/torrent/%s',
|
'detail' : 'http://torrentleech.org/torrent/%s',
|
||||||
'search' : 'http://torrentleech.org/torrents/browse/index/query/%s/categories/%d',
|
'search' : 'http://torrentleech.org/torrents/browse/index/query/%s/categories/%d',
|
||||||
'download' : 'http://torrentleech.org%s',
|
'download' : 'http://torrentleech.org%s',
|
||||||
}
|
}
|
||||||
|
|
||||||
cat_ids = [
|
cat_ids = [
|
||||||
@@ -46,66 +46,66 @@ class TorrentLeech(TorrentProvider):
|
|||||||
return results
|
return results
|
||||||
|
|
||||||
cache_key = 'torrentleech.%s.%s' % (movie['library']['identifier'], quality.get('identifier'))
|
cache_key = 'torrentleech.%s.%s' % (movie['library']['identifier'], quality.get('identifier'))
|
||||||
searchUrl = self.urls['search'] % (quote_plus(getTitle(movie['library']) + ' ' + quality['identifier']), self.getCatId(quality['identifier'])[0])
|
searchUrl = self.urls['search'] % (quote_plus(getTitle(movie['library']) + ' ' + quality['identifier']), self.getCatId(quality['identifier'])[0])
|
||||||
data = self.getCache(cache_key, searchUrl)
|
data = self.getCache(cache_key, searchUrl)
|
||||||
|
|
||||||
if data:
|
if data:
|
||||||
|
|
||||||
cat_ids = self.getCatId(quality['identifier'])
|
cat_ids = self.getCatId(quality['identifier'])
|
||||||
|
|
||||||
try:
|
|
||||||
cookiejar = cookielib.CookieJar()
|
|
||||||
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookiejar))
|
|
||||||
urllib2.install_opener(opener)
|
|
||||||
params = urllib.urlencode(dict(username=''+self.conf('username'), password=''+self.conf('password'), remember_me='on', login='submit'))
|
|
||||||
f = opener.open('http://torrentleech.org/user/account/login/', params)
|
|
||||||
data = f.read()
|
|
||||||
f.close()
|
|
||||||
f = opener.open(searchUrl)
|
|
||||||
data = f.read()
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
except (IOError, URLError):
|
try:
|
||||||
|
cookiejar = cookielib.CookieJar()
|
||||||
|
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookiejar))
|
||||||
|
urllib2.install_opener(opener)
|
||||||
|
params = urllib.urlencode(dict(username=''+self.conf('username'), password=''+self.conf('password'), remember_me='on', login='submit'))
|
||||||
|
f = opener.open('http://torrentleech.org/user/account/login/', params)
|
||||||
|
data = f.read()
|
||||||
|
f.close()
|
||||||
|
f = opener.open(searchUrl)
|
||||||
|
data = f.read()
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
except (IOError, URLError):
|
||||||
log.error('Failed to open %s.' % url)
|
log.error('Failed to open %s.' % url)
|
||||||
return results
|
return results
|
||||||
|
|
||||||
html = BeautifulSoup(data)
|
html = BeautifulSoup(data)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
resultsTable = html.find('table', attrs = {'id' : 'torrenttable'})
|
resultsTable = html.find('table', attrs = {'id' : 'torrenttable'})
|
||||||
entries = resultsTable.findAll('tr')
|
entries = resultsTable.findAll('tr')
|
||||||
for result in entries[1:]:
|
for result in entries[1:]:
|
||||||
new = {
|
new = {
|
||||||
'type': 'torrent',
|
'type': 'torrent',
|
||||||
'check_nzb': False,
|
'check_nzb': False,
|
||||||
'description': '',
|
'description': '',
|
||||||
'provider': self.getName(),
|
'provider': self.getName(),
|
||||||
}
|
}
|
||||||
|
|
||||||
link = result.find('td', attrs = {'class' : 'name'}).find('a')
|
link = result.find('td', attrs = {'class' : 'name'}).find('a')
|
||||||
new['name'] = link.string
|
new['name'] = link.string
|
||||||
new['id'] = link['href'].replace('/torrent/', '')
|
new['id'] = link['href'].replace('/torrent/', '')
|
||||||
url = result.find('td', attrs = {'class' : 'quickdownload'}).find('a')
|
url = result.find('td', attrs = {'class' : 'quickdownload'}).find('a')
|
||||||
new['url'] = self.urls['download'] % url['href']
|
new['url'] = self.urls['download'] % url['href']
|
||||||
new['size'] = self.parseSize(result.findAll('td')[4].string)
|
new['size'] = self.parseSize(result.findAll('td')[4].string)
|
||||||
new['seeders'] = int(result.find('td', attrs = {'class' : 'seeders'}).string)
|
new['seeders'] = int(result.find('td', attrs = {'class' : 'seeders'}).string)
|
||||||
new['leechers'] = int(result.find('td', attrs = {'class' : 'leechers'}).string)
|
new['leechers'] = int(result.find('td', attrs = {'class' : 'leechers'}).string)
|
||||||
new['imdbid'] = movie['library']['identifier']
|
new['imdbid'] = movie['library']['identifier']
|
||||||
|
|
||||||
new['extra_score'] = self.extra_score
|
new['extra_score'] = self.extra_score
|
||||||
new['score'] = fireEvent('score.calculate', new, movie, single = True)
|
new['score'] = fireEvent('score.calculate', new, movie, single = True)
|
||||||
is_correct_movie = fireEvent('searcher.correct_movie', nzb = new, movie = movie, quality = quality,
|
is_correct_movie = fireEvent('searcher.correct_movie', nzb = new, movie = movie, quality = quality,
|
||||||
imdb_results = True, single_category = False, single = True)
|
imdb_results = True, single_category = False, single = True)
|
||||||
|
|
||||||
if is_correct_movie:
|
if is_correct_movie:
|
||||||
new['download'] = self.download
|
new['download'] = self.download
|
||||||
results.append(new)
|
results.append(new)
|
||||||
self.found(new)
|
self.found(new)
|
||||||
return results
|
return results
|
||||||
|
|
||||||
except:
|
except:
|
||||||
log.info("No results found at TorrentLeech")
|
log.info("No results found at TorrentLeech")
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def extra_score(self, nzb):
|
def extra_score(self, nzb):
|
||||||
url = self.urls['detail'] % nzb['id']
|
url = self.urls['detail'] % nzb['id']
|
||||||
@@ -121,10 +121,10 @@ class TorrentLeech(TorrentProvider):
|
|||||||
return ''
|
return ''
|
||||||
|
|
||||||
imdbIdAlt = re.sub('tt[0]*', 'tt', imdbId)
|
imdbIdAlt = re.sub('tt[0]*', 'tt', imdbId)
|
||||||
data = unicode(data, errors='ignore')
|
data = unicode(data, errors='ignore')
|
||||||
if 'imdb.com/title/' + imdbId in data or 'imdb.com/title/' + imdbIdAlt in data:
|
if 'imdb.com/title/' + imdbId in data or 'imdb.com/title/' + imdbIdAlt in data:
|
||||||
return 50
|
return 50
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def download(self, url = '', nzb_id = ''):
|
def download(self, url = '', nzb_id = ''):
|
||||||
torrent = self.urlopen(url)
|
torrent = self.urlopen(url)
|
||||||
|
|||||||
Reference in New Issue
Block a user