Repository: yt-dlp
Issue: add fragment_count or fragment_total as --match-filter option for fragmented streams
Labels: enhancement,triage

### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm requesting a feature unrelated to a specific site
- [X] I've looked through the [README](https://github.com/yt-dlp/yt-dlp#readme)
- [X] I've verified that I have **updated yt-dlp to nightly or master** ([update instructions](https://github.com/yt-dlp/yt-dlp#update-channels))
- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)

### Provide a description that is worded well enough to be understood

I wasn't sure where to post this as my problem concerns a specific site, however the functionality I propose to solve that problem is not limited to or specific for that site.

I'm trying to filter out short clips from a site that only delivers fragmented streams.
I tried using duration, filesize and filesize_approx (even when used with --compat-options manifest-filesize-approx) with --match-filter to avoid downloading 10 seconds long, 2,47MB big clips consisting of 2 fragments but all of these properties return "NA" when I use --print on them, which explains why they cannot be used with --match-filter.

My proposal is to add an option to filter by fragment_count or fragment_total. I think that number is known prior to downloading and could be used to exclude obviously unwanted results.
If you're for example looking for videos of 5-20 minutes, they usually have hundreds of fragments while a 10 seconds long clip often only has a couple of fragments.

If I'm missing an existing option that allows filtering fragmented streams based on length or size, please let me know.

Example of a youtube video that returns duration and filesize_approx:
```
D:\>yt-dlp https://www.youtube.com/watch?v=jU-N9Mc6wuA --print "%(filesize)s - %(filesize_approx)s - %(duration>%H:%M:%S)s
NA - 2189770358 - 00:28:04
```
Example of a fragmented 10s video that returns none of these properties:
```
D:\>yt-dlp https://tvthek.orf.at/profile/zeit-geschichte/13606695/zeit-geschichte-Kampf-um-Oesterreich-Februar-1934-Ausbruch-der-Gewalt/14213099 --print "%(filesize)s - %(filesize_approx)s - %(duration>%H:%M:%S)s - %(title)s"
WARNING: [orf:tvthek] Unable to download f4m manifest: HTTP Error 403: Forbidden
WARNING: [orf:tvthek] Unable to download f4m manifest: HTTP Error 403: Forbidden
WARNING: [orf:tvthek] Unable to download f4m manifest: HTTP Error 403: Forbidden
WARNING: [orf:tvthek] Unable to download f4m manifest: HTTP Error 403: Forbidden
WARNING: [orf:tvthek] Unable to download f4m manifest: HTTP Error 403: Forbidden
NA - NA - NA - zeit.geschichte: Kampf um Österreich - Februar 1934: Ausbruch der Gewalt
```
Output from downloading such a 10s clip:
```
D:\>yt-dlp https://tvthek.orf.at/profile/zeit-geschichte/13606695/zeit-geschichte-Kampf-um-Oesterreich-Februar-1934-Ausbruch-der-Gewalt/14213099
[orf:tvthek] Extracting URL: https://tvthek.orf.at/profile/zeit-geschichte/13606695/zeit-geschichte-Kampf-um-Oesterreich-Febru...-der-Gewalt/14213099
[orf:tvthek] 14213099: Downloading webpage
[download] Downloading playlist: 14213099
[orf:tvthek] 15571818: Downloading hls-Q1A-Niedrig m3u8 manifest
[orf:tvthek] 15571818: Downloading hls-Q4A-Mittel m3u8 manifest
[orf:tvthek] 15571818: Downloading hls-Q6A-Hoch m3u8 manifest
[orf:tvthek] 15571818: Downloading hls-Q8C-Sehr hoch m3u8 manifest
[orf:tvthek] 15571818: Downloading hls-QXB-Adaptiv m3u8 manifest
[orf:tvthek] 15571818: Downloading f4m manifest
WARNING: [orf:tvthek] Unable to download f4m manifest: HTTP Error 403: Forbidden
[orf:tvthek] 15571818: Downloading f4m manifest
WARNING: [orf:tvthek] Unable to download f4m manifest: HTTP Error 403: Forbidden
[orf:tvthek] 15571818: Downloading f4m manifest
WARNING: [orf:tvthek] Unable to download f4m manifest: HTTP Error 403: Forbidden
[orf:tvthek] 15571818: Downloading f4m manifest
WARNING: [orf:tvthek] Unable to download f4m manifest: HTTP Error 403: Forbidden
[orf:tvthek] 15571818: Downloading f4m manifest
WARNING: [orf:tvthek] Unable to download f4m manifest: HTTP Error 403: Forbidden
[orf:tvthek] 15571818: Downloading dash-Q1A-Niedrig mpd manifest
[orf:tvthek] 15571818: Downloading dash-Q4A-Mittel mpd manifest
[orf:tvthek] 15571818: Downloading dash-Q6A-Hoch mpd manifest
[orf:tvthek] 15571818: Downloading dash-Q8C-Sehr hoch mpd manifest
[orf:tvthek] 15571818: Downloading dash-QXB-Adaptiv mpd manifest
[orf:tvthek] Playlist 14213099: Downloading 1 items of 1
[download] Downloading item 1 of 1
[info] 15571818: Downloading 1 format(s): dash-QXB-Adaptiv-p0va0br1819370+dash-QXB-Adaptiv-p0aa0br191276
[dashsegments] Total fragments: 2
[download] Destination: zeit.geschichte： Kampf um Österreich - Februar 1934： Ausbruch der Gewalt [15571818].fdash-QXB-Adaptiv-p0va0br1819370.mp4
[download] 100% of    2.18MiB in 00:00:00 at 2.91MiB/s
[dashsegments] Total fragments: 2
[download] Destination: zeit.geschichte： Kampf um Österreich - Februar 1934： Ausbruch der Gewalt [15571818].fdash-QXB-Adaptiv-p0aa0br191276.m4a
[download] 100% of  238.11KiB in 00:00:00 at 1.18MiB/s
[Merger] Merging formats into "zeit.geschichte： Kampf um Österreich - Februar 1934： Ausbruch der Gewalt [15571818].mp4"
Deleting original file zeit.geschichte： Kampf um Österreich - Februar 1934： Ausbruch der Gewalt [15571818].fdash-QXB-Adaptiv-p0aa0br191276.m4a (pass -k to keep)
Deleting original file zeit.geschichte： Kampf um Österreich - Februar 1934： Ausbruch der Gewalt [15571818].fdash-QXB-Adaptiv-p0va0br1819370.mp4 (pass -k to keep)
[download] Finished downloading playlist: 14213099
```

`[dashsegments] Total fragments: 2` is what I'd like to be able to filter on like this:
--match-filter "fragment_count>2"

Disclaimer about the 403 warnings:
The actual video is geo restricted to austria. The 10s video gets downloaded when the site detects a different country or a VPN, telling you that you can't watch the actual video.
If the site does not detect a VPN or foreign IP, the actual video of much larger size is downloaded.
I'm using a VPN to circumvent geo restrictions so that my father can watch some documentaries (while he is German he's interested in Austrian history etc.), however no DRM is involved and I think it would be generally useful to be able to filter based on the total fragment count regardless of my personal reasons.


### Provide verbose output that clearly demonstrates the problem

- [ ] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [ ] If using API, add `'verbose': True` to `YoutubeDL` params instead
- [ ] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

_No response_