taegel.models package

Submodules

taegel.models.arguments module

taegel.models.arguments.get_args(args: list[str]) Namespace

Function with all the argument configuration using the argparser library that return the arguments given by the user in a ease to use Namespace object.

taegel.models.regex module

taegel.models.regex.playlist: Pattern = re.compile('^(?:https?://)?(?:www\\.)?(?:youtube\\.com/playlist\\?list=|youtu\\.be/)([^&]{11})')

Regex object to verify if the string is a YouTube playlist URL.

taegel.models.regex.playlist_id: Pattern = re.compile('playlist\\?list=([^&]{34})')

Regex object to verify if the string has an valid video id.

taegel.models.regex.valid: Pattern = re.compile('^(?:https?://)?(?:www\\.)?(?:youtube\\.com/(watch\\?v=|playlist\\?list=)|youtu\\.be/)([^&]{11})')

Regex object to validate if an string is an valid YouTube URL.

taegel.models.regex.video: Pattern = re.compile('^(?:https?://)?(?:www\\.)?(?:youtube\\.com/watch\\?v=|youtu\\.be/)([^&]{11})')

Regex object to verify if the string is a YouTube video URL.

taegel.models.regex.video_id: Pattern = re.compile('watch\\?v=([^&]{11})')

Regex object to verify if the string has an valid video id.

taegel.models.types module

class taegel.models.types.AlbumInfo(target: str = <factory>, sources: list[str] = <factory>)

Bases: object

Class to pack the crucial information to work with.

property as_dict: dict[str, str | list[str]]

Property to get a dict version of an instance of that class to save in the cache database.

sources: list[str]

List of videos to be saved in the target directory.

target: str

Target directory related with the YouTube video links.

class taegel.models.types.ArgsFiltered(videos: list[str] = <factory>, playlists: list[str] = <factory>)

Bases: object

A more organized version of the URL list argument given by the user, instead of just a confusing and long list.

playlists: list[str]

List with only with the playlist URL’s

videos: list[str]

List with only with the videos URL’s

class taegel.models.types.DownloadLog

Bases: TypedDict

Dictionary shape that the controllers.youtube.download() will send throught the pipe to the other processes or functions. Use that class, and that kind of dict, just in that method to share important information to the other parts of the code, set the unused properties as None or False.

channel: Optional[str]

Channel name

status_ok: bool

Success status of the download

task_description: Optional[str]

Log description, to display on the progress bar

task_done: bool

If that task will update the progress bar

title: Optional[str]

Video title string

url: str

Youtube URL string to that specifc video

Module contents