python-xbox 0.2.1__py3-none-any.whl → 0.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: python-xbox
3
- Version: 0.2.1
3
+ Version: 0.3.0
4
4
  Summary: A library to authenticate with Xbox Network and use their API
5
5
  Project-URL: Source, https://github.com/tr4nt0r/python-xbox
6
- Author-email: Manfred Dennerlein Rodelo <manfred@dennerlein.name>
6
+ Author-email: Manfred Dennerlein Rodelo <tr4nt0r@uber.space>
7
7
  License-Expression: MIT
8
8
  License-File: LICENSE
9
9
  Keywords: xbox one live api
@@ -153,7 +153,7 @@ async def async_main():
153
153
  print(
154
154
  f"""
155
155
  Could not refresh tokens from {tokens_file}, err={e}\n
156
- You might have to delete the tokens file and re-authenticate
156
+ You might have to delete the tokens file and re-authenticate
157
157
  if refresh token is expired
158
158
  """
159
159
  )
@@ -1,4 +1,4 @@
1
- pythonxbox/__init__.py,sha256=5vDrOpqmkiLx5oDqC5Wl_ZB0Y0Pc5ZIxZc3HH68GdxY,91
1
+ pythonxbox/__init__.py,sha256=FXnxtSc-yQP4XNZu2en_Xs5bu1_PrO-ubx4BDUNI39s,91
2
2
  pythonxbox/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  pythonxbox/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  pythonxbox/api/client.py,sha256=3OqKJDAk-5Jm3zISwRqnyzJeZPrvzzUeXvvkYyPe7h4,5776
@@ -23,7 +23,7 @@ pythonxbox/api/provider/mediahub/__init__.py,sha256=vit_AYdxxLJH7hrE2BOlIiF7dySz
23
23
  pythonxbox/api/provider/mediahub/models.py,sha256=0dqaUlDpRZVRLEQcgZIVmGT97Ya6T4ccqermXzwXavo,1863
24
24
  pythonxbox/api/provider/message/__init__.py,sha256=jkHyXXD1lpqFAaLlJPrfcV7HjUwA0k_2DXPDSUfnpe4,4388
25
25
  pythonxbox/api/provider/message/models.py,sha256=P1IJblzGUYYPXE04LHSVEUmXeUqm8g5FKrO0jnm9jNE,2026
26
- pythonxbox/api/provider/people/__init__.py,sha256=W8rxTaMIlVvjmr45pskGvQwXFdQsnLzBv2a8Aj9hp30,7933
26
+ pythonxbox/api/provider/people/__init__.py,sha256=PKNsv4UivUkERafQhRCneH1lkJa6VMiJp-e3ciE0V4I,7972
27
27
  pythonxbox/api/provider/people/models.py,sha256=bjS4in0jE-6cVTnPvR8aVFE57KrxIEO_-dUDHWB72l4,6891
28
28
  pythonxbox/api/provider/presence/__init__.py,sha256=oHkOe5-V89CDXClmewjHfdnovB6BPeHMgLbsay5Qhd4,3451
29
29
  pythonxbox/api/provider/presence/models.py,sha256=PbWsOGdf__wJhRp-QqHvv6GLLJkQzp7ZdRz29ICHRWk,1127
@@ -32,8 +32,8 @@ pythonxbox/api/provider/profile/models.py,sha256=RQDnkpe0H1L8OP-CQaQUYOcuk7J3_A0
32
32
  pythonxbox/api/provider/screenshots/__init__.py,sha256=zRmPy4GmpFeoITPPaaIFJlz8ibPc24NGYQ3chXaKIUw,5949
33
33
  pythonxbox/api/provider/screenshots/models.py,sha256=fLmliYx8yzGAiQlsnujCldHKDKjvUGYxEwUz_CUxWow,1176
34
34
  pythonxbox/api/provider/smartglass/__init__.py,sha256=MlkTPZk4Fz_uNOqoUeogaSFyCyGKFG97hnEKXdRSpE0,11632
35
- pythonxbox/api/provider/smartglass/models.py,sha256=NXxzb6i8DYabhfycBd0EboZePZPVac4M_xkQ8AsL23w,4254
36
- pythonxbox/api/provider/titlehub/__init__.py,sha256=728Kp8GBJUX6o2bxQpFY8dJAkQNbJRzlwTjPxcCQJXo,4651
35
+ pythonxbox/api/provider/smartglass/models.py,sha256=KXPwF5cKjQ_RmBhzVrfplIQp-iBFbBgnxXp2Sy4gE5A,4261
36
+ pythonxbox/api/provider/titlehub/__init__.py,sha256=QArYTyPT2lA3lnN9N-PGjHO9kZgseeIwRdIrsXUOaxI,5348
37
37
  pythonxbox/api/provider/titlehub/models.py,sha256=i3YOuRtuDJ26qzJmGzev3OE7ekbKSyXa7em-aeFO028,2557
38
38
  pythonxbox/api/provider/usersearch/__init__.py,sha256=G9q299C9XwF1ajmXbaUrnNF-_HrCjt1-h2XCn1CfaMw,967
39
39
  pythonxbox/api/provider/usersearch/models.py,sha256=C2l8nJJpaHOwXLiUMpnndbhs_MQYiMQdEkWk0JxPbuc,307
@@ -57,8 +57,8 @@ pythonxbox/scripts/change_gamertag.py,sha256=k4tAqc4rDT10a-ethejg9ufs_c-fVJeYK7P
57
57
  pythonxbox/scripts/friends.py,sha256=TmcpLJ3FJaNMCNc5gVyxabgnlFd2hS_tBYautx1xD6s,2139
58
58
  pythonxbox/scripts/search.py,sha256=DusjFE4q10sHVrbdE44kBw0xvv6i_muJqZLCcnO6zzc,1074
59
59
  pythonxbox/scripts/xal.py,sha256=rRM5Opl5GlHykaf4Ad755XzUbdG24tFMVnRCuY6Z1kk,2928
60
- python_xbox-0.2.1.dist-info/METADATA,sha256=aJn55QX5cErPqOG0M9offMSqdpTKvML0TuC7uoByNsU,7707
61
- python_xbox-0.2.1.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
62
- python_xbox-0.2.1.dist-info/entry_points.txt,sha256=9k_ot4_yHrDQTbXDWZPCHtn7S_rJLLv5Sw1Vf__TY78,267
63
- python_xbox-0.2.1.dist-info/licenses/LICENSE,sha256=NylgC1sD9vQJ92ofyOI0lvDYOuvbTyWa-tCSU8KgeeI,1104
64
- python_xbox-0.2.1.dist-info/RECORD,,
60
+ python_xbox-0.3.0.dist-info/METADATA,sha256=BXXqPBOeG6Cti54SOqx8EsAIG1_bx_aP95RFivR8ZuE,7701
61
+ python_xbox-0.3.0.dist-info/WHEEL,sha256=THafob7ofN-NsuMN7Mg4qZyHaQI7KkD-QlcQatYhXPo,87
62
+ python_xbox-0.3.0.dist-info/entry_points.txt,sha256=9k_ot4_yHrDQTbXDWZPCHtn7S_rJLLv5Sw1Vf__TY78,267
63
+ python_xbox-0.3.0.dist-info/licenses/LICENSE,sha256=NylgC1sD9vQJ92ofyOI0lvDYOuvbTyWa-tCSU8KgeeI,1104
64
+ python_xbox-0.3.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.32.0
2
+ Generator: hatchling 1.32.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
pythonxbox/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  """Top-level package for python-xbox."""
2
2
 
3
3
  __author__ = """tr4nt0r"""
4
- __version__ = "0.2.1"
4
+ __version__ = "0.3.0"
@@ -93,7 +93,12 @@ class PeopleProvider(RateLimitedProvider):
93
93
  resp.raise_for_status()
94
94
  return PeopleResponse.model_validate_json(resp.text)
95
95
 
96
- async def get_friend_by_xuid(self, xuid: str, decoration_fields: list[PeopleDecoration] | None = None, **kwargs) -> PeopleResponse:
96
+ async def get_friend_by_xuid(
97
+ self,
98
+ xuid: str,
99
+ decoration_fields: list[PeopleDecoration] | None = None,
100
+ **kwargs,
101
+ ) -> PeopleResponse:
97
102
  """
98
103
  Get a single friend's profile from the authenticated user's perspective
99
104
 
@@ -151,7 +151,7 @@ class CommandDestination(CamelCaseModel):
151
151
  class CommandResponse(CamelCaseModel):
152
152
  result: str | None = None
153
153
  ui_text: str | None = None
154
- destination: CommandDestination
154
+ destination: CommandDestination | None
155
155
  user_info: str | None = None
156
156
  op_id: str
157
157
  status: SmartglassApiStatus
@@ -66,7 +66,11 @@ class TitlehubProvider(BaseProvider):
66
66
  return TitleHubResponse.model_validate_json(resp.text)
67
67
 
68
68
  async def _get_title_info(
69
- self, moniker: str, fields: list[TitleFields] | None = None, **kwargs
69
+ self,
70
+ xuid: str,
71
+ moniker: str,
72
+ fields: list[TitleFields] | None = None,
73
+ **kwargs,
70
74
  ) -> TitleHubResponse:
71
75
  if not fields:
72
76
  fields = [
@@ -78,7 +82,7 @@ class TitlehubProvider(BaseProvider):
78
82
  ]
79
83
  fields = self.SEPARATOR.join(fields)
80
84
 
81
- url = f"{self.TITLEHUB_URL}/users/xuid({self.client.xuid})/titles/{moniker}/decoration/{fields}"
85
+ url = f"{self.TITLEHUB_URL}/users/xuid({xuid})/titles/{moniker}/decoration/{fields}"
82
86
  resp = await self.client.session.get(url, headers=self._headers, **kwargs)
83
87
  resp.raise_for_status()
84
88
  return TitleHubResponse.model_validate_json(resp.text)
@@ -96,7 +100,31 @@ class TitlehubProvider(BaseProvider):
96
100
  Returns:
97
101
  :class:`TitleHubResponse`: Title Hub Response
98
102
  """
99
- return await self._get_title_info(f"titleid({title_id})", fields, **kwargs)
103
+ return await self._get_title_info(
104
+ self.client.xuid, f"titleid({title_id})", fields, **kwargs
105
+ )
106
+
107
+ async def get_title_info_by_xuid(
108
+ self,
109
+ xuid: str,
110
+ title_id: str,
111
+ fields: list[TitleFields] | None = None,
112
+ **kwargs,
113
+ ) -> TitleHubResponse:
114
+ """
115
+ Get info for specific title by XUID
116
+
117
+ Args:
118
+ xuid: XUID of user to get title info for
119
+ title_id: Title Id
120
+ fields: List of title fields
121
+
122
+ Returns:
123
+ :class:`TitleHubResponse`: Title Hub Response
124
+ """
125
+ return await self._get_title_info(
126
+ xuid, f"titleid({title_id})", fields, **kwargs
127
+ )
100
128
 
101
129
  async def get_title_info_by_pfn(
102
130
  self, pfn: str, fields: list[TitleFields] | None = None, **kwargs
@@ -111,7 +139,9 @@ class TitlehubProvider(BaseProvider):
111
139
  Returns:
112
140
  :class:`TitleHubResponse`: Title Hub Response
113
141
  """
114
- return await self._get_title_info(f"pfn({pfn})", fields, **kwargs)
142
+ return await self._get_title_info(
143
+ self.client.xuid, f"pfn({pfn})", fields, **kwargs
144
+ )
115
145
 
116
146
  async def get_titles_batch(
117
147
  self, pfns: list[str], fields: list[TitleFields] | None = None, **kwargs