Cleanup BitSoup

This commit is contained in:
Ruud
2013-07-09 23:31:43 +02:00
parent 182987218b
commit 318daaf083
2 changed files with 22 additions and 8 deletions
@@ -28,6 +28,20 @@ config = [{
'default': '', 'default': '',
'type': 'password', 'type': 'password',
}, },
{
'name': 'seed_ratio',
'label': 'Seed ratio',
'type': 'float',
'default': 1,
'description': 'Will not be (re)moved until this seed ratio is met.',
},
{
'name': 'seed_time',
'label': 'Seed time',
'type': 'int',
'default': 40,
'description': 'Will not be (re)moved until this seed time (in hours) is met.',
},
{ {
'name': 'extra_score', 'name': 'extra_score',
'advanced': True, 'advanced': True,
@@ -22,7 +22,7 @@ class Bitsoup(TorrentProvider):
def _searchOnTitle(self, title, movie, quality, results): def _searchOnTitle(self, title, movie, quality, results):
q = '"%s %s"' % (simplifyString(title), movie['library']['year']) q = '"%s" %s' % (simplifyString(title), movie['library']['year'])
arguments = tryUrlencode({ arguments = tryUrlencode({
'search': q, 'search': q,
}) })
@@ -34,8 +34,8 @@ class Bitsoup(TorrentProvider):
html = BeautifulSoup(data) html = BeautifulSoup(data)
try: try:
resultsTable = html.find_all('table')[8] result_table = html.find('table', attrs = {'class': 'koptekst'})
entries = resultsTable.find_all('tr') entries = result_table.find_all('tr')
for result in entries[1:]: for result in entries[1:]:
all_cells = result.find_all('td') all_cells = result.find_all('td')