Youtube Downloader

modusa.download(url, content_type, output_dir)[source]

Downloads audio/video from YouTube.

# To download audio
import modusa as ms
audio_fp = ms.download(
        url="https://www.youtube.com/watch?v=lIpw9-Y_N0g",
        content_type="audio",
        output_dir=".")
Parameters:
  • url (str) – Link to the YouTube video.

  • content_type (str) – “audio” or “video”

  • output_dir (str | Path) – Directory to save the YouTube content.

Returns:

File path of the downloaded content.

Return type:

Path