When using you-get to download content, you can specify the desired file format using the --format
or -f
option. This allows you to control the type of file that is downloaded, such as MP4, MKV, or AVI.
To list the available formats for a particular video, you can use the --info
option:
you-get --info https://www.youtube.com/watch?v=dQw4w9WgXcQ
This will display a list of available formats, along with their resolution and file size information.
To download a video in a specific format, you can use the --format
option followed by the format code. For example, to download a video in MP4 format, you can use the following command:
you-get --format=mp4 https://www.youtube.com/watch?v=dQw4w9WgXcQ
You can also use the format code to specify a specific quality or resolution. For example, to download a video in 1080p, you can use the following command:
you-get --format=bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best https://www.youtube.com/watch?v=dQw4w9WgXcQ
In this example, the bestvideo[ext=mp4]+bestaudio[ext=m4a]
format code specifies that you want the best available video and audio streams, both in MP4 format. The best[ext=mp4]
and best
fallbacks ensure that you get the best available format if the preferred format is not available.
you-get supports a wide range of file formats, including:
Format |
Extension |
MP4 |
.mp4 |
MKV |
.mkv |
AVI |
.avi |
FLV |
.flv |
WebM |
.webm |
3GP |
.3gp |
MPEG |
.mpeg |
You can use the format codes corresponding to these extensions with the --format
option to download content in your desired format.