From 45a6369b34de66309b4e2994e587bb733d816356 Mon Sep 17 00:00:00 2001 From: vincent Date: Tue, 14 May 2019 21:28:29 +0200 Subject: [PATCH] add remove space if no result --- backend/chainetv/emission.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/chainetv/emission.py b/backend/chainetv/emission.py index 8ecab50..472055e 100644 --- a/backend/chainetv/emission.py +++ b/backend/chainetv/emission.py @@ -33,6 +33,9 @@ class Emmission(object): pass strsearch=strsearch.replace('É','E') linkchaine=self.html.find(text=re.compile(re.escape(strsearch))) + if linkchaine == None: + strsearch=strsearch.replace(" ","") + linkchaine=self.html.find(text=re.compile(re.escape(strsearch))) if linkchaine == None: return "can't find channel" link = linkchaine.parent.parent.find_next_sibling().find("a")