It seems some fields are not returned from the upstream API despite being included in the response body of the search channels endpoint : https://dev.twitch.tv/docs/api/reference/#search-channels
The code from Twitch.search_channels (in twitch.py) is returning a SearchChannelResult which is subclass of ChannelInformation.
However according to Twitch API docs the response bodies of these 2 endpoints are not exactly the same:
Get Channel Information (get_channel_information in twitch.py)
broadcaster_id String An ID that uniquely identifies the broadcaster.
broadcaster_name String The broadcaster’s display name.
Search Channels (search_channels in twitch.py)
id String An ID that uniquely identifies the channel (this is the broadcaster’s ID).
display_name String The broadcaster’s display name.
thumbnail_url String A URL to a thumbnail of the broadcaster’s profile image.
So maybe we should have:
class ChannelInformation(TwitchObject):
broadcaster_id: str
broadcaster_name: str
...
class SearchChannelResult(ChannelInformation):
id: str
display_name: str
thumbnail_url: str
...
Instead of the current SearchChannelResult which only return a subset of the fields it could because of variable naming differences.
The current class for reference:
class SearchChannelResult(ChannelInformation):
is_live: bool
tags_ids: List[str]
started_at: datetime
If needed maybe I can provide a fix? I didn't see any contributing guidelines anywhere on the repository, or if pull requests are welcome here.
It seems some fields are not returned from the upstream API despite being included in the response body of the search channels endpoint : https://dev.twitch.tv/docs/api/reference/#search-channels The code from Twitch.search_channels (in twitch.py) is returning a SearchChannelResult which is subclass of ChannelInformation.
However according to Twitch API docs the response bodies of these 2 endpoints are not exactly the same:
So maybe we should have:
Instead of the current SearchChannelResult which only return a subset of the fields it could because of variable naming differences. The current class for reference:
If needed maybe I can provide a fix? I didn't see any contributing guidelines anywhere on the repository, or if pull requests are welcome here.