VideoHelp Forum




+ Reply to Thread
Results 1 to 7 of 7
  1. Hi,
    I found a batch script to download video using YouTube-DL in GitHub. I did some modification but unable set the output name.

    Batch Script:
    Code:
    @ECHO OFF
    ECHO ======================================================================================================================
    ECHO.
    SET /P URL="[Enter video URL] "
    ECHO.
    ECHO ======================================================================================================================
    goto formatList
    
    :formatList
    ECHO.
    ytdlp -F %URL%
    ECHO.
    ECHO ======================================================================================================================
    goto download
    
    :download
    ECHO.
    SET /P format="Select format: "
    ECHO.
    ECHO ======================================================================================================================
    goto output
    
    :output
    ECHO.
    SET /P OUTPUT="[Enter Title] "
    ECHO.
    ECHO ======================================================================================================================
    
    ECHO.
    ytdlp -o %%(%OUTPUT%)s.%%(ext)s -f %format% --external-downloader aria2c --external-downloader-args "-j 8 -x 8 -s 8" %URL%
    ECHO.
    ECHO ======================================================================================================================
    ECHO.
    ECHO Done!
    PAUSE
    OUTPUT part is not working.

    Thank you.
    Quote Quote  
  2. What is the original code?
    What if you enter g.e. MyWish after the question [Enter Title]?
    Quote Quote  
  3. Originally Posted by ProWo View Post
    What is the original code?
    What if you enter g.e. MyWish after the question [Enter Title]?
    This is the original line which I modified with my output version

    Code:
    ytdlp -o %%(title)s.%%(ext)s -f %format% --external-downloader aria2c --external-downloader-args "-j 8 -x 8 -s 8" %URL%
    My version
    Code:
    :output
    ECHO.
    SET /P OUTPUT="[Enter Title] "
    ECHO.
    ECHO ======================================================================================================================
    
    ytdlp -o %%(%OUTPUT%)s.%%(ext)s -f %format% --external-downloader aria2c --external-downloader-args "-j 8 -x 8 -s 8" %URL%
    Quote Quote  
  4. Where does the original command line take title and ext from?
    Quote Quote  
  5. Originally Posted by ProWo View Post
    Where does the original command line take title and ext from?
    This is the full original script

    Code:
    @ECHO OFF
    color 0A
    ECHO ======================================================================================================================
    ECHO.
    SET /P URL="[Enter video URL] "
    ECHO.
    ECHO ======================================================================================================================
    goto formatList
    
    :formatList
    ECHO.
    ytdlp -F %URL%
    ECHO.
    ECHO ======================================================================================================================
    goto selection
    
    
    :selection
    ECHO.
    ECHO 1) Video + Audio
    ECHO 2) Single format (Audio only / Video only)
    ECHO.
    SET /P option="Select option: "
    if %option% == 1 (goto download)
    if %option% == 2 (goto downloadSingle)
    ECHO.
    ECHO Unknown value
    ECHO.
    ECHO ======================================================================================================================
    goto selection
    
    :download
    ECHO.
    SET /P video="Select video format: "
    SET /P audio="Select audio format: "
    ECHO.
    ECHO ======================================================================================================================
    ECHO.
    ytdlp -o %%(title)s.%%(ext)s -f %video%+%audio% -i --ignore-config --hls-prefer-native %URL%
    ECHO.
    ECHO ======================================================================================================================
    ECHO.
    ECHO Done!
    PAUSE
    EXIT
    
    :downloadSingle
    ECHO.
    SET /P format="Select format: "
    ECHO.
    ECHO ======================================================================================================================
    ECHO.
    ytdlp -o %%(title)s.%%(ext)s -f %format% --external-downloader aria2c --external-downloader-args "-j 8 -x 8 -s 8" %URL%
    ECHO.
    ECHO ======================================================================================================================
    ECHO.
    ECHO Done!
    PAUSE
    EXIT
    Please note, title & ext are the part of youtube-dl parameter. Title also can be set as "Some Title.%(ext)s"
    Quote Quote  
  6. ytdlp -o %OUTPUT%_%%(title)s.%%(ext)s -f %format% --external-downloader aria2c --external-downloader-args "-j 8 -x 8 -s 8" %URL%
    Quote Quote  
  7. Originally Posted by ProWo View Post
    ytdlp -o %OUTPUT%_%%(title)s.%%(ext)s -f %format% --external-downloader aria2c --external-downloader-args "-j 8 -x 8 -s 8" %URL%
    Thanks your response. I've tried your way but it gave me an error

    Code:
    ERROR: fixed output name but more than one file to download
    I figured it out. This is the code I'm using now and working fine.

    Code:
    "%OUTPUT%.%%(ext)s"
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!