Created
January 4, 2023 22:27
-
-
Save notchum/7bd0bb07e7f005f5135679f2bff58c71 to your computer and use it in GitHub Desktop.
Use youtube-dlp to download Youtube videos by dragging a .URL file onto a batch script.
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
echo off | |
setlocal enableextensions enabledelayedexpansion | |
pushd %1 | |
for %%F in (%1) do ( | |
echo %%~dpnxF | |
call :findurl "%%~dpnxF" | |
) | |
popd | |
yt-dlp.exe -x --audio-format mp3 %url% | |
del %1 | |
timeout 5 | |
:findurl inputfile | |
set url= | |
for /f "tokens=3 delims==" %%i in ('findstr URL %1') do set url=%%i | |
echo %url% | |
echo ----- |
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
echo off | |
setlocal enableextensions enabledelayedexpansion | |
pushd %1 | |
for %%F in (%1) do ( | |
echo %%~dpnxF | |
call :findurl "%%~dpnxF" | |
) | |
popd | |
:: Change path below to file destination | |
CD /D E:\User Files\Videos\Youtube-dl | |
yt-dlp.exe -f "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b" %url% | |
del %1 | |
timeout 5 | |
:findurl inputfile | |
set url= | |
for /f "tokens=3 delims==" %%i in ('findstr URL %1') do set url=%%i | |
echo %url% | |
echo ----- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment