Podcast

class AzuracastPy.models.Podcast(id: str, storage_location_id: int, title: str, link: str, description: str, language: str, author: str, email: str, has_custom_art: bool, art: str, art_updated_at: int, categories: List[str], episodes: List[str], links: Links, _station)

Represents a podcast on a station.

__init__(id: str, storage_location_id: int, title: str, link: str, description: str, language: str, author: str, email: str, has_custom_art: bool, art: str, art_updated_at: int, categories: List[str], episodes: List[str], links: Links, _station)

Initializes a Podcast object.

Note

This class should not be initialized directly. Instead, obtain an instance via: create(), __call__() or podcasts().

category

An instance of PodcastCategoryHelper.

Provides the interface for working with this podcast’s categories.

For example, to add one or more categories to this podcast:

from AzuracastPy.enums import PodcastCategories

podcast.category.add(PodcastCategories.GOVERNMENT)

podcast.category.add(
    PodcastCategories.Arts.BOOKS,
    PodcastCategories.HISTORY
)

To remove one or more categories from this podcast:

from AzuracastPy.enums import PodcastCategories

podcast.category.remove(PodcastCategories.GOVERNMENT)

podcast.category.remove(
    PodcastCategories.Arts.BOOKS,
    PodcastCategories.HISTORY
)
delete()

Deletes the podcast from the station.

Sets all attributes of the current Podcast object to None.

Usage:

podcast.delete()
edit(title: str | None = None, description: str | None = None, language: Languages | None = None, categories: List[PodcastCategories] | None = None, author: str | None = None, email: str | None = None, website: str | None = None)

Edits the podcast’s properties.

Updates all edited attributes of the current Podcast object.

Parameters:
  • title – (Optional) The new title of the podcast. Default: None.

  • description – (Optional) The new description of the podcast. Default: None.

  • language – (Optional) The new language of the podcast. Default: None.

  • categories

    (Optional) A list of the categories that the podcast falls under. Each element of the list must be from the PodcastCategories class. Default: None.

    Warning

    This will overwrite the podcast’s existing categories. Use the add() and remove() methods to interact with the podcast’s existing categories.

  • author – (Optional) The new author of the podcast. Default: None.

  • email – (Optional) The new email of the podcast. Default: None.

  • website – (Optional) The new website url of the podcast. Default: None.

Usage:

from AzuracastPy.enums import Languages, PodcastCategories

podcast.edit(
    title="New title",
    language=Languages.BULGARIAN,
    categories=[
        PodcastCategories.GOVERNMENT,
        PodcastCategories.HISTORY
    ]
)
episode

An instance of PodcastEpisodeHelper.

Provides the interface for working with this podcast’s episodes.

For example, to get all the episodes in this podcast:

episodes = podcast.episode.all()

To get an episode with an ID of "episode-id":

episode = podcast.episode("episode-id")

To create a new podcast episode:

episode = podcast.episode.create(
    title="Tis a podcast",
    description="I'm not sure, but this might be a podcast",
    explicit=True
)