Jump to content

Add M3U8 Headers to end of URL?


Go to solution Solved by Luke,

Recommended Posts

Posted

I have a stream that requires a header to be attached to the end of the URL, like an additional header; stream.m3u8|X-whatever. Otherwise, the stream refuses to play in Emby. It's not a user-agent, or a referrer. Could Emby be updated later to add support for additional headers on the end of an m3u8 stream when played?

Posted

Hi, why aren’t they just part of the m3u already?

Posted (edited)

Because it is part of the m3u. I made the playlist myself. What I am wanting to know is why is Emby not playing the stream with the header given at the end of the URL. It is required for the stream to play. It is not a referrer, or a user-agent, it's a custom header that is required. I can play the stream with the header in something like Channels DVR, but Emby refuses to play it. Below is an example of what I am trying to do. What I am trying to say is why anything past the bar part, .m3u8|X is not playing in Emby, but will play in something else like Channels DVR?

#EXTM3U

#EXTINF:-1,Station Name

https://example.com/.m3u8|X-Whatever

image.png.a25284e8cb1105fbf9b6e3284f0281e1.png

Edited by lawm0500
Posted (edited)
In the context of an M3U playlist, a pipe character () is an unofficial convention used by some media players to append custom HTTP headers to a URL. The syntax is not part of the standard M3U format, but it is widely supported by IPTV clients like Kodi's IPTV Simple Client and VLC. [1, 2, 3]
 
The pipe character is placed at the end of the stream URL, followed by one or more pairs for the headers. [2]

 

General format:
http://some.iptvserver.any/subfolder/master.m3u8|X-Forwarded-For=123.45.67.89 
Edited by speechles
  • Like 1
Posted
9 minutes ago, speechles said:

In the context of an M3U playlist, a pipe character () is an unofficial convention used by some media players to append custom HTTP headers to a URL. The syntax is not part of the standard M3U format, but it is widely supported by IPTV clients like Kodi's IPTV Simple Client and VLC. [1, 2, 3]

Correct!

The WebStreams plugin supports this:

 

(and TVnext M3U will support it as well)

Posted

Interesting, will have to play around with them. I will report back, see if I get my thing to work.

Posted

It seems like it imports fine, but the headers are completely missing. There is no |X header, only in the original playlist I made.

image.png.2f6e6d973a63d0f07082e5a58b3019b7.png

Posted

This is the other error I get. Just refusing to work. My header is a custom header, not a referrer, or a user-agent. Neither of them will work either. I haven't tried Next PVR, but that is only a last resort to use.

image.png.e7ad3d91e455465e18c95fb457b3991d.png

Posted

X-Forward isn't needed. What I found out is it is a custom header used only by the provider. A userid. So if I try to add it as both a referrer and a user-agent, or one or the other, it won't do anything at all. It has to go with the source URL, and it just doesn't show up at all.

Posted (edited)
2 minutes ago, lawm0500 said:

X-Forward isn't needed

This is an example to demonstrate the pattern for how to specify a header in the URL.

URL > PIPE > HeaderName > EqualSign > HeaderValue

Edited by softworkz
Posted

Where in Emby are you trying to use that URL?

Posted

Web streams, both single source, and loading the playlist itself in .m3u. It's a different URL of course, but that is essentially what I am trying to do. It's a custom header that Web Streams refuses to play.

Posted

Ah now I got it. No - only the playlist loader supports this. Not media urls.

Posted

Yeah, M3U Source in Web Streams takes away the |X- part as well, so Web Streams just refuses to play. The TV section also doesn't work with it, which now I know why from the beginning. Do you need me to send you the stream itself to look at?

Posted

@lawm0500 - I'm sorry for the confusion - I hadn't seen your post yesterday (only saw the response by speechless):

23 hours ago, lawm0500 said:

Because it is part of the m3u. I made the playlist myself. What I am wanting to know is why is Emby not playing the stream with the header given at the end of the URL. It is required for the stream to play. It is not a referrer, or a user-agent, it's a custom header that is required. I can play the stream with the header in something like Channels DVR, but Emby refuses to play it. Below is an example of what I am trying to do. What I am trying to say is why anything past the bar part, .m3u8|X is not playing in Emby, but will play in something else like Channels DVR?

#EXTM3U
#EXTINF:-1,Station Name
https://example.com/.m3u8|X-Whatever

 

20 hours ago, lawm0500 said:

Yeah, M3U Source in Web Streams takes away the |X- part as well, so Web Streams just refuses to play.

WebStreams doesn't take anything away - but it stores the URL - as-is - in Emby. 

The WebStreams plugin isn't involved in playback - this is done by Emby Server which in turn uses ffmpeg for accessing the stream. In the ffmpeg log, you should see that it invokes ffmpeg with the full URL (including the part after the pipe character). But since this is not a standardized format for URLs, ffmpeg sends a request to that full "artificial" URL. It doesn't convert the second part into request headers.

Posted (edited)

@softworkzOk, I found the log, and yeah, Web Streams is just disregarding the pipe at the end altogether:
: Server returned 401 Unauthorized (authorization failed). The header is required, and is being totally disregarded. When I look back in the log, I don't even see the pipe. When I added the stream into regular live TV ( built-in on Emby), the pipe is there, but gives a 404 Error instead, with a totally different host itself, which is strange.

Edited by lawm0500
  • 2 weeks later...
Posted
Quote

When I added the stream into regular live TV ( built-in on Emby), the pipe is there, but gives a 404 Error instead, with a totally different host itself, which is strange.

@lawm0500just to clarify, the built-in m3u tuner already supports this.

Posted
On 9/12/2025 at 7:57 PM, lawm0500 said:

Because it is part of the m3u. I made the playlist myself. What I am wanting to know is why is Emby not playing the stream with the header given at the end of the URL. It is required for the stream to play. It is not a referrer, or a user-agent, it's a custom header that is required. I can play the stream with the header in something like Channels DVR, but Emby refuses to play it. Below is an example of what I am trying to do. What I am trying to say is why anything past the bar part, .m3u8|X is not playing in Emby, but will play in something else like Channels DVR?

#EXTM3U

#EXTINF:-1,Station Name

https://example.com/.m3u8|X-Whatever

image.png.a25284e8cb1105fbf9b6e3284f0281e1.png

Emby does use the header. If you think it's not, then let's look at a specific example:

 

Posted
On 9/25/2025 at 5:38 PM, Luke said:

@lawm0500just to clarify, the built-in m3u tuner already supports this.

The domain is weird though, it's not the same, Emby changes the URL, and gives a 404 error when looking at the logs.

Posted
On 9/25/2025 at 5:40 PM, Luke said:

Emby does use the header. If you think it's not, then let's look at a specific example:

 

I would be happy to send the logs as a DM if it is ok with you guys.

Posted

Ok, did another test. Same issue. Just tested one stream, without and with the header for the built-in TV on Emby. Without the header, it works. With the header, it doesn't. So it seems to me that the header is not being loaded correctly, making the URL show a different domain then the stream without the header. I can DM you guys the log.

Posted
1 hour ago, lawm0500 said:

Ok, did another test. Same issue. Just tested one stream, without and with the header for the built-in TV on Emby. Without the header, it works. With the header, it doesn't. So it seems to me that the header is not being loaded correctly, making the URL show a different domain then the stream without the header. I can DM you guys the log.

HI there, can you please provide a specific example?

How to Report a Problem

Thanks !

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...