mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-18 00:55:50 +00:00
Adds .xz to the set of compressed formats detect_file_format(), extract_compressed_file(), fetch_xmltv(), and EPGSource.get_cache_file() recognize, mirroring the existing gzip handling. Uses stdlib lzma, no new dependency. Detection works via LZMA magic bytes (fd 37 7a 58 5a 00), the .xz extension (including compound extensions like .xml.xz), and the application/x-xz mimetype fallback. Widened the magic-byte read in get_cache_file() from 4 to 6 bytes since the xz signature is 6 bytes (the previous 4-byte read was sufficient only for the 2-byte gzip/zip signatures it originally supported). That widening silently broke the bare-<tv> raw-XML detection: the fixed-length slice comparison header[:5] == b'<tv>' can never match a 5-byte slice of a 6-byte header against a 4-byte literal. Replaced the fixed-length slice comparisons with header.startswith(...), which is correct regardless of how many bytes are read - this also fixes the adjacent <?xml declaration check, which was silently dead before this change (a 4-byte read could never equal the 5-byte b'<?xml' literal either). Fixes Dispatcharr/Dispatcharr#1414 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| accounts | ||
| api | ||
| backups | ||
| channels | ||
| connect | ||
| dashboard | ||
| epg | ||
| hdhr | ||
| m3u | ||
| output | ||
| plugins | ||
| proxy | ||
| timeshift | ||
| vod | ||