asyncyt.utils module¶
- async asyncyt.utils.call_callback(callback, *args, **kwargs)[source]¶
Call a callback, supporting both coroutine and regular functions.
- Parameters:
callback – The callback function to call.
args – Positional arguments for the callback.
kwargs – Keyword arguments for the callback.
- asyncyt.utils.clean_youtube_url(url: str) str[source]¶
Clean any YouTube URL (watch, youtu.be, shorts, embed) into its core form.
- Parameters:
url (str) – The youtube URL
- Returns:
Cleaned YouTube URL.
- asyncyt.utils.get_id(url: str, config: DownloadConfig)[source]¶
Generate a unique ID for a download based on URL and config.
- Parameters:
url (str) – Download URL.
config (DownloadConfig) – Download configuration.
- Returns:
SHA256 hash string.
- Return type:
str