sitcom_simulator.music.integrations.freepd

Functions

download_file(url)

Given a URL, downloads the file and returns the path to the downloaded file.

download_random_music(category)

Given a category, downloads a random song from FreePD in that category and returns the path to the downloaded file.

Classes

MusicCategory(value[, names, module, ...])

The different categories of music available on FreePD.

class sitcom_simulator.music.integrations.freepd.MusicCategory(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

The different categories of music available on FreePD.

UPBEAT = 'upbeat'
EPIC = 'epic'
HORROR = 'horror'
ROMANTIC = 'romantic'
COMEDY = 'comedy'
WORLD = 'world'
SCORING = 'scoring'
ELECTRONIC = 'electronic'
MISC = 'misc'
classmethod values()

Returns a list of the values of the enum members.

sitcom_simulator.music.integrations.freepd.download_random_music(category)

Given a category, downloads a random song from FreePD in that category and returns the path to the downloaded file.

Parameters:

category (MusicCategory) – The category of music to download

Return type:

tuple[str | None, str]

Returns:

The path to the downloaded file

sitcom_simulator.music.integrations.freepd.download_file(url)

Given a URL, downloads the file and returns the path to the downloaded file.

Parameters:

url (str) – The URL of the file to download

Returns:

The path to the downloaded file