kickpython 0.1.2__py3-none-any.whl → 0.1.4__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.
kickpython/api.py CHANGED
@@ -21,7 +21,8 @@ class KickAPI:
21
21
  base_url="https://api.kick.com/public/v1",
22
22
  oauth_base_url="https://id.kick.com",
23
23
  db_path="kick_tokens.db",
24
- proxy=None, proxy_auth=None, **kwargs):
24
+ proxy=None, proxy_auth=None,
25
+ token_refresh_interval=3600, **kwargs):
25
26
  self.base_url = base_url
26
27
  self.oauth_base_url = oauth_base_url
27
28
  self.client_id = client_id
@@ -35,7 +36,7 @@ class KickAPI:
35
36
  self.message_handlers = []
36
37
  self.session = None
37
38
  self.refresh_task = None
38
- self._refresh_interval = 3600 # Refresh tokens every hour
39
+ self._refresh_interval = token_refresh_interval # Refresh tokens every hour
39
40
  self._should_refresh = False
40
41
 
41
42
  # Initialize database if needed
@@ -264,6 +265,8 @@ class KickAPI:
264
265
  # Get channel_id if not provided
265
266
  if not channel_id:
266
267
  channel_id = await self.get_broadcaster_id(token_data["access_token"])
268
+ token_data["channel_id"] = channel_id
269
+
267
270
  if not channel_id:
268
271
  logger.error("Could not determine broadcaster ID from token")
269
272
  return None
@@ -276,6 +279,11 @@ class KickAPI:
276
279
  token_data["expires_in"],
277
280
  token_data["scope"]
278
281
  )
282
+ try:
283
+ channel_name = await self.fetch_channel_username(channel_id)
284
+ await self.get_chatroom_id(channel_name)
285
+ except Exception as e:
286
+ logger.error(f"Failed to fetch channel info: {e}")
279
287
 
280
288
  return token_data
281
289
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: kickpython
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: Python wrapper for Kick.com API
5
5
  Home-page: https://github.com/berkay-digital/kickpython
6
6
  Author: berkay.digital
@@ -0,0 +1,10 @@
1
+ kickpython/__init__.py,sha256=kBeAyCTyN4fTvXXNk0gPGYMnpEl4KEsqVKy5Fd17D_0,153
2
+ kickpython/api.py,sha256=sL1kjvShw07xbkpN42_5A8Q7MpwzGJnX3QFetNrjQ7w,31238
3
+ kickpython/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ kickpython/examples/listen_all_channels.py,sha256=QhdqJopIKG-8sIpaRBYa8m7j1WH2Mk7e3hydBhrs9vw,3399
5
+ kickpython/examples/oauth.py,sha256=KkdWvXRRG-LlRb-vtZUVA3BbvVFCsSg02sRED8c4qqU,6615
6
+ kickpython-0.1.4.dist-info/LICENSE,sha256=Eq9Igq8OyVjZRODIgyVcVjG4TBJUELQCpG-ULLNTw9Q,1070
7
+ kickpython-0.1.4.dist-info/METADATA,sha256=jBwViYBQPVdDad4UU0Jcod841O_XayfK3eqJBpIhWvk,4752
8
+ kickpython-0.1.4.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
9
+ kickpython-0.1.4.dist-info/top_level.txt,sha256=mDDQz6hz_Z8Vc4djAyfeKkoZK5UgBJbQJfGVP9_Jh-w,11
10
+ kickpython-0.1.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.1)
2
+ Generator: setuptools (75.8.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,10 +0,0 @@
1
- kickpython/__init__.py,sha256=kBeAyCTyN4fTvXXNk0gPGYMnpEl4KEsqVKy5Fd17D_0,153
2
- kickpython/api.py,sha256=4cXmef_8VUymLdfFSRlEZ9gUubzMYbqF5gQmSS0iYLA,30865
3
- kickpython/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- kickpython/examples/listen_all_channels.py,sha256=QhdqJopIKG-8sIpaRBYa8m7j1WH2Mk7e3hydBhrs9vw,3399
5
- kickpython/examples/oauth.py,sha256=KkdWvXRRG-LlRb-vtZUVA3BbvVFCsSg02sRED8c4qqU,6615
6
- kickpython-0.1.2.dist-info/LICENSE,sha256=Eq9Igq8OyVjZRODIgyVcVjG4TBJUELQCpG-ULLNTw9Q,1070
7
- kickpython-0.1.2.dist-info/METADATA,sha256=4YDfQ17_iUuK4sAxBI-yrJr3G1FMcBFHfVaTMdazVu0,4752
8
- kickpython-0.1.2.dist-info/WHEEL,sha256=nn6H5-ilmfVryoAQl3ZQ2l8SH5imPWFpm1A5FgEuFV4,91
9
- kickpython-0.1.2.dist-info/top_level.txt,sha256=mDDQz6hz_Z8Vc4djAyfeKkoZK5UgBJbQJfGVP9_Jh-w,11
10
- kickpython-0.1.2.dist-info/RECORD,,