From: Arthur Taft Date: Fri, 7 Feb 2025 07:56:19 +0000 (-0700) Subject: Add Necessary Files X-Git-Url: https://gitweb.arthurtaft.net/yt-dlp-wrapper.git/commitdiff_plain/c1123d6853362fbc826e0ae0c0cd1e21fe9d803c?ds=sidebyside;hp=70e8ea7198c2852d2c856d5219fc1398fb630abb Add Necessary Files Added Necessary Files --- diff --git a/bin/ffmpeg.exe b/bin/ffmpeg.exe new file mode 100644 index 0000000..35dd63d Binary files /dev/null and b/bin/ffmpeg.exe differ diff --git a/bin/yt-dlp.exe b/bin/yt-dlp.exe new file mode 100644 index 0000000..15e3f95 Binary files /dev/null and b/bin/yt-dlp.exe differ diff --git a/yt-dlp-wrapper.ps1 b/yt-dlp-wrapper.ps1 new file mode 100644 index 0000000..5704e6b --- /dev/null +++ b/yt-dlp-wrapper.ps1 @@ -0,0 +1,37 @@ +# Set Variables +$Path = Join-Path -Path $HOME -ChildPath "\Documents\YouTube" +$exe = Join-Path -Path $Path -ChildPath "\yt-dlp.exe" +$val = 0 +$url = "" + +# Switch to directory with executable +Set-Location $Path + +# Remove old executable +Remove-Item yt-dlp.exe + +# Download new executable +Invoke-WebRequest https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe -OutFile $exe + + +while($val -ne 1) { + # Ask the user if they are downloading audio or video + $Type = Read-Host "Audio or Video?" + + # Download audio + if($Type -eq "audio") { + $url = Read-Host "Enter URL Here" + ./yt-dlp.exe -x -f 'ba' --audio-format mp3 -o $HOME'\Music\YouTube\output\%(title)s.%(ext)s' $url + $val++ + } + # Download video + elseif($Type -eq "video"){ + $url = Read-Host "Enter URL Here" + ./yt-dlp.exe -f 'bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b' -o $HOME'\Video\output\%(title)s.%(ext)s' $url + $val++ + } + else { + Write-Output "Response must be 'Audio' or 'Video'!" + continue + } +} \ No newline at end of file