sounds.stations

Classes

StationService

Base class for other classes to inherit shared session and state

Module Contents

class sounds.stations.StationService(streaming_service: sounds.streaming.StreamingService, schedule_service: sounds.schedules.ScheduleService, **kwargs)

Bases: sounds.base.Base

Base class for other classes to inherit shared session and state

streams
schedules
async get_stations_detailed() List[sounds.models.Network] | None
async get_stations(include_local: bool = False, include_streams: bool = False, include_schedules: bool = False) list[sounds.models.LiveStation]

Gets the list of all stations

Returns:

A list of Station objects

Return type:

list[Station]

async get_local_stations() List[sounds.models.LiveStation]
async get_station_schedule(station_id: str, include_stream: bool = False, include_schedule: bool = False, date: str | None = None) sounds.models.LiveStation | None

Gets a station’s details

Returns:

A Station object

Return type:

Station

async get_station(station_id: str, include_stream: bool = False, stream_format: Literal['hls'] | Literal['dash'] = 'hls', include_schedule: bool = False, date: str | None = None) sounds.models.LiveStation | None

Get a live radio station

Args:

station_id (str): ID of the station, e.g. bbc_radio_four include_stream (bool, optional): Set LiveStation.stream to the stream URL. Defaults to False. stream_format (Literal[“hls”] | Literal[“dash”], optional): Stream format preference. Defaults to “hls”. include_schedule (bool, optional): Set LiveStation.schedule to the station schedule. Defaults to False. date (str | None, optional): The date of the schedule, if include_schedule is True. Defaults to None.

Returns:

LiveStation | None: A LiveStation object if station_id is found

async get_broadcast(pid: str)