Patch for language string

This commit is contained in:
RemixDev 2022-03-05 11:35:52 +01:00
parent 4b5ae9990c
commit b912a92270
No known key found for this signature in database
GPG key ID: B33962B465BDB51C

View file

@ -143,6 +143,11 @@ class Deezer:
if len(self.childs)-1 < child_n: child_n = 0 if len(self.childs)-1 < child_n: child_n = 0
self.current_user = self.childs[child_n] self.current_user = self.childs[child_n]
self.selected_account = child_n self.selected_account = child_n
lang = re.sub(r"[^0-9A-Za-z *,-.;=]", "", str(self.current_user['language']))
if lang[2:1] == '-':
lang = lang[0:5]
else:
lang = lang[0:2]
self.http_headers["Accept-Language"] = re.sub(r"[^0-9A-Za-z *,-.;=]", "", str(self.current_user['language'])) self.http_headers["Accept-Language"] = re.sub(r"[^0-9A-Za-z *,-.;=]", "", str(self.current_user['language']))
return (self.current_user, self.selected_account) return (self.current_user, self.selected_account)