iptv-proxy icon indicating copy to clipboard operation
iptv-proxy copied to clipboard

FR - custom user-agent and one stream -> multi-clients

Open SteamyNix opened this issue 2 years ago • 5 comments

Two clients using the same channel link uses two streams from the provider source. What would it take to send the single channel stream to two clients like TVHeadend does? (Sorry if that's a dumb question)

Unrelated, the client / user-agent is "Java-http-client/18..." Is there a way to set that otherwise? I searched and found some Java code but I have no idea where that would belong. Thanks for sharing this work. I've had a good time compiling and testing it.

SteamyNix avatar May 11 '23 06:05 SteamyNix

There was an idea to make multiplexing for channels. And it is really possible to implement this, but code will be a little bit more complex and will require additional caching layer and I'm a little bit lazy already :) The biggest problem is with timeshift and how different clients are implemented.

User agent can be changed with small changes in the code. We need to provide setting for this and set header in HttpRequest.newBuilder()....

Example: https://stackoverflow.com/questions/60854339/how-to-change-the-user-agent-string-for-java-net-http-httpclient

kvaster avatar May 17 '23 06:05 kvaster

Thanks! I'll try.

steamyRayV avatar May 25 '23 17:05 steamyRayV

Well, having an option to stream one iptv provider connection to several clients would be really cool feature! For example, I have one iptv provider of a higher price (due to 4k streaming) and both me and my father watch the same sport event from the same channel from different cities simultaneously. It happens few times a month therefore not too much sense to buy second subscription. Seems that for now tvheadend is the only option for me. Basically I can import iptv channels into tvh and then re-import them from tvh to iptv-proxy in order to have the channels properly distributed to all my TVs through single playlist.

prog1407 avatar Jul 13 '23 11:07 prog1407

the trick with user agent could also be helpful as some iptv providers may try to ban users with "weird" agents to prevent subscription sharing) Did that part on my fork https://github.com/prog1407/iptv-proxy/commit/9bbd06a76398449615c4d97c0c5b8626d36f5ab6

prog1407 avatar Jul 13 '23 12:07 prog1407

Seems that for now tvheadend is the only option for me. Basically I can import iptv channels into tvh and then re-import them from tvh to iptv-proxy in order to have the channels properly distributed to all my TVs through single playlist.

TVHeadend is great but it forces you to output TS container without support for HLS, correct?

steamyRayV avatar Jul 25 '23 18:07 steamyRayV