Skip to content

sok.media.video.series

TV Series media class for video organization.

Provides the Series class for searching, retrieving metadata, and organizing TV series files with proper season/episode structure.

Series

class Series(name: str, language: str, media_manager: UniversalMediaManager)

Bases: BaseMedia

Class for managing TV series.

Provides functionality to search for series, retrieve season and episode information, and compute folder structures for organization.

Initialize a Series instance.

Parameters

NameTypeDescription
namestrThe series name.
languagestrLanguage code (e.g., 'fr', 'en').
media_managerUniversalMediaManagerThe API manager instance.
Source

Attributes

NameTypeDescription
episodesDict[str, str]

Dictionary mapping episode codes to titles (e.g., {'S01E01': 'Pilot'}).

seasonsDict[str, int]

Dictionary mapping season names to season numbers.

get_episode_info

def get_episode_info(episode_code: str) -> Optional[str]:

Retrieve the episode title from its code.

Parameters

NameTypeDescription
episode_codestrEpisode code (e.g., 'S01E01').

Returns

  • Optional[str]Episode title or None if not found.
Source

get_episodesasync

async def get_episodes() -> None:

Retrieve information about all episodes of all seasons.

Fills the episodes dictionary with format {'S01E01': 'Episode Title'}.

Source

get_folder_structure

def get_folder_structure() -> List[str]:

Return the recommended folder structure for the series.

Returns

  • List[str]List of folder names (e.g., ['Breaking Bad', 'Season 01']).
Source

get_formatted_name

def get_formatted_name() -> str:

Return the formatted series name.

Returns

  • strFormatted series title.
Source

get_season_episodes

def get_season_episodes(season_number: int) -> Dict[str, str]:

Retrieve all episodes of a specific season.

Parameters

NameTypeDescription
season_numberintThe season number.

Returns

  • Dict[str, str]Dictionary mapping episode codes to titles for the season.
Source

get_seasonsasync

async def get_seasons() -> None:

Retrieve information about the series seasons.

Fills the seasons dictionary with available seasons.

Raises

  • ValueErrorIf no ID found for the series.
Source
Built with Kiln