I am attempting to play an HLS encrypted stream for which I subscribe using Kodi. The URL of the manifest (after I redacted all of the sensitive token information) is:

Code:
https://primarystream.365cdn.net/laligatv/laligatv.m3u8?Policy=<redacted>Key-Pair-Id=<redacted>Key-Pair-Id2=<redacted>&DVR=1&DVR=1
This is what the inside of the manifest looks like:
Code:
#EXTM3U  
#EXT-X-VERSION:3  
#EXT-X-INDEPENDENT-SEGMENTS  
#EXT-X-STREAM-INF:BANDWIDTH=5530800,AVERAGE-BANDWIDTH=5530800,CODECS="avc1.64002a,mp4a.40.2",RESOLUTION=1920x1080,FRAME-RATE=50.000
https://server-4.365cdn.net/laligatv/laligatv-1080.m3u8?Policy=<redacted>Key-Pair-Id=<redacted>Key-Pair-Id2=<redacted>&DVR=1&DVR=1
Inside la-ligatv-1080.m3u8:

Code:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:8
#EXT-X-MEDIA-SEQUENCE:170131
#EXT-X-KEY:METHOD=AES-128,URI="K66170100-1080.key?u=<redacted>&Key-Pair-Id=<redacted>&u=<redacted>&DVR=1&DVR=1",IV=0x<redacted>
#EXT-X-PROGRAM-DATE-TIME:2025-03-07T10:32:35.720Z
#EXTINF:4.00000,
laligatv-108020250307T103236_170131.ts
#EXTINF:4.00000,
laligatv-108020250307T103240_170132.ts
#EXTINF:4.00000,
laligatv-108020250307T103244_170133.ts
#EXTINF:4.00000,
laligatv-108020250307T103248_170134.ts
#EXTINF:4.00000,
laligatv-108020250307T103252_170135.ts
#EXTINF:4.00000,
laligatv-108020250307T103256_170136.ts

and so on
Within my .strm file I have:

Code:
#EXTINF:-1,Test1
#KODIPROP:inputstream=inputstream.adaptive
#KODIPROP:inputstream.adaptive.manifest_type=hls
#KODIPROP:inputstream.adaptive.stream_headers=User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0&Accept: /&Accept-Language: en-GB,en;q=0.5&Accept-Encoding: gzip, deflate, br, zstd&Origin: https://www.premiersports.com&connection/: keep-alive&Referer: https://www.premiersports.com/&Sec-Fetch-Dest: empty&Sec-Fetch-Mode: cors&Sec-Fetch-Site: cross-site&TE: trailers
https://primarystream.365cdn.net/laligatv/laligatv.m3u8?Policy=<redacted>Key-Pair-Id=<redacted>Key-Pair-Id2=<redacted>&DVR=1&DVR=1
I receive the following errors in the Kodi log:

Code:
2025-03-07 14:22:36.132 T:1004    error <general>: CCurlFile::Stat - <https://primarystream.365cdn.net/laligatv/laligatv.m3u8?Policy=<redacted>Key-Pair-Id=<redacted>Key-Pair-Id2=<redacted>&DVR=1&DVR=1> Failed: HTTP response code said error(22)
2025-03-07 14:22:36.143 T:1004     info <general>: VideoPlayer::OpenFile: /storage/tv2.strm
2025-03-07 14:22:36.232 T:4347    error <general>: CCurlFile::Stat - <https://primarystream.365cdn.net/laligatv/laligatv.m3u8?Policy=<redacted>Key-Pair-Id=<redacted>Key-Pair-Id2=<redacted>&DVR=1&DVR=1> Failed: HTTP response code said error(22)
2025-03-07 14:22:36.232 T:4347     info <general>: Creating InputStream
2025-03-07 14:22:36.235 T:4347     info <general>: AddOnLog: inputstream.adaptive: [Repr. chooser] Resolution set: 1920x1080, max allowed: 1920x1080, Adjust refresh rate: 0
2025-03-07 14:22:36.556 T:4347    error <general>: AddOnLog: inputstream.adaptive: Download failed, HTTP error 422: https://primarystream.365cdn.net/laligatv/laligatv.m3u8?Policy=<redacted>Key-Pair-Id=<redacted>Key-Pair-Id2=<redacted>&DVR=1&DVR=1
2025-03-07 14:22:36.556 T:4347    error <general>: CVideoPlayer::OpenInputStream - error opening [/storage/tv2.strm]
2025-03-07 14:22:36.556 T:4347     info <general>: CVideoPlayer::OnExit()
2025-03-07 14:22:36.556 T:4347     info <general>: ADDON: Dll Destroyed - InputStream Adaptive
2025-03-07 14:22:36.581 T:1004     info <general>: CVideoPlayer::CloseFile()
2025-03-07 14:22:36.581 T:1004     info <general>: VideoPlayer: waiting for threads to exit
2025-03-07 14:22:36.581 T:1004     info <general>: VideoPlayer: finished waiting
When I play the file in MPV it works fine but not in Kodi. Likewise it also does not work in VLC which leads me to believe it's a problem with the headers. I attempted to copy the headers from Firefox when I am on the website. When I remove the headers from the .strm file, I receive the same error.

Could you please assist? Thank you.