From c21e5ffe2724dd614d6292c7ffa5705a9afeb566 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Sun, 10 May 2020 14:50:36 +0200 Subject: [PATCH] Moved clean search query outside the class --- deemix/api/deezer.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/deemix/api/deezer.py b/deemix/api/deezer.py index 889b316..0f295a2 100755 --- a/deemix/api/deezer.py +++ b/deemix/api/deezer.py @@ -494,14 +494,14 @@ class Deezer: return 0 return 0 - def clean_search_query(term): - term = str(term) - term = re.sub(r' feat[\.]? ', " ", term) - term = re.sub(r' ft[\.]? ', " ", term) - term = re.sub(r'\(feat[\.]? ', " ", term) - term = re.sub(r'\(ft[\.]? ', " ", term) - term = term.replace('&', " ").replace('–', "-").replace('—', "-") - return term +def clean_search_query(term): + term = str(term) + term = re.sub(r' feat[\.]? ', " ", term) + term = re.sub(r' ft[\.]? ', " ", term) + term = re.sub(r'\(feat[\.]? ', " ", term) + term = re.sub(r'\(ft[\.]? ', " ", term) + term = term.replace('&', " ").replace('–', "-").replace('—', "-") + return term class APIError(Exception): pass