hoshsadiq / m3ufilter

ABANDONED - A tool that allows to filter specific items from an m3u filter designed for IPTV.
GNU General Public License v2.0
49 stars 18 forks source link

Implement Channel Quality Filtering #24

Open Olivier6767 opened 4 years ago

Olivier6767 commented 4 years ago

I would like to see the possibility to filter channels by quality. My IPTV provider makes most channels (but not all) available in multiple qualities. Here is an example:

BBC One
BBC One SD
BBC One HD
BBC One FHD
BBC One UHD

So far, in m3u-filter, I can use a regex filter to select only FHD channels for example. However, not all channels are available in every quality. For example:

BBC Two SD
BBC Two HD

So if I filter for example on FHD, I will not get BBC Two. If I filter on HD, I get both channels, but not with the quality I would like (FHD).

Would it be possible to add a filter to choose a certain quality level and avoid duplicate? An idea would be to define a score by quality, for example:

SD or no quality indication = 1
HD = 2
FHD = 3
UHD = 4

Then define the target quality, for example FHD (score 3) Then, for any channel with duplicates, take the channel with the highest score which is less or equal to the target quality.

Using my previous example, this would select:

BBC One FHD (score 3)
BBC Two HD (score 2)

This would help filter out a lot of duplicate channels. Thanks for your consideration on this request.

hoshsadiq commented 4 years ago

I've got a PR waiting and still developing that should make this somewhat easier. Once that's merged, I will look into implementing this.