Replies: 1 comment
-
This means that this code snippet allows you to access all clips of broadcaster 1234567, not just the first page: async for clip in twitch.get_clips(broadcaster_id='1234567'):
print(clip.url) However I do agree that, while this is not actually a problem for what you mentioned here, it makes sense to also expose the current cursor for all api calls where I currently only return a basic AsyncGenerator. Issue for that will be #343 Edit: from pathlib import PurePath
from twitchAPI.helper import first
from twitchAPI.twitch import Twitch
from twitchAPI.oauth import UserAuthenticationStorageHelper
import asyncio
from test_data import data as td
async def run():
twitch = await Twitch(td['app_id'], td['secret'])
helper = UserAuthenticationStorageHelper(twitch, [], PurePath('user_token.json'))
await helper.bind()
game = await first(twitch.get_games(names="Escape from Tarkov"))
count = 0
async for clip in twitch.get_clips(game_id=game.id):
count += 1
print(clip)
print(count)
await twitch.close()
asyncio.run(run()) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When attempting to get clips via the library, it is currently impossible to fetch over 100 clips. This is because while the
get_clips()
function allows you to specify abefore
andafter
, it does not actually give any access to thepagination
object. For some reason, even though the library is apparently capable of iterating over multiple API calls, the function itself still applies a hard cap of 100 clip IDs.This seems to be a pretty critical oversight, and I'm unfortunately unable to use this library for my project.
(Relevant: #56)
Beta Was this translation helpful? Give feedback.
All reactions