toktokkie.utils.anithemes package

Submodules

toktokkie.utils.anithemes.AniTheme module

class toktokkie.utils.anithemes.AniTheme.AniTheme(show_name: str, mal_id: int, theme_type: str, song_name: str, episodes: str, media_url: str)

Bases: object

Class that contains all relevant information for an anime theme song. Uses reddit and myanimelist to retrieve all the information # TODO Integrate AniDB, since it has way more info on artists etc

__init__(show_name: str, mal_id: int, theme_type: str, song_name: str, episodes: str, media_url: str)

Initializes the anime theme. Loads missing data from the internet while initializing, so this might take up to a couple of seconds. :param show_name: The name of the show this songe is a theme song for :param mal_id: The myanimelist ID of that show :param theme_type: The type of theme (example: OP, ED) :param song_name: The name of the song :param episodes: During which episodes the theme song played :param media_url: The URL to the video of this theme song

convert_to_mp3()

Converts the previously downloaded webm file to mp3 :return: None

download_webm()

Downloads the .webm video of the anime theme song to the tmp directory :return: None

classmethod load_reddit_anithemes_wiki_info(year: int, season: str, whitelist: Optional[List[str]] = None) → List[toktokkie.utils.anithemes.AniTheme.AniTheme]

Loads all theme songs for a specific season and year CAUTION: Currently season does nothing, it is recommended to use the whitelist parameter to limit the requests done :param year: The year for which to fetch the theme songs :param season: The season for which to fetch the theme songs :param whitelist: If provided, will ignore any series that are not

contained in the whitelist

Returns

The fetched AniTheme objects

logger = <Logger toktokkie.utils.anithemes.AniTheme (WARNING)>

Logger for this class

mal_cache: Dict[int, Dict[str, Any]] = {}

Cache for repeated myanimelist requests

Module contents