Private GIT

Skip to content
Snippets Groups Projects
Commit 37b6aac6 authored by miigotu's avatar miigotu
Browse files

Change xthor so indents are less

Fix __getitem__ error in xthor
Fixes https://github.com/SickRage/sickrage-issues/issues/140
parent 9dbaec31
No related branches found
No related tags found
No related merge requests found
...@@ -85,19 +85,27 @@ class XthorProvider(generic.TorrentProvider): ...@@ -85,19 +85,27 @@ class XthorProvider(generic.TorrentProvider):
searchURL = self.urlsearch % (urllib.quote(search_string), self.categories) searchURL = self.urlsearch % (urllib.quote(search_string), self.categories)
logger.log(u"Search URL: %s" % searchURL, logger.DEBUG) logger.log(u"Search URL: %s" % searchURL, logger.DEBUG)
data = self.getURL(searchURL) data = self.getURL(searchURL)
if not data: if not data:
continue continue
with BS4Parser(data, features=["html5lib", "permissive"]) as html: with BS4Parser(data, features=["html5lib", "permissive"]) as html:
resultsTable = html.find("table", {"class" : "table2 table-bordered2"}) resultsTable = html.find("table", {"class" : "table2 table-bordered2"})
if resultsTable: if not resultsTable:
continue
rows = resultsTable.findAll("tr") rows = resultsTable.findAll("tr")
for row in rows: for row in rows:
link = row.find("a", href=re.compile("details.php")) link = row.find("a", href=re.compile("details.php"))
if link: if not link:
continue
title = link.text title = link.text
download_url = self.url + '/' + row.find("a", href=re.compile("download.php"))['href'] download_item = row.find("a", href=re.compile("download.php"))
if not download_item:
continue
download_url = self.url + '/' + download_item['href']
# FIXME # FIXME
size = -1 size = -1
seeders = 1 seeders = 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment