Browse Source

Don't use quality identifier in title searches

pull/1316/head
Ruud 12 years ago
parent
commit
61a0bb8ec6
  1. 5
      couchpotato/core/providers/nzb/binsearch/main.py
  2. 6
      couchpotato/core/providers/nzb/nzbclub/main.py
  3. 2
      couchpotato/core/providers/nzb/nzbindex/main.py
  4. 2
      couchpotato/core/providers/torrent/scenehd/main.py
  5. 18
      couchpotato/core/providers/torrent/thepiratebay/main.py
  6. 2
      couchpotato/core/providers/torrent/torrentleech/main.py

5
couchpotato/core/providers/nzb/binsearch/main.py

@ -22,11 +22,10 @@ class BinSearch(NZBProvider):
def _search(self, movie, quality, results):
q = '%s %s' % (movie['library']['identifier'], quality.get('identifier'))
arguments = tryUrlencode({
'q': q,
'q': movie['library']['identifier'],
'm': 'n',
'max': 250,
'max': 400,
'adv_age': Env.setting('retention', 'nzb'),
'adv_sort': 'date',
'adv_col': 'on',

6
couchpotato/core/providers/nzb/nzbclub/main.py

@ -20,13 +20,13 @@ class NZBClub(NZBProvider, RSS):
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({
'q': q,
'ig': '1',
'ig': 1,
'rpp': 200,
'st': 1,
'st': 5,
'sp': 1,
'ns': 1,
})

2
couchpotato/core/providers/nzb/nzbindex/main.py

@ -23,7 +23,7 @@ class NzbIndex(NZBProvider, RSS):
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({
'q': q,
'age': Env.setting('retention', 'nzb'),

2
couchpotato/core/providers/torrent/scenehd/main.py

@ -22,7 +22,7 @@ class SceneHD(TorrentProvider):
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({
'search': q,
})

18
couchpotato/core/providers/torrent/thepiratebay/main.py

@ -15,7 +15,7 @@ class ThePirateBay(TorrentMagnetProvider):
urls = {
'detail': '%s/torrent/%s',
'search': '%s/search/%s/0/7/%d'
'search': '%s/search/%s/%s/7/%d'
}
cat_ids = [
@ -45,7 +45,12 @@ class ThePirateBay(TorrentMagnetProvider):
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)
@ -57,6 +62,14 @@ class ThePirateBay(TorrentMagnetProvider):
if not results_table:
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')
for result in entries[2:]:
link = result.find(href = re.compile('torrent\/\d+\/'))
@ -92,6 +105,7 @@ class ThePirateBay(TorrentMagnetProvider):
except:
log.error('Failed getting results from %s: %s', (self.getName(), traceback.format_exc()))
def isEnabled(self):
return super(ThePirateBay, self).isEnabled() and self.getDomain()

2
couchpotato/core/providers/torrent/torrentleech/main.py

@ -34,7 +34,7 @@ class TorrentLeech(TorrentProvider):
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)
if data:

Loading…
Cancel
Save