reddit: ignore posts from an author with no name

This commit is contained in:
moneromooo 2015-03-13 20:12:25 +00:00
parent 8564fc6990
commit 890b385c03
1 changed files with 8 additions and 0 deletions

View File

@ -105,6 +105,14 @@ class RedditNetwork(Network):
def _parse(self,item,is_pm):
if not hasattr(item,'author'):
return
if not hasattr(item.author,'name'):
log_warn('author of %s has no name field, ignored' % str(item.id))
try:
item.mark_as_read()
except Exception,e:
log_warning('Failed to mark %s as read: %s' % (item.id,str(e)))
return
author=self.canonicalize(item.author.name)
if author==self.canonicalize(self.login):
return