Yt-dlp

From TMB Wiki
Jump to: navigation, search

yt-dlp

yt-dlp is a feature-rich command-line audio/video downloader with support for thousands of sites. It can grab the actual media on the site, which allows us to get the highest quality version without any transcoding occurring.

FFmpeg is a crucial dependency. yt-dlp does provide it's own FFmpeg-Builds that patches some of the issues the standard FFmpeg has that affects yt-dlp.


yt-dlp script

Copy and paste the below text into a text file and rename it yt-dlp.cmd

Make sure to change the paths in the script below - it's specific to your system/computer/setup.

:: is added to allow comments, so when you want to download the media you'll need to add :: to the %vyt-dlp% -F --no-check-certificate %vStream% line and remove it from the line below %vyt-dlp% -o %vOutput% %vStream%

:: Name:     yt-dlp.cmd
:: Purpose:  Configures yt-dlp to download media
:: Author:   jaybeee @ themixingbowl.org | https://github.com/yt-dlp/yt-dlp
:: Revision: Aug 2022

@ECHO OFF

SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

:: variables begin with v

:: set name of this script without file extension
SET vMe=%~n0

:: set name of the parent directory where this script resides
SET vParent=%~dp0

:: set youtube-dl path ** CHANGE ME **
SET vyt-dlp="C:\PATH\TO\yt-dlp.exe"

:: set ffmpeg path if not already in PATH ** CHANGE ME **
::SET vffmpeg="C:\PATH\TO\ffmpeg.exe"

:: set url ** CHANGE ME **
SET vStream=http://www.bbc.co.uk/programmes/b00vv0w8

:: set the location of where to save the file ** CHANGE ME ** 
SET vOutput="C:\PATH\TO\OUTPUT\FOLDER\%%(title)s.%%(ext)s"


:: Remind ourselves not to close the window
ECHO Recording to %vOutput% . . . don't close this Window!

:: Check version
%vyt-dlp="% --version

:: create the command to send to yt-dlp
:: -F lists available formats
:: -f to then select the format required such as bestaudio or the actual file, eg audio only
:: -o actually gets the media
:: Add this for Mixcloud captures: --no-check-certificate
:: ** AMEND AS APPROPRIATE **
%vyt-dlp% -F --no-check-certificate %vStream%
::%vyt-dlp% -o %vOutput% %vStream%
::%vyt-dlp% -o %vOutput% --no-check-certificate %vStream%
::%vyt-dlp% -o %vOutput% --all-formats %vStream%

:: Capture HQ YouTube OPUS file in an WEBM container
::%vyt-dlp% -o %vOutput% -f 140 %vStream%

:: Capture HQ Mixcloud OPUS file in an WEBM container
::%vyt-dlp% -o %vOutput% -f dash-f2-a1-x3 --no-check-certificate %vStream%

:: Capture HQ Mixcloud AAC file in M4A container
::%vyt-dlp% -o %vOutput% -f hls-192 --no-check-certificate %vStream%

:: YouTube Videos: might need to use this to merge the output and get MP4 files.
::%vyt-dlp% -v -f bestvideo[ext=mp4]+bestaudio[ext=m4a] --merge-output-format mp4 %vStream% -o %vOutput% 


:: Finish
ECHO Finished recording

:: pause to see output
PAUSE

:END
ENDLOCAL
ECHO ON
@EXIT /B 0


Parabolic

Parabolic is a powerful frontend for yt-dlp.


yt-dlp-gui

yt-dl-gui is a frontend for yt-dlp.