Youtube music downloader

Discuss and share scripts and script files...
Post Reply
40k
Posts: 234
Joined: 09 Dec 2011 21:25

Youtube music downloader

Post by 40k »

This small script will take a link to a Youtube (music) video and will process the .flv file into a local mp4 file. It uses both VLC and FFmpeg binaries which are both FOSS. You probably need to change the path variables to suit your file system.
The sequence is like this:

1. Enter URL, artist, title and select folder to save mp4 file to.
2. VLC runs and streams your Youtube link to a local buffer file.
3. FFmpeg runs and converts the buffer using LAVF to a standard mp4. It also writes metadata Artist and Title to the file.
4. Xyplorer deletes the buffer file.

Change the code if you need video files downloaded. The combination of Xyplorer + VLC + FFmpeg is extremely powerful :)

Code: Select all


"Single link"
 $YoutubeURL = input("Enter Youtube URL",,,,,,,);						//Link URL
 $Artist = input("Enter Artist",,,,,,,);								//Artist and title used for metadata
 $Title = input("Enter Title",,,,,,,);
 $OutputFolder = inputfolder(D:\System Local\,"Select Output Folder");  //Output folder
 $VLCPath = "D:\System Appdata\VLC\VLC.exe";							//Local Path for vlc.exe
 $FFmpegPath = "D:\System Appdata\FFmpeg\bin\ffmpeg.exe";				//Local Path for FFmpeg.exe
 
  run """$VLCPath"""." ".$YoutubeURL." "."--sout="."""#std{access=file,mux=ogg,dst='$OutputFolder\VLCbuffer.m4a'}"""." "."vlc://quit",,1,;
  run """$FFmpegPath"""." -i "."""$OutputFolder\VLCbuffer.m4a"""." -metadata Artist="."""$Artist"""." -metadata Title="."""$Title"""." "."""$OutputFolder\$Artist - $Title.m4a""",,1,;
  delete 0,0,"$OutputFolder\VLCbuffer.m4a";
I develop scripts that integrate media functionality into Xyplorer.
Hash - Twitch.tv in VLC (NEW 2.0!) - FFmpeg GUI - Youtube downloading
XYplorer for Linux! Tutorial

Post Reply