Bug Mysterious HEAD request when playback is over?
#1
Hi,

i am using inputstream.adaptive within my addon to play HLS streams. The streams require some headers which were passed using the old method (headers url encoded query string format followed by a pipe).

But I got a lot of notes in my logs that this behavior is going to be deprecated, so I decided to do what the deprecation note recommends and set inputstream.adaptive.manifest_headers/.stream_headers respectively. Here is my test addon code: https://gist.github.com/MrDini123/8bd1cc...9fb1f4558c

Then I wrote a simple webserver that logs the user-agents it receives: https://gist.github.com/MrDini123/212a2c...ecd314590f

And this is what I noticed:


Code:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36
127.0.0.1 - - [11/Jan/2024 17:11:05] "GET /test.m3u8 HTTP/1.1" 302 -
Kodi/20.2 (X11; Linux x86_64) Arch Linux/rolling App_Bitness/64 Version/20.2-(20.2.0)-Git:20231222-nogitfound
127.0.0.1 - - [11/Jan/2024 17:11:09] "HEAD /test.m3u8 HTTP/1.1" 302 -

Whenever I stop the playback, Kodi does a HEAD request to the supplied URL. It's not ISA anymore, so the custom user-agent is lost. This is a huge problem for me, because first I spam the server with unnecessary requests when the playback is over and secondly, because that request fails anyway.

It's always sent when I stop the playback.

If I use specify the headers for ISA and use the pipe as well then everything works as expected, but ISA treats the old method that uses the pipe format with priority, so there is literally no point in the new header format. One day ISA will not parse headers using the old format and then it would make sense, but for now I am getting those nasty deprecation notes if I want my addon to do the requests properly.

Is there anything I missed? Why is that HEAD request even necessary?

Thanks
Reply
#2
If you go to the Kodi settings > System > Logging > Enable Debug Logging, and also Enable Component Specific Logging (make sure the libcURL component is activated), do you see any info in the Kodi log after you pause and that myserious HEAD request happens?
Ideally you'd find if it's coming from InputStream.Adaptive or from Kodi, and go from there.
Reply

Logout Mark Read Team Forum Stats Members Help
Mysterious HEAD request when playback is over?0