Don't load full html inside description field. fixes #192
This commit is contained in:
1 parent
7f5bf57055
commit
229157e862
3 files changed
+13
-6
No files matched your search
@@ -67,7 +67,7 @@ class Mysterbin(NZBProvider):
|
|||||||
|
|
||||||
description = ''
|
description = ''
|
||||||
if result.find('a', text = 'View NFO'):
|
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 = {
|
new = {
|
||||||
'id': myster_id,
|
'id': myster_id,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
from BeautifulSoup import BeautifulSoup
|
||||||
from couchpotato.core.event import fireEvent
|
from couchpotato.core.event import fireEvent
|
||||||
from couchpotato.core.helpers.encoding import toUnicode, tryUrlencode
|
from couchpotato.core.helpers.encoding import toUnicode, tryUrlencode
|
||||||
from couchpotato.core.helpers.rss import RSS
|
from couchpotato.core.helpers.rss import RSS
|
||||||
@@ -57,7 +58,10 @@ class NZBClub(NZBProvider, RSS):
|
|||||||
size = enclosure['length']
|
size = enclosure['length']
|
||||||
date = self.getTextElement(nzb, "pubDate")
|
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 = {
|
new = {
|
||||||
'id': nzbclub_id,
|
'id': nzbclub_id,
|
||||||
@@ -73,7 +77,7 @@ class NZBClub(NZBProvider, RSS):
|
|||||||
}
|
}
|
||||||
new['score'] = fireEvent('score.calculate', new, movie, single = True)
|
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'])
|
log.info('Wrong: Seems to be passworded files: %s' % new['name'])
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
from BeautifulSoup import BeautifulSoup
|
||||||
from couchpotato.core.event import fireEvent
|
from couchpotato.core.event import fireEvent
|
||||||
from couchpotato.core.helpers.encoding import toUnicode, tryUrlencode
|
from couchpotato.core.helpers.encoding import toUnicode, tryUrlencode
|
||||||
from couchpotato.core.helpers.rss import RSS
|
from couchpotato.core.helpers.rss import RSS
|
||||||
@@ -62,9 +63,11 @@ class NzbIndex(NZBProvider, RSS):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
description = self.getTextElement(nzb, "description")
|
description = self.getTextElement(nzb, "description")
|
||||||
if ' nfo' in description.lower():
|
if '/nfo/' in description.lower():
|
||||||
nfo_url = re.search('href="(?P<nfo>.+)"', description).group('nfo')
|
nfo_url = re.search('href=\"(?P<nfo>.+)\" ', description).group('nfo')
|
||||||
description = toUnicode(self.getCache('nzbindex.%s' % nzbindex_id, nfo_url, timeout = 25920000))
|
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:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user