diff --git a/modules/dlfp/backend.py b/modules/dlfp/backend.py index 7acdd0ef..37eab6e4 100644 --- a/modules/dlfp/backend.py +++ b/modules/dlfp/backend.py @@ -101,7 +101,7 @@ class DLFPBackend(BaseBackend, ICapMessages, ICapMessagesPost, ICapContent): # Check if we have seen all comments of this thread. oldhash = self.storage.get('hash', id, default="") newhash = self.browser.get_hash(thread._rsscomment) - if not getseen and oldhash == newhash: + if not getseen and (oldhash == newhash or newhash is None): return None self.storage.set('hash', id, newhash) self.storage.save() diff --git a/modules/dlfp/browser.py b/modules/dlfp/browser.py index 9e55900f..0f0160d8 100644 --- a/modules/dlfp/browser.py +++ b/modules/dlfp/browser.py @@ -133,8 +133,10 @@ class DLFP(BaseBrowser): def get_hash(self, url): self.location(url) - myhash = hashlib.md5(lxml.etree.tostring(self.page.document)).hexdigest() - return myhash + if self.page.document.xpath('//entry'): + return hashlib.md5(lxml.etree.tostring(self.page.document)).hexdigest() + else: + return None def get_content(self, _id): url, _id = self.parse_id(_id)