question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

format sorting documentation

See original GitHub issue

Checklist

Description

I believe there is an error in the documentation. https://github.com/yt-dlp/yt-dlp#sorting-formats says:

« ie_pref: The format preference as given by the extractor […] The fields hasvid and ie_pref are always given highest priority in sorting, irrespective of the user-defined order. This behaviour can be changed by using --format-sort-force. Apart from these, the default order used is: lang,quality,res,fps,hdr:12,codec:vp9.2,size,br,asr,proto,ext,hasaud,source,id. The extractors may override this default order, but they cannot override the user-provided order. »

So at first, the doc says ie_pref (i.e. the extractor’s format preference) always has the highest priority, irrespective of the user-defined order. In other words, the extractor preference overrides the user preference.

So far so good, but then the doc goes on saying the extractor cannot override the user preference (last sentence in quote).

I may be mistaken, but I believe these two statements are contradictory and can’t both be true at the same time.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pukkandancommented, Jan 9, 2022

Some formats are from the Android API and some from the Web API. The formats from Web API may be throttled (it’s actually fixed now, though the checking code isn’t removed). So we check if the format will be throttled and then reduce source_preference if it is.

The field is similarly used in niconico and tiktok

1reaction
pukkandancommented, Jan 9, 2022

Is there any place where I could find some information about the fields used in format sorting to avoid bothering you ? (I’d like to find out for example what other values than “-1” ie_pref can have. And what source means and what values it can have.)

Other than looking at extractor source code, no

Theoretically, I thought this should not change anything in the final sort order, as I am only passing along the default sort order (i.e. the sort order yt-dlp uses every time, even in the first run printed above).

That is because the YouTube extractor overrides the default sort order (which you overrode when passing it as user order)

[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, codec:vp9.2, lang, proto

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sorting a document - MicroStrategy
Open the document in the Document Editor. · If the document contains multiple layouts, click the tab of the layout to sort. ·...
Read more >
Sorting Information - Microsoft Word Tips
Word's sorting tool allows you to sort text a number of different ways in your document. You can sort tables, dates, paragraphs, and...
Read more >
Pro tip: Sort table data in a Word document | TechRepublic
Pro tip: Sort table data in a Word document · Click the contextual Layout tab. In the Data group, click Sort — or...
Read more >
SORT function - Google Docs Editors Help
Sorts the rows in the specified data range according to the given key columns followed by the sorting order. Make a copy. Give...
Read more >
Sorting documents in views - HCL Product Documentation
Most views can benefit from a sorting method that organizes documents in a way that makes sense to users. For example, a By...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found