Skip to content

download ¤

TVSD Download Class

Download ¤

Download(
    target: Show | Season | Episode,
    specials_only: bool = False,
)

A class for downloading TV show episodes.

Attributes:

  • _target (Show | Season | Episode) –

    The target show, season or episode to download.

  • _base_path (str) –

    The base path for the downloaded files.

  • _temp_base_path (str) –

    The temporary base path for the downloaded files.

  • _specials_index (int) –

    The index for special episodes.

  • _regular_ep_index (int) –

    The index for regular episodes.

  • _specials_only (bool) –

    Whether to download only special episodes.

Parameters:

  • target (Show | Season | Episode) –

    The target show, season or episode to download.

  • specials_only (bool, default: False ) –

    Whether to download only special episodes. Defaults to False.

choose_download ¤

choose_download(season: Season) -> None

Choose which episodes in a season to download.

Parameters:

  • season (Season) –

    The season to choose episodes from.

download_all ¤

download_all(target: Season | Show | Episode) -> None

Download all episodes under the specified Season/Show/Episode.

Parameters:

Raises:

  • TypeError

    If the target is not a Show, Season or Episode.

download_episode ¤

download_episode(episode: Episode) -> None

Download an episode

Parameters:

  • episode (Episode) –

    Episode to download

Raises:

  • ValueError

    m3u8 not found in episode url, Stream probably does not exist

Downloads an episode by fetching its m3u8 url and converting it to an mp4 file. If the episode already exists in the destination directory, it skips the download.

guided_download ¤

guided_download() -> None

Guided download of show.

This method prompts the user to choose whether to download all episodes of a show or a specific season. If the user chooses to download all episodes, the download_all method is called with the target show as the argument. If the user chooses to download a specific season, the choose_download method is called with the target season as the argument.

set_ep_index ¤

set_ep_index(episode: Episode) -> None

Set index for episode

This method sets the index for a given episode. If the episode is a special episode, it calls the set_special_ep_index method, otherwise it calls the set_regular_ep_index method.

Parameters:

  • episode (Episode) –

    Episode to set index for

set_regular_ep_index ¤

set_regular_ep_index(episode: Episode) -> None

Set the index for a regular episode.

Parameters:

  • episode (Episode) –

    The episode to set the index for.

set_special_ep_index ¤

set_special_ep_index(episode: Episode) -> None

Set the index for a special episode.

Parameters:

  • episode (Episode) –

    The episode to set the index for.