mirror of
https://github.com/Free-TV/IPTV.git
synced 2026-09-24 19:17:14 +02:00
Strip trailing Ⓢ/Ⓖ/Ⓨ markers from tvg-name
Issue #483: these circled-letter suffixes are in-list markers for human readers (subscription-required, geo-blocked, YouTube-sourced, etc.), but were leaking into the generated tvg-name verbatim (e.g. tvg-name="Rai 1 Ⓖ"), breaking EPG matching for any provider keying off channel name. Now stripped from tvg-name only; the display name after the comma still shows the marker as before.
This commit is contained in:
+4
-1
@@ -124,8 +124,11 @@ class Channel: # pylint: disable=too-few-public-methods,too-many-instance-attri
|
||||
country = f' tvg-country="{self.country_code}"' if self.country_code else ""
|
||||
chno = f' tvg-chno="{self.chno}"' if self.chno else ""
|
||||
epg = f' tvg-id="{self.epg}"' if self.epg is not None else ""
|
||||
# Strip trailing in-list markers (Ⓖ/Ⓢ/Ⓨ/...) from tvg-name so EPG
|
||||
# matching isn't broken by a symbol meant for human readers.
|
||||
tvg_name = re.sub(r'\s*[Ⓐ-ⓩ]+\s*$', '', self.name)
|
||||
return (
|
||||
f'#EXTINF:-1 tvg-name="{self.name}" tvg-logo="{self.logo}"{epg}{chno}{country}'
|
||||
f'#EXTINF:-1 tvg-name="{tvg_name}" tvg-logo="{self.logo}"{epg}{chno}{country}'
|
||||
f' group-title="{self.group}",{self.name}\n{self.url}'
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user