1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00

cmore: fix login issue with the new site

fixes: #804
This commit is contained in:
Johan Andersson 2018-02-24 17:07:14 +01:00
parent 6d3c57a667
commit bdc646b885

View File

@ -114,12 +114,8 @@ class Cmore(Service):
post = {"username": self.options.username, "password": self.options.password,
"operator": self.options.cmoreoperator, "country_code": "se"}
else:
match = re.search('authenticity_token" value="([^"]+)"', res.text)
if not match:
return None, "Can't find authenticity_token needed to login"
post = {"username": self.options.username, "password": self.options.password, "authenticity_token": match.group(1),
"redirect": "true"}
res = self.http.post("https://account.cmore.se/session?client=web", json=post, cookies=self.cookies)
post = {"username": self.options.username, "password": self.options.password}
res = self.http.post("https://account.cmore.se/session?client=cmore-web-prod", json=post, cookies=self.cookies)
if res.status_code >= 400:
return None, "Wrong username or password"
janson = res.json()
@ -127,9 +123,6 @@ class Cmore(Service):
return token, None
def operatorlist(self):
res = self.http.get("https://www.cmore.se/operator/login")
res.encoding = "utf-8"
match = re.findall('<option value="([^"]+)">([^"]+)</option>', res.text)
for i in match:
message = "operator: '{0}' value: '{1}'".format(i[1], i[0].replace("-", ""))
print(message)
res = self.http.get("https://tve.cmore.se/country/se/operator?client=cmore-web")
for i in res.json()["data"]["operators"]:
print("operator: '{0}'".format(i["name"].lower()))