Merge pull request #594 from 0x53c65c0a8bd30fff/truncated-channel-titles-fix

Channel name truncation when containing apostrophes or special characters
This commit is contained in:
SergeantPanda 2025-10-30 16:53:30 -05:00 committed by GitHub
commit 1b282f1987
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -450,7 +450,7 @@ def parse_extinf_line(line: str) -> dict:
if len(parts) != 2:
return None
attributes_part, display_name = parts[0], parts[1].strip()
attrs = dict(re.findall(r'([^\s]+)=["\']([^"\']+)["\']', attributes_part))
attrs = dict(re.findall(r'([^\s]+)="([^"]+)"', attributes_part) + re.findall(r"([^\s]+)='([^']+)'", attributes_part))
# Use tvg-name attribute if available; otherwise, use the display name.
name = get_case_insensitive_attr(attrs, "tvg-name", display_name)
return {"attributes": attrs, "display_name": display_name, "name": name}