mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-22 01:23:43 +00:00
Improvements to PublicHD provider code
This commit is contained in:
parent
fad6876e4f
commit
049282ccb9
1 changed files with 8 additions and 2 deletions
|
@ -132,14 +132,20 @@ class PublicHDProvider(generic.TorrentProvider):
|
||||||
|
|
||||||
if mode == 'RSS':
|
if mode == 'RSS':
|
||||||
searchURL = self.url + 'index.php?page=torrents&active=1&category=%s' % (
|
searchURL = self.url + 'index.php?page=torrents&active=1&category=%s' % (
|
||||||
';'.join(self.categories[mode]))
|
';'.join(self.categories[mode]))
|
||||||
logger.log(u"PublicHD cache update URL: " + searchURL, logger.DEBUG)
|
logger.log(u"PublicHD cache update URL: " + searchURL, logger.DEBUG)
|
||||||
else:
|
else:
|
||||||
searchURL = self.searchurl % (
|
searchURL = self.searchurl % (
|
||||||
urllib.quote(unidecode(search_string)), ';'.join(self.categories[mode]))
|
urllib.quote(unidecode(search_string)), ';'.join(self.categories[mode]))
|
||||||
logger.log(u"Search string: " + searchURL, logger.DEBUG)
|
logger.log(u"Search string: " + searchURL, logger.DEBUG)
|
||||||
|
|
||||||
|
|
||||||
html = self.getURL(searchURL)
|
html = self.getURL(searchURL)
|
||||||
|
|
||||||
|
#remove unneccecary <option> lines which are slowing down BeautifulSoup
|
||||||
|
optreg = re.compile(r'<option.*</option>')
|
||||||
|
html = os.linesep.join([s for s in html.splitlines() if not optreg.search(s)])
|
||||||
|
|
||||||
if not html:
|
if not html:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue