File tree Expand file tree Collapse file tree
xbox/webapi/authentication Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010
1111from xbox .webapi .authentication .models import (
1212 OAuth2TokenResponse ,
13- TitleEndpointsResponse ,
1413 XAUResponse ,
1514 XSTSResponse ,
1615)
@@ -81,14 +80,6 @@ async def refresh_tokens(self) -> None:
8180 if not (self .xsts_token and self .xsts_token .is_valid ()):
8281 self .xsts_token = await self .request_xsts_token ()
8382
84- async def get_title_endpoints (self ) -> TitleEndpointsResponse :
85- url = "https://title.mgt.xboxlive.com/titles/default/endpoints"
86- headers = {"x-xbl-contract-version" : "1" }
87- params = {"type" : 1 }
88- resp = await self .session .get (url , headers = headers , params = params )
89- resp .raise_for_status ()
90- return TitleEndpointsResponse (** resp .json ())
91-
9283 async def request_oauth_token (self , authorization_code : str ) -> OAuth2TokenResponse :
9384 """Request OAuth2 token."""
9485 return await self ._oauth2_token_request (
Original file line number Diff line number Diff line change 55"""
66import uuid
77
8- from xbox .webapi .authentication .models import XADResponse
8+ import httpx
9+
10+ from xbox .webapi .authentication .models import TitleEndpointsResponse , XADResponse
911from xbox .webapi .common .signed_session import SignedSession
1012
1113
1214class XALManager :
1315 def __init__ (self , session : SignedSession ):
1416 self .session = session
1517
18+ @staticmethod
19+ async def get_title_endpoints (session : httpx .AsyncClient ) -> TitleEndpointsResponse :
20+ url = "https://title.mgt.xboxlive.com/titles/default/endpoints"
21+ headers = {"x-xbl-contract-version" : "1" }
22+ params = {"type" : 1 }
23+ resp = await session .get (url , headers = headers , params = params )
24+ resp .raise_for_status ()
25+ return TitleEndpointsResponse (** resp .json ())
26+
1627 async def request_device_token (self , device_id : uuid .UUID ) -> XADResponse :
1728 url = "https://device.auth.xboxlive.com/device/authenticate"
1829 headers = {"x-xbl-contract-version" : "1" }
You can’t perform that action at this time.
0 commit comments