From e805e16fca65bd0b56bbe7231a8d26b4cbfa947d Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Mon, 3 Jul 2017 17:56:40 +0200 Subject: [PATCH] Add image support --- feedler/models/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/feedler/models/models.py b/feedler/models/models.py index 47b3e4e..330369f 100644 --- a/feedler/models/models.py +++ b/feedler/models/models.py @@ -58,7 +58,11 @@ class Entry(models.Model): if len(raw['alternate']) > 0: self.link = raw['alternate'][0]['href'] - if 'visual' in raw and 'url' in raw['visual']: + + if 'enclosure' in raw and len(raw['enclosure']) > 0: + if 'href' in raw['enclosure'][0]: + self.visual = raw['enclosure'][0]['href'] + elif 'visual' in raw and 'url' in raw['visual']: self.visual = raw['visual']['url'] self._buildContent()