Teekeks / pyTwitchAPI

A Python 3.7 compatible implementation of the Twitch API, EventSub, PubSub and Chat
https://pytwitchapi.dev
MIT License
256 stars 38 forks source link

create_clip throws an exception when passed a stream that doesn't allow clipping #298

Closed janovak closed 7 months ago

janovak commented 8 months ago

Calling create_clip and passing a broadcaster Id that does not allow clips results in the following error.

  File "/Users/gb/PycharmProjects/JOCR-Bot2/venv/lib/python3.11/site-packages/twitchAPI/twitch.py", line 585, in _build_result
    d = data['data']
        ~~~~^^^^^^^^
KeyError: 'data'

Reproing is as simple as calling create_clip and passing a streamer who is currently live and does not allow clipping. Three popular streamers I just ran into this issue with are moonmoon, emiru, and rubius.

As an aside, there isn't any API I can query to check if the streamer has disabled clipping, correct?