Skip to content

Commit

Permalink
Merge pull request #55 from hmlendea/dev
Browse files Browse the repository at this point in the history
Improved channel matching
  • Loading branch information
hmlendea authored Oct 21, 2020
2 parents 2e24edf + 3c65ec7 commit 405b3d7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[![Build Status](https://travis-ci.com/hmlendea/iptv-playlist-aggregator.svg?branch=master)](https://travis-ci.com/hmlendea/iptv-playlist-aggregator)

[![Support this on Patreon](https://raw.githubusercontent.com/hmlendea/readme-assets/master/donate_patreon.png)](https://www.patreon.com/hmlendea) [![Donate through PayPal](https://raw.githubusercontent.com/hmlendea/readme-assets/master/donate_paypal.png)](https://www.paypal.com/donate?hosted_button_id=6YVRGJHDGWGKQ)

# About

IPTV Playlist Aggregator is a tool for downloading IPTV playlists from multiple sources and aggregating their channels into a single playlist. It will match the duplicated channels into a single one, based on their name, and will override any channel data (such as logo, TVG ID, etc) with your own custom one.
Expand Down Expand Up @@ -135,3 +137,5 @@ PlaylistProviderDefinitionEntity fields:
- *UrlFormat* (string): The URL to the m3u playlist file of that provider. Replace the date part of the URL with a timestamp format. For example, *2019-05-19* will be replaced with *{0:yyyy-MM-dd}*. The *0* is the calendar day that is processed (today, or one of the previous ones depending on the *daysToCheck* setting)
- *Country* (string): (Optional) If set, the country will be used in the channel matching process.
- *ChannelNameOverride* (string): (Optional) The channel name override for all the channels in the provider's playlist.

[![Support this on Patreon](https://raw.githubusercontent.com/hmlendea/readme-assets/master/donate_patreon.png)](https://www.patreon.com/hmlendea) [![Donate through PayPal](https://raw.githubusercontent.com/hmlendea/readme-assets/master/donate_paypal.png)](https://www.paypal.com/donate?hosted_button_id=6YVRGJHDGWGKQ)
2 changes: 2 additions & 0 deletions Service/ChannelMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public sealed class ChannelMatcher : IChannelMatcher
{ "[\\(\\[]]*([Aa]uto|[Bb]ackup|[Ll]ive [Oo]n [Mm]atches|[Mm]ulti-*[Aa]udio|[Mm]ulti-*[Ss]ub|[Nn]ew!*|[Oo]n-[Dd]emand)[\\)\\]]*", "" },
{ "([a-zA-Z0-9_ ]{4})[ _\\|\\[\\(\\]\\)\".:-](Ultra|[FU])*_*[HMS][DQ]", "$1" },
{ "4[Kk]\\+", "" },

{ "RO\\(L\\) *[\\|\\[\\(\\]\\)\".:-]", "RO:" },

{ "^( *[\\|\\[\\(\\]\\)\".:-]* *([A-Z][A-Z]) *[\\|\\[\\(\\]\\)\".:-] *)+", "$2:" },
{ "^ *([A-Z][A-Z]): *(.*) \\(*\\1\\)*$", "$1: $2" },
Expand Down
3 changes: 3 additions & 0 deletions UnitTests/Service/ChannelMatcherTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public void ChannelNamesDoMatch_WithAliasWithCountry(
[TestCase("Golf Channel", "FR: Golf Channel", "|FR| GOLF CHANNEL FHD")]
[TestCase("H!T Music Channel", "RO: Hit", "RO | HIT")]
[TestCase("HD Net Van Damme", "HD NET Jean Claude Van Damme", "HD NET Jean Claude van Damme")]
[TestCase("Hora TV", "RO: Hora TV", "RO(L): HORA TV SD")]
[TestCase("Jurnal TV", "MD: Jurnal TV", "Jurnal TV Moldavia")]
[TestCase("MegaMax", "RO: MegaMax", "RO: MegaMax-HD")]
[TestCase("NCN TV", "RO: NCN", "RO: NCN HD")]
Expand Down Expand Up @@ -139,6 +140,7 @@ public void ChannelNamesDoNotMatch_WithoutAliasWithoutCountry(
[TestCase("MD: MD: Diaspora Media", "MD", "MDDIASPORAMEDIA")]
[TestCase("RO | Travel", "RO", "TRAVEL")]
[TestCase("RO: Travel", "RO", "TRAVEL")]
[TestCase("RO(L): TELEKOM SPORT 1 FHD", "RO", "TELEKOMSPORT1")]
[TestCase("Travel Mix", "RO", "TRAVELMIX")]
[TestCase("TV Paprika", "RO", "TVPAPRIKA")]
[TestCase("TV8", "MD", "MDTV8")]
Expand Down Expand Up @@ -191,6 +193,7 @@ public void NormaliseName_WithCountry_ReturnsExpectedValue(string name, string c
[TestCase("RO: TVR Moldova", "TVRMOLDOVA")]
[TestCase("RO: U TV S1-1", "UTV")]
[TestCase("RO.| DIGI 24", "DIGI24")]
[TestCase("RO(L): E! ENTERTAINMENT FHD", "EENTERTAINMENT")]
[TestCase("RO\" Romania TV", "ROMANIATV")]
[TestCase("RO| Antena 3 4K+", "ANTENA3")]
[TestCase("RO| CINEMA RO.", "CINEMARO")]
Expand Down

0 comments on commit 405b3d7

Please sign in to comment.