[FFmpeg-user] How to check if a youtube URL is valid before starting download?

Budi budikusasi at gmail.com
Tue Jul 6 11:04:31 EEST 2021

ffmpeg [global_options] {[input_file_options] -i input_url} ...
{[output_file_options] output_url} ...

ffmpeg reads from an arbitrary number of input "files" (which can be
regular files, pipes, network streams, grabbing devices, etc.),
specified by the -i option, and writes to an arbitrary number of
output "files", which are specified by a plain output url. Anything
found on the command line which cannot be interpreted as an option is
considered to be an output url.

Get it:

On 7/6/21, Bo Berglund <bo.berglund at gmail.com> wrote:
> Before I run my Linux script for download a youtube video stream I would
> like to
> be able to check if the URL supplied is valid, i.e. it does not display an
> error
> message like this video does:
> https://youtu.be/21qP3flYoic
> Can this be done using youtube-dl or straight ffmpeg?
> I need a bash script or function "validytvideo" which returns 0 if the URL
> is OK
> and 1 if not.
> I am using ffmpeg in scripts to download news videos unattended and I want
> to be
> notified when a YouTube URL has become unavailable...
> Please suggest a bash script solution rather than python, which I do not
> master...
> --
> Bo Berglund
> Developer in Sweden
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".

More information about the ffmpeg-user mailing list