Skip to content

Episodes

Module with the episodes endpoint

Episodes (Endpoint)

Class with the episodes endpoint

Source code in async_spotify/api/_endpoints/episodes.py
class Episodes(Endpoint):
    """
    Class with the episodes endpoint
    """

    async def get_one(self, episode_id: str, auth_token: SpotifyAuthorisationToken = None, **kwargs) -> dict:
        """
        Get an Episode

        Notes:
            [https://developer.spotify.com/documentation/web-api/reference/episodes/get-an-episode/](https://developer.spotify.com/documentation/web-api/reference/episodes/get-an-episode/)

        Args:
            episode_id: The id of the episode
            auth_token: The auth token if you set the api class not to keep the token in memory
            kwargs: Optional arguments as keyword args

        Returns:
            A episode
        """

        required_args = {"id": episode_id}
        args = {**required_args, **kwargs}

        url, args = self._add_url_params(URLS.EPISODES.ONE, args)
        response = await self.api_request_handler.make_request('GET', url, args, auth_token)

        return response

    async def get_multiple(self, episode_ids: List[str], auth_token: SpotifyAuthorisationToken = None,
                           **kwargs) -> dict:
        """
        Get Several Episodes

        Notes:
            [https://developer.spotify.com/documentation/web-api/reference/episodes/get-several-episodes/](https://developer.spotify.com/documentation/web-api/reference/episodes/get-several-episodes/)

        Args:
            episode_ids: A list of episode ids
            auth_token: The auth token if you set the api class not to keep the token in memory
            kwargs: Optional arguments as keyword args

        Returns:
            A list of episodes
        """

        required_args = {"ids": episode_ids}
        args = {**required_args, **kwargs}
        response = await self.api_request_handler.make_request('GET', URLS.EPISODES.MULTIPLE, args, auth_token)

        return response

get_multiple(self, episode_ids, auth_token=None, **kwargs) async

Get Several Episodes

Parameters:

Name Type Description Default
episode_ids List[str]

A list of episode ids

required
auth_token SpotifyAuthorisationToken

The auth token if you set the api class not to keep the token in memory

None
kwargs

Optional arguments as keyword args

{}

Returns:

Type Description
dict

A list of episodes

Source code in async_spotify/api/_endpoints/episodes.py
async def get_multiple(self, episode_ids: List[str], auth_token: SpotifyAuthorisationToken = None,
                       **kwargs) -> dict:
    """
    Get Several Episodes

    Notes:
        [https://developer.spotify.com/documentation/web-api/reference/episodes/get-several-episodes/](https://developer.spotify.com/documentation/web-api/reference/episodes/get-several-episodes/)

    Args:
        episode_ids: A list of episode ids
        auth_token: The auth token if you set the api class not to keep the token in memory
        kwargs: Optional arguments as keyword args

    Returns:
        A list of episodes
    """

    required_args = {"ids": episode_ids}
    args = {**required_args, **kwargs}
    response = await self.api_request_handler.make_request('GET', URLS.EPISODES.MULTIPLE, args, auth_token)

    return response

get_one(self, episode_id, auth_token=None, **kwargs) async

Get an Episode

Parameters:

Name Type Description Default
episode_id str

The id of the episode

required
auth_token SpotifyAuthorisationToken

The auth token if you set the api class not to keep the token in memory

None
kwargs

Optional arguments as keyword args

{}

Returns:

Type Description
dict

A episode

Source code in async_spotify/api/_endpoints/episodes.py
async def get_one(self, episode_id: str, auth_token: SpotifyAuthorisationToken = None, **kwargs) -> dict:
    """
    Get an Episode

    Notes:
        [https://developer.spotify.com/documentation/web-api/reference/episodes/get-an-episode/](https://developer.spotify.com/documentation/web-api/reference/episodes/get-an-episode/)

    Args:
        episode_id: The id of the episode
        auth_token: The auth token if you set the api class not to keep the token in memory
        kwargs: Optional arguments as keyword args

    Returns:
        A episode
    """

    required_args = {"id": episode_id}
    args = {**required_args, **kwargs}

    url, args = self._add_url_params(URLS.EPISODES.ONE, args)
    response = await self.api_request_handler.make_request('GET', url, args, auth_token)

    return response

Last update: April 27, 2020