this post was submitted on 21 Jul 2025
23 points (92.6% liked)

Linux

56586 readers
376 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS
 

debian 12.11, yt-dlp stable@2025.06.30.

I used this argument: "-f bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4]"

and it works: it downloads the best available video, audio and ffmpeg merges both in a single file. Automatically.

Except that the maximum resolution I need is 1920 x 1080 p. Best available video is oftentimes 4096 x 2160 p, too much for the target hardware.

Using -F to check different resolutions to then select one (like -f 299 or -f 148) is tiresome.

How do I do that? Ideally for whole playlists involving between 25 and 50 videos.

all 5 comments
sorted by: hot top controversial new old
[–] UndulyUnruly@lemmy.world 5 points 1 day ago* (last edited 1 day ago) (2 children)

Others have given good examples for formats you were aiming for.

For bulk download, simply create a list.txt file in your target directory, bulk add all urls in separate lines. Then

Yt-dlp list.txt {your options here}

It is noteworthy that, instead of listing urls manually, you can also grab entire playlists from relevant platforms if that’s what you’re after, including preserving the playlist names as directory names. Same even goes for entire channels.

[–] merompetehla@lemmy.ml 2 points 1 day ago

an approach I wasn't aware of. thanks

[–] anamethatisnt@sopuli.xyz 9 points 1 day ago

The following numeric meta fields can be used with comparisons <, <=, >, >=, = (equals), != (not equals):

filesize: The number of bytes, if known in advance
filesize_approx: An estimate for the number of bytes
width: Width of the video, if known
height: Height of the video, if known
aspect_ratio: Aspect ratio of the video, if known

So a height<=1080 should be it.

[–] darcmage@lemmy.dbzer0.com 9 points 1 day ago

Taken from https://github.com/yt-dlp/yt-dlp. Replace 480 with 1080. Multiple options in the documentation to choose from.

Download the best video available with the largest height but no better than 480p, or the best video with the smallest resolution if there is no video under 480p

$ yt-dlp -S "height:480"