From 52fc675cb6778bd95adc2617296fa183cec752d1 Mon Sep 17 00:00:00 2001 From: Ruud Date: Fri, 3 Feb 2012 20:37:31 +0100 Subject: [PATCH] Return single RSS element --- couchpotato/core/helpers/rss.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/helpers/rss.py b/couchpotato/core/helpers/rss.py index b0a92315..582d38ac 100644 --- a/couchpotato/core/helpers/rss.py +++ b/couchpotato/core/helpers/rss.py @@ -19,7 +19,7 @@ class RSS(object): def getElements(self, xml, path): - elements = [] + elements = None try: elements = xml.findall(path) except: @@ -27,6 +27,14 @@ class RSS(object): return elements + def getElement(self, xml, path): + ''' Find element and return text''' + + try: + return xml.find(path) + except: + return + def getTextElement(self, xml, path): ''' Find element and return text'''