v module to download video or audio of youtube (uses https://youtugo.com and https://yt-download.org)
v install Saverio976.youtubedl
import saverio976.youtubedl
fn main() {
url := 'https://youtube.com/watch?v=YykjpeuMNEk'
folder := '.'
path := youtubedl.download_audio(url, folder) or { return }
println('the audio is in ${folder}/${path}')
}
you can change download_audio
with download_video
to download not only the audio.
fn download_audio(url string, dir string) !string
download_audio download the audio (mp3) of the given in the
directoryfn download_video(url string, dir string) !string
download_video download the video (mp4) of the given in the
directory