sounds.streaming¶
Classes¶
Base class for other classes to inherit shared session and state |
Module Contents¶
- class sounds.streaming.StreamingService(auth: sounds.auth.AuthService, schedules: sounds.schedule.ScheduleService, user: sounds.user.UserService, requests: sounds.requests.RequestManager, *args, **kwargs)¶
Bases:
sounds.base.BaseBase class for other classes to inherit shared session and state
- auth¶
- schedules¶
- user¶
- requests: sounds.requests.RequestManager¶
- async get_stream_jwt_token(station_id)¶
Requests a JWT token for a given station.
For now, this also works for non-UK listeners, returning a non-UK stream when used.
- async get_podcasts() sounds.models.Menu¶
- async get_podcast(urn=None, pid=None, include_episodes=True) sounds.models.Podcast | sounds.models.RadioSeries¶
- async get_podcast_episodes(pid) List[sounds.models.PodcastEpisode | sounds.models.RadioShow | sounds.models.RadioClip] | None¶
- async get_podcast_episode(pid, include_stream=False) sounds.models.PodcastEpisode¶
- async get_radio_series(urn, include_episodes=True) sounds.models.RadioSeries¶
- async get_radio_show(pid, include_stream=False) sounds.models.RadioShow¶
- async get_live_stream(station_id: str, stream_format: Literal['hls'] | Literal['dash'] = 'hls') str | None¶
- get_best_stream(streams: dict, prefer_type: Literal['hls'] | Literal['dash'] = 'hls') str | None¶
Looks for the first valid stream with the requested format.
- async get_episode_stream(episode_id: str, stream_format: Literal['hls'] | Literal['dash'] = 'hls') str | None¶
Gets the stream for a specified episode.
- Parameters:
episode_id – str
- Returns:
Stream object of stream information
- Return type:
str | None
- async get_by_pid(pid, include_stream=False, stream_format: Literal['hls'] | Literal['dash'] = 'hls') sounds.models.SoundsTypes¶
- async get_pid_container(pid) List[sounds.models.PlayableItem] | None¶
- async get_container(urn) list[sounds.models.SoundsTypes] | sounds.models.SoundsTypes | sounds.models.Container¶
- async get_heartbeat_details(pid)¶
- async update_play_status(pid: str, elapsed_time: int, action: sounds.constants.PlayStatus)¶
- async get_category(category) sounds.models.Category¶
- async get_collection(pid) sounds.models.Collection¶
- async get_playlist_contents(pid) list[sounds.models.SoundsTypes]¶
Gets a curation/playlist.
- async search(query) sounds.models.SearchResults¶
- async get_show_segments(vpid, fetch_missing_images: bool = False) List[sounds.models.Segment]¶