From 2341cf478687dfe24a9d19f249b2471df14454cf Mon Sep 17 00:00:00 2001 From: 4gray Date: Sun, 19 Jul 2026 08:10:32 +0200 Subject: [PATCH] chore(m3u): bump parser for input robustness and library hygiene Pulls the fork's real-world input tolerance: UTF-8 BOM, blank lines and whitespace before the header, and case-insensitive #EXTM3U no longer reject the playlist (all VLC-accepted forms); Node Buffers are decoded as UTF-8 and other non-string input throws a clear TypeError. Also brings truthful types (url?: string), fork metadata, an enforced 100% coverage gate, and the fork CHANGELOG. Extends the contract spec with a BOM regression test. Co-Authored-By: Claude Fable 5 --- .../src/app/iptv-playlist-parser.contract.spec.ts | 9 +++++++++ package.json | 2 +- pnpm-lock.yaml | 13 +++++++------ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/apps/web/src/app/iptv-playlist-parser.contract.spec.ts b/apps/web/src/app/iptv-playlist-parser.contract.spec.ts index 21fcb0126..85f2338cc 100644 --- a/apps/web/src/app/iptv-playlist-parser.contract.spec.ts +++ b/apps/web/src/app/iptv-playlist-parser.contract.spec.ts @@ -83,6 +83,15 @@ describe('iptv-playlist-parser contract (4gray fork)', () => { expect(result.items[0].http.referrer).toBe('http://ref.example'); }); + it('accepts playlists with a UTF-8 BOM before the header', () => { + const result = parse( + '#EXTM3U\n#EXTINF:-1,One\nhttp://example.com/one.m3u8\n' + ); + + expect(result.items.length).toBe(1); + expect(result.items[0].url).toBe('http://example.com/one.m3u8'); + }); + it('exposes EPG urls from the playlist header', () => { const result = parse( [ diff --git a/package.json b/package.json index 4ec3c5e46..36a8159d5 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "epg-parser": "^0.1.6", "fix-path": "5.0.0", "hls.js": "1.6.13", - "iptv-playlist-parser": "github:4gray/iptv-playlist-parser#f1948986add4b58987974d399b724b496f978579", + "iptv-playlist-parser": "github:4gray/iptv-playlist-parser#33f5e9c09539524d758901c02a6f29302833c0a4", "marked": "18.0.5", "mpegts.js": "1.8.0", "ms": "2.1.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 28253fb5d..8c0c72a48 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -126,8 +126,8 @@ importers: specifier: 1.6.13 version: 1.6.13 iptv-playlist-parser: - specifier: github:4gray/iptv-playlist-parser#f1948986add4b58987974d399b724b496f978579 - version: https://codeload.github.com/4gray/iptv-playlist-parser/tar.gz/f1948986add4b58987974d399b724b496f978579 + specifier: github:4gray/iptv-playlist-parser#33f5e9c09539524d758901c02a6f29302833c0a4 + version: https://codeload.github.com/4gray/iptv-playlist-parser/tar.gz/33f5e9c09539524d758901c02a6f29302833c0a4 marked: specifier: 18.0.5 version: 18.0.5 @@ -7594,9 +7594,10 @@ packages: resolution: {integrity: sha512-Zv/pA+ciVFbCSBBjGfaKUya/CcGmUHzTydLMaTwrUUEM2DIEO3iZvueGxmacvmN50fGpGVKeTXpb2LcYQxeVdg==} engines: {node: '>= 10'} - iptv-playlist-parser@https://codeload.github.com/4gray/iptv-playlist-parser/tar.gz/f1948986add4b58987974d399b724b496f978579: - resolution: {tarball: https://codeload.github.com/4gray/iptv-playlist-parser/tar.gz/f1948986add4b58987974d399b724b496f978579} - version: 0.15.2 + iptv-playlist-parser@https://codeload.github.com/4gray/iptv-playlist-parser/tar.gz/33f5e9c09539524d758901c02a6f29302833c0a4: + resolution: {tarball: https://codeload.github.com/4gray/iptv-playlist-parser/tar.gz/33f5e9c09539524d758901c02a6f29302833c0a4} + version: 0.15.2-iptvnator.1 + engines: {node: '>=18'} iron-webcrypto@1.2.1: resolution: {integrity: sha512-feOM6FaSr6rEABp/eDfVseKyTMDt+KGpeB35SkVn9Tyn0CqvVsY3EwI0v5i8nMHyJnzCIQf7nsy3p41TPkJZhg==} @@ -20590,7 +20591,7 @@ snapshots: ipaddr.js@2.3.0: {} - iptv-playlist-parser@https://codeload.github.com/4gray/iptv-playlist-parser/tar.gz/f1948986add4b58987974d399b724b496f978579: {} + iptv-playlist-parser@https://codeload.github.com/4gray/iptv-playlist-parser/tar.gz/33f5e9c09539524d758901c02a6f29302833c0a4: {} iron-webcrypto@1.2.1: {}