Fix feedparser without tags
This commit is contained in:
parent
47bb705502
commit
2fef42bfc2
1 changed files with 8 additions and 7 deletions
|
@ -49,12 +49,13 @@ def parse(obj, raw, stream):
|
||||||
|
|
||||||
# Collect tags
|
# Collect tags
|
||||||
tags = []
|
tags = []
|
||||||
for tag in obj.raw['tags']:
|
if 'tags' in obj.raw:
|
||||||
if 'label' in tag:
|
for tag in obj.raw['tags']:
|
||||||
label = tag['label'].replace(',','-')
|
if 'label' in tag:
|
||||||
label = label.strip().lower()
|
label = tag['label'].replace(',','-')
|
||||||
if len(label) > 3 and not label in tags:
|
label = label.strip().lower()
|
||||||
tags.append(label)
|
if len(label) > 3 and not label in tags:
|
||||||
obj.tags = ','.join(tags)
|
tags.append(label)
|
||||||
|
obj.tags = ','.join(tags)
|
||||||
|
|
||||||
return obj
|
return obj
|
||||||
|
|
Loading…
Reference in a new issue