Don't use quality identifier in title searches
This commit is contained in:
1 parent
fe52ac7203
commit
61a0bb8ec6
6 files changed
+24
-11
No files matched your search
@@ -22,11 +22,10 @@ class BinSearch(NZBProvider):
|
|||||||
|
|
||||||
def _search(self, movie, quality, results):
|
def _search(self, movie, quality, results):
|
||||||
|
|
||||||
q = '%s %s' % (movie['library']['identifier'], quality.get('identifier'))
|
|
||||||
arguments = tryUrlencode({
|
arguments = tryUrlencode({
|
||||||
'q': q,
|
'q': movie['library']['identifier'],
|
||||||
'm': 'n',
|
'm': 'n',
|
||||||
'max': 250,
|
'max': 400,
|
||||||
'adv_age': Env.setting('retention', 'nzb'),
|
'adv_age': Env.setting('retention', 'nzb'),
|
||||||
'adv_sort': 'date',
|
'adv_sort': 'date',
|
||||||
'adv_col': 'on',
|
'adv_col': 'on',
|
||||||
|
|||||||
@@ -20,13 +20,13 @@ class NZBClub(NZBProvider, RSS):
|
|||||||
|
|
||||||
def _searchOnTitle(self, title, movie, quality, results):
|
def _searchOnTitle(self, title, movie, quality, results):
|
||||||
|
|
||||||
q = '"%s %s" %s' % (title, movie['library']['year'], quality.get('identifier'))
|
q = '"%s %s"' % (title, movie['library']['year'])
|
||||||
|
|
||||||
params = tryUrlencode({
|
params = tryUrlencode({
|
||||||
'q': q,
|
'q': q,
|
||||||
'ig': '1',
|
'ig': 1,
|
||||||
'rpp': 200,
|
'rpp': 200,
|
||||||
'st': 1,
|
'st': 5,
|
||||||
'sp': 1,
|
'sp': 1,
|
||||||
'ns': 1,
|
'ns': 1,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class NzbIndex(NZBProvider, RSS):
|
|||||||
|
|
||||||
def _searchOnTitle(self, title, movie, quality, results):
|
def _searchOnTitle(self, title, movie, quality, results):
|
||||||
|
|
||||||
q = '"%s" %s %s' % (title, movie['library']['year'], quality.get('identifier'))
|
q = '"%s %s"' % (title, movie['library']['year'])
|
||||||
arguments = tryUrlencode({
|
arguments = tryUrlencode({
|
||||||
'q': q,
|
'q': q,
|
||||||
'age': Env.setting('retention', 'nzb'),
|
'age': Env.setting('retention', 'nzb'),
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class SceneHD(TorrentProvider):
|
|||||||
|
|
||||||
def _searchOnTitle(self, title, movie, quality, results):
|
def _searchOnTitle(self, title, movie, quality, results):
|
||||||
|
|
||||||
q = '"%s %s" %s' % (simplifyString(title), movie['library']['year'], quality.get('identifier'))
|
q = '"%s %s"' % (simplifyString(title), movie['library']['year'])
|
||||||
arguments = tryUrlencode({
|
arguments = tryUrlencode({
|
||||||
'search': q,
|
'search': q,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class ThePirateBay(TorrentMagnetProvider):
|
|||||||
|
|
||||||
urls = {
|
urls = {
|
||||||
'detail': '%s/torrent/%s',
|
'detail': '%s/torrent/%s',
|
||||||
'search': '%s/search/%s/0/7/%d'
|
'search': '%s/search/%s/%s/7/%d'
|
||||||
}
|
}
|
||||||
|
|
||||||
cat_ids = [
|
cat_ids = [
|
||||||
@@ -45,7 +45,12 @@ class ThePirateBay(TorrentMagnetProvider):
|
|||||||
|
|
||||||
def _searchOnTitle(self, title, movie, quality, results):
|
def _searchOnTitle(self, title, movie, quality, results):
|
||||||
|
|
||||||
search_url = self.urls['search'] % (self.getDomain(), tryUrlencode(title + ' ' + quality['identifier']), self.getCatId(quality['identifier'])[0])
|
page = 0
|
||||||
|
total_pages = 1
|
||||||
|
|
||||||
|
while page < total_pages:
|
||||||
|
|
||||||
|
search_url = self.urls['search'] % (self.getDomain(), tryUrlencode('"%s %s"' % (title, movie['library']['year'])), page, self.getCatId(quality['identifier'])[0])
|
||||||
|
|
||||||
data = self.getHTMLData(search_url)
|
data = self.getHTMLData(search_url)
|
||||||
|
|
||||||
@@ -57,6 +62,14 @@ class ThePirateBay(TorrentMagnetProvider):
|
|||||||
if not results_table:
|
if not results_table:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
try:
|
||||||
|
total_pages = len(soup.find('div', attrs = {'align': 'center'}).find_all('a'))
|
||||||
|
page += 1
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
print total_pages, page
|
||||||
|
|
||||||
entries = results_table.find_all('tr')
|
entries = results_table.find_all('tr')
|
||||||
for result in entries[2:]:
|
for result in entries[2:]:
|
||||||
link = result.find(href = re.compile('torrent\/\d+\/'))
|
link = result.find(href = re.compile('torrent\/\d+\/'))
|
||||||
@@ -92,6 +105,7 @@ class ThePirateBay(TorrentMagnetProvider):
|
|||||||
except:
|
except:
|
||||||
log.error('Failed getting results from %s: %s', (self.getName(), traceback.format_exc()))
|
log.error('Failed getting results from %s: %s', (self.getName(), traceback.format_exc()))
|
||||||
|
|
||||||
|
|
||||||
def isEnabled(self):
|
def isEnabled(self):
|
||||||
return super(ThePirateBay, self).isEnabled() and self.getDomain()
|
return super(ThePirateBay, self).isEnabled() and self.getDomain()
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class TorrentLeech(TorrentProvider):
|
|||||||
|
|
||||||
def _searchOnTitle(self, title, movie, quality, results):
|
def _searchOnTitle(self, title, movie, quality, results):
|
||||||
|
|
||||||
url = self.urls['search'] % (tryUrlencode(title.replace(':', '') + ' ' + quality['identifier']), self.getCatId(quality['identifier'])[0])
|
url = self.urls['search'] % (tryUrlencode('%s %s' % (title.replace(':', ''), movie['library']['year'])), self.getCatId(quality['identifier'])[0])
|
||||||
data = self.getHTMLData(url, opener = self.login_opener)
|
data = self.getHTMLData(url, opener = self.login_opener)
|
||||||
|
|
||||||
if data:
|
if data:
|
||||||
|
|||||||
Reference in new issue
Block a user