kopia lustrzana https://github.com/bugout-dev/moonstream
Add fixes.
rodzic
268401a3d9
commit
0d64319046
|
@ -170,8 +170,10 @@ class Moonstream:
|
||||||
self.api.endpoints[ENDPOINT_TOKEN],
|
self.api.endpoints[ENDPOINT_TOKEN],
|
||||||
data={"username": username, "password": password},
|
data={"username": username, "password": password},
|
||||||
)
|
)
|
||||||
token = r.text
|
r.raise_for_status()
|
||||||
self.authorize(token)
|
|
||||||
|
token = r.json()
|
||||||
|
self.authorize(token["id"])
|
||||||
return token
|
return token
|
||||||
|
|
||||||
def logout(self) -> None:
|
def logout(self) -> None:
|
||||||
|
@ -217,7 +219,7 @@ class Moonstream:
|
||||||
"""
|
"""
|
||||||
self.requires_authorization()
|
self.requires_authorization()
|
||||||
r = self._session.post(
|
r = self._session.post(
|
||||||
ENDPOINT_SUBSCRIPTIONS,
|
self.api.endpoints[ENDPOINT_SUBSCRIPTIONS],
|
||||||
data={
|
data={
|
||||||
"subscription_type_id": subscription_type,
|
"subscription_type_id": subscription_type,
|
||||||
"label": label,
|
"label": label,
|
||||||
|
@ -355,9 +357,9 @@ class Moonstream:
|
||||||
def events(
|
def events(
|
||||||
self,
|
self,
|
||||||
start_time: int,
|
start_time: int,
|
||||||
include_start: bool,
|
|
||||||
end_time: int,
|
end_time: int,
|
||||||
include_end: bool,
|
include_start: bool = False,
|
||||||
|
include_end: bool = False,
|
||||||
q: str = "",
|
q: str = "",
|
||||||
) -> Dict[str, Any]:
|
) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
|
|
Ładowanie…
Reference in New Issue