diff --git a/couchpotato/core/providers/nzb/mysterbin/main.py b/couchpotato/core/providers/nzb/mysterbin/main.py index 06936f9..0f7ffb3 100644 --- a/couchpotato/core/providers/nzb/mysterbin/main.py +++ b/couchpotato/core/providers/nzb/mysterbin/main.py @@ -67,7 +67,7 @@ class Mysterbin(NZBProvider): description = '' if result.find('a', text = 'View NFO'): - description = toUnicode(self.getCache('mysterbin.%s' % myster_id, self.urls['nfo'] % myster_id, timeout = 25920000)) + description = toUnicode(self.getCache('mysterbin.%s' % myster_id, self.urls['nfo'] % myster_id, cache_timeout = 25920000)) new = { 'id': myster_id, diff --git a/couchpotato/core/providers/nzb/nzbclub/main.py b/couchpotato/core/providers/nzb/nzbclub/main.py index eb33fe1..2c672f8 100644 --- a/couchpotato/core/providers/nzb/nzbclub/main.py +++ b/couchpotato/core/providers/nzb/nzbclub/main.py @@ -1,3 +1,4 @@ +from BeautifulSoup import BeautifulSoup from couchpotato.core.event import fireEvent from couchpotato.core.helpers.encoding import toUnicode, tryUrlencode from couchpotato.core.helpers.rss import RSS @@ -57,7 +58,10 @@ class NZBClub(NZBProvider, RSS): size = enclosure['length'] date = self.getTextElement(nzb, "pubDate") - description = toUnicode(self.getCache('nzbclub.%s' % nzbclub_id, self.getTextElement(nzb, "link"), timeout = 25920000)) + full_description = self.getCache('nzbclub.%s' % nzbclub_id, self.getTextElement(nzb, "link"), cache_timeout = 25920000) + html = BeautifulSoup(full_description) + nfo_pre = html.find('pre', attrs = {'class':'nfo'}) + description = toUnicode(nfo_pre.text) if nfo_pre else '' new = { 'id': nzbclub_id, @@ -73,7 +77,7 @@ class NZBClub(NZBProvider, RSS): } new['score'] = fireEvent('score.calculate', new, movie, single = True) - if 'ARCHIVE inside ARCHIVE' in description: + if 'ARCHIVE inside ARCHIVE' in full_description: log.info('Wrong: Seems to be passworded files: %s' % new['name']) continue diff --git a/couchpotato/core/providers/nzb/nzbindex/main.py b/couchpotato/core/providers/nzb/nzbindex/main.py index 22e202b..0b708b2 100644 --- a/couchpotato/core/providers/nzb/nzbindex/main.py +++ b/couchpotato/core/providers/nzb/nzbindex/main.py @@ -1,3 +1,4 @@ +from BeautifulSoup import BeautifulSoup from couchpotato.core.event import fireEvent from couchpotato.core.helpers.encoding import toUnicode, tryUrlencode from couchpotato.core.helpers.rss import RSS @@ -62,9 +63,11 @@ class NzbIndex(NZBProvider, RSS): try: description = self.getTextElement(nzb, "description") - if ' nfo' in description.lower(): - nfo_url = re.search('href="(?P.+)"', description).group('nfo') - description = toUnicode(self.getCache('nzbindex.%s' % nzbindex_id, nfo_url, timeout = 25920000)) + if '/nfo/' in description.lower(): + nfo_url = re.search('href=\"(?P.+)\" ', description).group('nfo') + full_description = self.getCache('nzbindex.%s' % nzbindex_id, url = nfo_url, cache_timeout = 25920000) + html = BeautifulSoup(full_description) + description = toUnicode(html.find('pre', attrs = {'id':'nfo0'}).text) except: pass