Merge pull request #1184 from Dispatcharr/dev

Dispatcharr - v0.22.1
This commit is contained in:
SergeantPanda 2026-04-05 12:07:28 -07:00 committed by GitHub
commit d10599429f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Fixed
- Fixed EPG sources that emit a UTF-8 BOM (e.g. ErsatzTV, EPGShare, WebGrab+Plus) parsing 0 channels and 0 programmes after the HTML entity fix introduced in v0.22.0. `bytes.lstrip()` only strips ASCII whitespace, leaving the three BOM bytes (`EF BB BF`) in place, so `stripped.startswith(b'<?xml')` returned `False`. The function fell through to the no-declaration branch and prepended the HTML entity DOCTYPE block _before_ the BOM and XML declaration, producing invalid XML that lxml silently discarded under `recover=True`. Fixed by stripping the BOM explicitly before the whitespace strip: `start.lstrip(b'\xef\xbb\xbf').lstrip()`. BOM-free files are unaffected. (Closes #1173) — Thanks [@dwot](https://github.com/dwot) for the fix!
## [0.22.0] - 2026-04-01
### Security

View file

@ -114,7 +114,7 @@ def _open_xmltv_file(file_path: str):
return f
# Insert the DOCTYPE after the XML declaration if one is present.
stripped = start.lstrip()
stripped = start.lstrip(b'\xef\xbb\xbf').lstrip()
if stripped.startswith(b'<?xml'):
decl_end = start.find(b'?>')
if decl_end >= 0: