Last active
September 23, 2016 12:38
-
-
Save gsmitheidw/eba9ee3606e8ffb750ca06bb4af61e17 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Grab mp3 creates mp3s from youtube-dl in a format that works in more devices which may have issues with VBR etc | |
# | |
# Requires: chocolately from chocolately.org then run this commented out line in an escalated powershell prompt: | |
# cinst youtube-dl ffmpeg lame -y --allowEmptyChecksums # some of these don't currently have checksums enabled by their maintainers | |
# Probably best to put this script somewhere in your system path | |
# Set up graphical input/output | |
Add-Type -AssemblyName Microsoft.VisualBasic | |
$link = "" #null | |
$link = [Microsoft.VisualBasic.Interaction]::InputBox('Paste in youtube URL or playlist url', 'grab-mp3') | |
# optional non-graphical input, could use passed in arguments but then have to worry about delimiting certain characters etc | |
#$link = Read-Host -Prompt 'Paste in youtube url or playlist url' | |
# Process input through youtube-dl then lame | |
youtube-dl --prefer-ffmpeg --extract-audio --audio-format wav -o "%(title)s.%(ext)s" --restrict-filenames --exec 'lame --add-id3v2 --tt {} -b 192 -q 0 {} && del {}' $link # not using Remove-Item by design | |
[Microsoft.VisualBasic.Interaction]::MsgBox("Music Processed!", "OKOnly,SystemModal,Information", "grab-mp3") | |
# write-host "Completed\n" # but with no error checking whatsover |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment