How can Kodi play an m3u8 stream URL?

I would like to play an url like this: https://xyz1234…m3u8 in my OSMC player.
If I use the URL in a web browser it does not work, but when used on VLC it does play on my laptop.
But I would like to play on my TV and therefore via OSMC/Kodi, if possible.

Any suggestions?

https://kodi.wiki/view/Internet_video_and_audio_streams

PERFECT!
Worked like a charm, right away!
Much appreciated! :smiley: :birthday:

1 Like

Not yet finished…
In the Kodi file list when I navigate to the strm folder Kodi displays the ending part of the URL contained inside the file instead of the name of the strm file!
So instead of my wanted filename it shows mono.m3u8, which is not particularly good when several of the stream files in the directory will contain similar urls ending with .m3u8

Is there a way to tell Kodi to show the actual name of the file instead?
Or else a “friendly” name embedded in the file separate from the URL?

I also found that some of my stream URL:s did not work at all, apparently there is a need for an extra argument to the call to ffmpeg like:
-user_agent “Mozilla”
or
-referer <URL of page> where the m3u8 stream emanates from

Can this be inserted somehow?
When I use this for my download scripts ffmpeg is able to stream and save the video to file.
But I am now looking for a way to stream directly to my TV screen without the download-wait-play sequence…

The page @grahamh linked you to talks about creating an NFO file for the STRM file so it can be better integrated (even scanned to your library). I haven’t tried it, but it will probably do what you want.

Well, NFO files seem to be connected to library creation and since I am not using libraries at all (I am just playing normal mp4 video files and in this case Internet streams). So I cannot see how “associate meta-data, such as cover art and summaries” will help to actually make the URL play at all. It seems like the webpage the video sits on plays if it gets the impression that the referer to the m3u8 stream is the webpage itself. In ffmpeg scripts I do this:

CMD="ffmpeg -hide_banner -referer \"${VIDEOURL}\" -i \"${VIDEOSTR}\" -vf scale=w=-4:h=480 -c:v libx264 -preset fast -crf 26 -c:a copy -t ${CAPTURETIME} ${TARGETFILE}"

Where VIDEOURL is the webpage where the video player resides and VIDEOURL is the stream URL (the m3u8 url).
I need a way to forward the webpage URL as well as the stream URL to the playing system in Kodi.

We believe this is a Kodi issue or a specific Kodi function and as such you should look at addressing the issue there. If you do believe that this is an OSMC specific issue, please let us know.

Ok thanks, I have started a new thread at the Kodi forum concerning this.

UPDATE for completeness and future visits:
I have asked at the KODI forum and got referred to this documentation page.
Here the solution is found:
In the strm file just add the following to the stream URL end:
|referer=webpage-url
where you enter the actual URL to the webpage itself as the referer.
This will add the correct referer argument to the call to the source and it works!
:smiley: :birthday: :heart_eyes:

2 Likes