Update paramountplus.py
This commit is contained in:
parent
3b1bbdb7fd
commit
59c6e7fb92
@ -290,7 +290,7 @@ class ParamountPlus(BaseService):
|
|||||||
res = r.json()
|
res = r.json()
|
||||||
raise self.log.exit(res["message"])
|
raise self.log.exit(res["message"])
|
||||||
|
|
||||||
return base64.b64encode(r.content).decode() if self.playready else r.content
|
return r.content
|
||||||
|
|
||||||
def configure(self):
|
def configure(self):
|
||||||
self.region = self.session.get("https://ipinfo.io/json").json()["country"]
|
self.region = self.session.get("https://ipinfo.io/json").json()["country"]
|
||||||
@ -298,32 +298,6 @@ class ParamountPlus(BaseService):
|
|||||||
if self.region != "FR":
|
if self.region != "FR":
|
||||||
self.region = "INTL"
|
self.region = "INTL"
|
||||||
|
|
||||||
#self.device_cache_path = Path(self.get_cache("device_tokens_{profile}.json".format(
|
|
||||||
#profile=self.profile,
|
|
||||||
#)))
|
|
||||||
|
|
||||||
#if self.device_cache_path.exists():
|
|
||||||
#with open(self.device_cache_path, encoding="utf-8") as fd:
|
|
||||||
#date = jsonpickle.decode(fd.read())
|
|
||||||
#if "expiry" in date and datetime.fromisoformat(date["expiry"]) > datetime.now():
|
|
||||||
#self.log.warning(" + Using cached device tokens")
|
|
||||||
#cache = date
|
|
||||||
#else:
|
|
||||||
#self.log.warning(" + Refreshing cookies")
|
|
||||||
#self.device_cache_path.unlink()
|
|
||||||
#if not self.credentials:
|
|
||||||
#raise self.log.exit(" - No credentials provided, unable to log in.")
|
|
||||||
#self.session.headers.update({"user-agent": self.config["Android"]["UserAgent"]})
|
|
||||||
#self.session.params.update({"at": self.config[self.region]["at_token"]})
|
|
||||||
#username = self.credentials.username
|
|
||||||
#password = self.credentials.password
|
|
||||||
#expiry = (datetime.now() + timedelta(minutes=3)).isoformat()
|
|
||||||
#cookie = self.login(username=username, password=password)
|
|
||||||
#cache = {"cookie": cookie, "expiry": expiry}
|
|
||||||
#self.device_cache_path.parent.mkdir(exist_ok=True, parents=True)
|
|
||||||
#with open(self.device_cache_path, "w", encoding="utf-8") as fd:
|
|
||||||
#fd.write(jsonpickle.encode(cache))
|
|
||||||
#else:
|
|
||||||
if not self.credentials:
|
if not self.credentials:
|
||||||
raise self.log.exit(" - No credentials provided, unable to log in.")
|
raise self.log.exit(" - No credentials provided, unable to log in.")
|
||||||
self.log.warning(" + Logging in")
|
self.log.warning(" + Logging in")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user