Cleanup BitSoup
This commit is contained in:
@@ -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,19 +34,19 @@ 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')
|
||||||
|
|
||||||
torrent = all_cells[1].find('a')
|
torrent = all_cells[1].find('a')
|
||||||
download = all_cells[3].find('a')
|
download = all_cells[3].find('a')
|
||||||
|
|
||||||
torrent_id = torrent['href']
|
torrent_id = torrent['href']
|
||||||
torrent_id = torrent_id.replace('details.php?id=', '')
|
torrent_id = torrent_id.replace('details.php?id=', '')
|
||||||
torrent_id = torrent_id.replace('&hit=1', '')
|
torrent_id = torrent_id.replace('&hit=1', '')
|
||||||
|
|
||||||
torrent_name = torrent.getText()
|
torrent_name = torrent.getText()
|
||||||
|
|
||||||
torrent_size = self.parseSize(all_cells[7].getText())
|
torrent_size = self.parseSize(all_cells[7].getText())
|
||||||
@@ -54,7 +54,7 @@ class Bitsoup(TorrentProvider):
|
|||||||
torrent_leechers = tryInt(all_cells[10].getText())
|
torrent_leechers = tryInt(all_cells[10].getText())
|
||||||
torrent_url = self.urls['baseurl'] % download['href']
|
torrent_url = self.urls['baseurl'] % download['href']
|
||||||
torrent_detail_url = self.urls['baseurl'] % torrent['href']
|
torrent_detail_url = self.urls['baseurl'] % torrent['href']
|
||||||
|
|
||||||
results.append({
|
results.append({
|
||||||
'id': torrent_id,
|
'id': torrent_id,
|
||||||
'name': torrent_name,
|
'name': torrent_name,
|
||||||
@@ -79,6 +79,6 @@ class Bitsoup(TorrentProvider):
|
|||||||
|
|
||||||
def loginSuccess(self, output):
|
def loginSuccess(self, output):
|
||||||
return 'logout.php' in output.lower()
|
return 'logout.php' in output.lower()
|
||||||
|
|
||||||
loginCheckSuccess = loginSuccess
|
loginCheckSuccess = loginSuccess
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user