kickpython 0.1.2__tar.gz → 0.1.4__tar.gz
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-0.1.2/kickpython.egg-info → kickpython-0.1.4}/PKG-INFO +1 -1
- {kickpython-0.1.2 → kickpython-0.1.4}/kickpython/api.py +10 -2
- {kickpython-0.1.2 → kickpython-0.1.4/kickpython.egg-info}/PKG-INFO +1 -1
- {kickpython-0.1.2 → kickpython-0.1.4}/setup.py +1 -1
- {kickpython-0.1.2 → kickpython-0.1.4}/.gitignore +0 -0
- {kickpython-0.1.2 → kickpython-0.1.4}/LICENSE +0 -0
- {kickpython-0.1.2 → kickpython-0.1.4}/MANIFEST.in +0 -0
- {kickpython-0.1.2 → kickpython-0.1.4}/README.md +0 -0
- {kickpython-0.1.2 → kickpython-0.1.4}/docs/README.md +0 -0
- {kickpython-0.1.2 → kickpython-0.1.4}/docs/auth.md +0 -0
- {kickpython-0.1.2 → kickpython-0.1.4}/docs/channels.md +0 -0
- {kickpython-0.1.2 → kickpython-0.1.4}/docs/chat.md +0 -0
- {kickpython-0.1.2 → kickpython-0.1.4}/docs/configuration.md +0 -0
- {kickpython-0.1.2 → kickpython-0.1.4}/kickpython/__init__.py +0 -0
- {kickpython-0.1.2 → kickpython-0.1.4}/kickpython/examples/listen_all_channels.py +0 -0
- {kickpython-0.1.2 → kickpython-0.1.4}/kickpython/examples/oauth.py +0 -0
- {kickpython-0.1.2 → kickpython-0.1.4}/kickpython/py.typed +0 -0
- {kickpython-0.1.2 → kickpython-0.1.4}/kickpython.egg-info/SOURCES.txt +0 -0
- {kickpython-0.1.2 → kickpython-0.1.4}/kickpython.egg-info/dependency_links.txt +0 -0
- {kickpython-0.1.2 → kickpython-0.1.4}/kickpython.egg-info/top_level.txt +0 -0
- {kickpython-0.1.2 → kickpython-0.1.4}/pyproject.toml +0 -0
- {kickpython-0.1.2 → kickpython-0.1.4}/requirements-dev.txt +0 -0
- {kickpython-0.1.2 → kickpython-0.1.4}/requirements.txt +0 -0
- {kickpython-0.1.2 → kickpython-0.1.4}/setup.cfg +0 -0
|
@@ -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,
|
|
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 =
|
|
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
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|