kapott icon

yt_mp3.cmd

kapott | PRO | 02/01/19 05:19:37 PM UTC | 0 ⭐ | 5192 👁️ | Never ⏰ | []
Winbatch |

870 B

|

None

|

0 👍

/

0 👎

@echo off
setlocal enableDelayedExpansion
 
:: script globals
set url="%1=%2"
SET me=%~n0.cmd
 
goto start_application
exit /B %errorlevel%
 
:start_application
call :find_ytdl
if !errorlevel! neq 0 (exit /b 1)
call :find_ffmpeg
if !errorlevel! neq 0 (exit /b 1)
call :echo Trying to get !url!
youtube-dl --extract-audio --audio-quality 0 --audio-format mp3 --output "%USERPROFILE%\Music\%%(title)s.%%(ext)s" !url!
goto :eof
 
:find_ytdl
where youtube-dl > nul
if %errorlevel% neq 0 (
    call :echo Could not locate youtube-dl binary in PATH
    exit /B 1
) else ( 
    call :echo Found youtube-dl^!
    exit /B 0 
)
exit /B 0
 
:find_ffmpeg
where youtube-dl > nul
if %errorlevel% neq 0 (
    call :echo Could not locate ffmpeg binary in PATH
    exit /B 1
) else ( 
    call :echo Found ffmpeg^!
    exit /B 0
)
exit /B 0
 
:echo
ECHO [%me%] %*
EXIT /B 0
 
endlocal

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎