fix parsing of file lists on some gazelle websites
This commit is contained in:
parent
aaa5b215ad
commit
c9d40ffb44
1 changed files with 9 additions and 5 deletions
|
|
@ -194,11 +194,15 @@ class TorrentsPage(BasePage):
|
||||||
torrent.description = u''
|
torrent.description = u''
|
||||||
torrent.description += u'%s\n\n%s\n' % (title, body)
|
torrent.description += u'%s\n\n%s\n' % (title, body)
|
||||||
|
|
||||||
div = self.document.getroot().cssselect('div#files_%s,div#filelist_%s,tr#torrent_%s td' % (torrentid, torrentid, torrentid))
|
divs = self.document.getroot().cssselect('div#files_%s,div#filelist_%s,tr#torrent_%s td' % (torrentid, torrentid, torrentid))
|
||||||
if div:
|
if divs:
|
||||||
torrent.files = []
|
torrent.files = []
|
||||||
for tr in div[0].find('table'):
|
for div in divs:
|
||||||
if tr.attrib.get('class', None) != 'colhead_dark':
|
table = div.find('table')
|
||||||
torrent.files.append(tr.find('td').text)
|
if table is None:
|
||||||
|
continue
|
||||||
|
for tr in table:
|
||||||
|
if tr.attrib.get('class', None) != 'colhead_dark':
|
||||||
|
torrent.files.append(tr.find('td').text)
|
||||||
|
|
||||||
return torrent
|
return torrent
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue