Skip to content

Commit

Permalink
Implement /tv/{channel}/feed endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorbayless committed Jun 11, 2024
1 parent 2a54469 commit 791ea5d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ Most of the API is available:
client.tv.get_current_games
client.tv.stream_current_game
client.tv.stream_current_game_of_channel
client.tv.get_best_ongoing
client.users.get_realtime_statuses
Expand Down
9 changes: 9 additions & 0 deletions berserk/clients/tv.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ def stream_current_game(self) -> Iterator[Dict[str, Any]]:
path = "/api/tv/feed"
yield from self._r.get(path, stream=True)

def stream_current_game_of_channel(self, channel: str) -> Iterator[Dict[str, Any]]:
"""Streams the current TV game of a channel.
:param channel: the TV channel to stream.
:return: positions and moves of the channels current TV game
"""
path = f"/api/tv/{channel}/feed"
yield from self._r.get(path, stream=True)

def get_best_ongoing(
self,
channel: str,
Expand Down

0 comments on commit 791ea5d

Please sign in to comment.