Skip to content

Instantly share code, notes, and snippets.

@awave1
Last active September 22, 2020 02:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awave1/f4e0bb03328fc29053af9f77e5c238a4 to your computer and use it in GitHub Desktop.
Save awave1/f4e0bb03328fc29053af9f77e5c238a4 to your computer and use it in GitHub Desktop.
function dl
set prev (pwd)
set songs "$HOME/Documents/Music/Songs"
cd $songs
youtube-dl -x --audio-format \"wav\" $argv
cd $prev
end
# open powershell
# open $profile in an editor (`code $profile`, for example)
# paste this function
# save the file and type `. $profile` to update the current PS session
function dl {
param (
[switch] $acapella
)
$prev_location = (Get-Location).Path
if ($acapella) {
Set-Location 'D:\samples and oneshots\ACAPELLAS'
}
else {
Set-Location 'D:\samples and oneshots\Songs'
}
youtube-dl.exe -x --audio-format wav $args[0]
Set-Location $prev_location
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment