Skip to content

Why doesn't my code work? #132

Description

@MAX1MDEV

from kickapi import KickAPI
client = KickAPI(
client_id='',
client_secret=''
)

def get_top_streamers(limit=10):
try:
streams = client.streams.get_live_streams()
sorted_streams = sorted(streams, key=lambda x: x.viewer_count, reverse=True)[:limit]
print(f"Top {limit} live streamers:")
for i, stream in enumerate(sorted_streams, 1):
print(f"{i}. {stream.user_name} - Viewers: {stream.viewer_count}")

except Exception as e:
    print(f"{e}")

if name == "main":
get_top_streamers()

Activity

  1. Scorfly commented on Apr 10, 2025

    @Scorfly
    Contributor

    Hi,

    Why would it work ?

    It's look like python.
    Are you using https://github.com/berkay-digital/kickpython or something else ?
    It's look like the project linked but it does not contain a client.streams.get_live_streams()

    Whatever the project you should open an issue in the related project :D

  2. locked and limited conversation to collaborators on Apr 16, 2025
  3. converted this issue into a discussion #144 on Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions