Station Mount Point Helper

class AzuracastPy.models.helpers.MountPointHelper(_station)

Provides a set of functions to interact with mount points.

__call__(id: int) MountPoint

Retrieves a specific mount point from the station.

Parameters:

id – The numerical ID of the mount point to be retrieved.

Returns:

A MountPoint object.

Usage:

mount_point = station.mount_point(1)
__init__(_station)

Initializes a MountPointHelper instance.

Note

This class should not be initialized directly. Instead, obtain an instance via: mount_point.

create(url: str, display_name: str | None = None, show_on_public_pages: bool = True, is_default: bool = False, is_public: bool = True, relay_stream_url: str | None = None, max_listener_duration: int = 0, fallback_mount: str = '/error.mp3', enable_autodj: bool = True, autodj_format: Formats = Formats.MP3, autodj_bitrate: Bitrates = Bitrates.BITRATE_128, custom_url: str | None = None, custom_frontend_config: Dict[str, Any] | str | None = None) MountPoint

Adds a mount point to the station.

Parameters:
  • url – The URL assigned to the mount point. Must be a valid URL, such as "/autodj.mp3".

  • display_name – (Optional) The display name assigned to this mount point when viewing it on administrative or public pages. Leave as None to automatically generate one. Default: None.

  • show_on_public_pages – Determines whether listeners are allowed to select this mount point on this station’s public pages. Default: True.

  • is_default – Determines whether this mount will be played on the radio preview and the public radio page in this system. Default: False.

  • is_public – Determines whether this mount will be advertised on “Yellow Pages” public radio directories. Default: True.

  • relay_stream_url – (Optional) The full URL of another stream to relay its broadcast through this mount point. Default: None.

  • max_listener_duration – The length of time (seconds) a listener will stay connected to the stream. Set to 0 to let listeners stay connected infinitely. Default: 0.

  • fallback_mount – The mount point users will be redirected to if this mount point is not playing audio. Default: "/error.mp3", a repeating error message.

  • enable_autodj – Determines whether the AutoDJ will automatically play music to this mount point. Default: True.

  • autodj_format – The format of the audio AutoDJ will play on this mount point. Default: Formats.MP3.

  • autodj_bitrate – The bitrate of the audio AutoDJ will play on this mount point. Default: Bitrates.BITRATE_128.

  • custom_url – (Optional) A custom URL for this stream that AzuraCast will use when referring to it. Leave as None to use the default value. Default: None.

  • custom_frontend_config – (Optional) Special mount point settings, in either JSON: { key: 'value' } or XML: <key>value</key>. Default: None.

Returns:

A MountPoint object for the newly created mount point.

Usage:

from AzuracastPy.enums import Formats

mount_point = station.mount_point.create(
    url="/autodj.mp3",
    display_name="Hehehehe",
    autodj_format=Formats.OPUS
)