YouTube-DL Batch Script

Wrote a convenient batch script for a friend not comfortable with using YouTube-DL via the command-line interface. Thought it may come in handy for others too. This is convenient even for me because I forget the parameters from time to time too lol.

This script is also available on GitHub Gist.

@echo off
echo Checking for update...
if exist youtube-dl.exe ( goto :computeSum ) else ( 
    echo It seems like you don't have youtube-dl on your computer. 
    goto :download 
)
:computeSum
setlocal enableextensions enabledelayedexpansion
set /a counter = 0
for /f "delims=" %%i in ('CertUtil -hashfile .\youtube-dl.exe MD5') DO (
    set /a counter+=1
    if !counter!==2 (
        set hash1=%%i
    )
)
endlocal && set hash1=%hash1%
echo Downloading checksum file...
echo.
powershell -Command "Invoke-WebRequest https://github.com/ytdl-org/youtube-dl/releases/latest/download/MD5SUMS -OutFile tmp.txt"
echo Finished!
echo.
setlocal enableextensions enabledelayedexpansion
set /a counter = 0
for /f "delims= " %%i in (tmp.txt) DO (
    set /a counter+=1
    if !counter!==2 (
        set hash2=%%i
    )
)
endlocal && set hash2=%hash2%
del tmp.txt
if %hash1%==%hash2% ( goto :youtubeDL ) else ( goto :download )
:download
echo Automatically downloading/upgrading youtube-dl.exe...
echo.
powershell -Command "Invoke-WebRequest https://github.com/ytdl-org/youtube-dl/releases/latest/download/youtube-dl.exe -OutFile youtube-dl.exe"
echo Finished!
echo.
:youtubeDL
set /p DIRECTORY=Where do you want to store your file (Enter a directory here, a directory should look something like C:\Users\Rick\xxx): 
echo.
:while
set /p URL=What is the link to the video: 
echo.
youtube-dl.exe -o "%DIRECTORY%\\%%(title)s.%%(ext)s" "%URL%"
echo Download Complete!
set /p INPUT=Would you like to download more videos? (y/n): 
if "%INPUT%"=="y" (
    echo.
    goto :while
)
No Comments

Send Comment Edit Comment


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
Previous
Next