fix kickass website compatibility (closes #457)
This commit is contained in:
parent
285774ba0f
commit
e8de9f5579
2 changed files with 8 additions and 1 deletions
|
|
@ -38,7 +38,13 @@ class TorrentsPage(BasePage):
|
||||||
title += red.tail
|
title += red.tail
|
||||||
idt = tr.getchildren()[0].getchildren()[1].getchildren()[1].attrib.get('href', '').replace('/', '') \
|
idt = tr.getchildren()[0].getchildren()[1].getchildren()[1].attrib.get('href', '').replace('/', '') \
|
||||||
.replace('.html', '')
|
.replace('.html', '')
|
||||||
url = tr.getchildren()[0].getchildren()[0].getchildren()[0].getchildren()[0].attrib.get('href', '')
|
|
||||||
|
# look for url
|
||||||
|
child = tr.getchildren()[0]
|
||||||
|
while child.attrib.get('href', None) is None and len(child.getchildren()) > 0:
|
||||||
|
child = child.getchildren()[0]
|
||||||
|
url = child.get('href', '')
|
||||||
|
|
||||||
size = tr.getchildren()[1].text
|
size = tr.getchildren()[1].text
|
||||||
u = tr.getchildren()[1].getchildren()[0].text
|
u = tr.getchildren()[1].getchildren()[0].text
|
||||||
size = size = size.replace(',', '.')
|
size = size = size.replace(',', '.')
|
||||||
|
|
|
||||||
|
|
@ -23,4 +23,5 @@ class KickassTest(BackendTest):
|
||||||
def test_torrent(self):
|
def test_torrent(self):
|
||||||
l = list(self.backend.iter_torrents('debian'))
|
l = list(self.backend.iter_torrents('debian'))
|
||||||
if len(l) > 0:
|
if len(l) > 0:
|
||||||
|
assert l[0].url.endswith('.torrent')
|
||||||
self.backend.get_torrent_file(l[0].id)
|
self.backend.get_torrent_file(l[0].id)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue