Cigaras / IPTV.bundle

Plex plug-in that plays live streams (like IPTV) from a M3U playlist
https://forums.plex.tv/discussion/83083
GNU General Public License v3.0
972 stars 290 forks source link

Expirating and signed .m3u file #100

Closed petrmenzel closed 5 years ago

petrmenzel commented 7 years ago

Hi, is there any way how to add .m3u (for me .m3u8) url with is signed and has expiration? I have my IPTV provider and I want to stream it in my home via this app. But I can generate 48 h url and after than I have to generate new by using my login ID and password OR use original app. Any idea? Thx you very much.

Cigaras commented 7 years ago

I would need a working example to investigate this situation further, but I doubt I'd be able to make a universal solution.

On the other hand, google is full of ways to login and download files from websites, use one of those, put downloaded playlist where plug-in can reach it and load it locally. But this way might be challenging for inexperienced users, why don't You just stick to original app?

petrmenzel commented 7 years ago

Why I do not want original app: it is more comfortable for me to play IPTV from Plex on any devices than use original app, where I have to be logged on every devices and I do no like the interface of the app.

I have monitored connections via WireShark and I have found this: http://“ip adress of my provider“:8118/ct24/1500000/stream.m3u8?start=0&end=9999999999999&type=live&realstart=1491169986964&dialect=cached&sign=pX8yBIoVlERPYuyTyy8SOw&expires=1491256385&stream_id=9c4b52c3-0912-4e4d-98a2-8f6d02aa488d

I have extraceted from the code upper this: http://“ip adress of my provider“:8118/ct24/stream.m3u8?type=live& expires=1491256385& sign=pX8yBIoVlERPYuyTyy8SOw

And put it to the m3u file which worked for 48 hours to expire:

#EXTM3U
#EXTINF:0,ČT24
http://“ip adress of my provider“:8118/ct24/stream.m3u8?type=live&expires=1491256385&sign=pX8yBIoVlERPYuyTyy8SOw

I can see the three options:

  1. Create own php script outside IPTV.bundle and in periodic time generate new .m3u file for IPTV.bundle. - I will have to study for a while ho to do it. And how to ask the server of my provider to get the same response as the original app.
  2. There will be ability in IPTV. bundle to add login option. - I am sking here.
  3. Generate new signed links via my Asus router. - I am waiting for reply from support to get answer.
Cigaras commented 7 years ago

Best I could do would be to add username and password values to HTTP Header, or make a HTTP Request with said values and continue using cookies, similarly like NFL plug-in works, but looks like it would not work in Your case.

I for sure will not do a procedure that would login into a specific website and get a specific link from it because it would work only with a specific provider, however it would be great to know how official app works. There is no official Plex plug-in that I could check out?

boldotcom commented 7 years ago

@petrmenzel What's the name of your IPTV provider? I can try to have a look at the app (APK), maybe we can find you how to get a new valid link in there. When we've found that, we can have a look what the best option would be to help you out in this situation.

petrmenzel commented 7 years ago

The provider: Kuki TV App for windows App for linux

boldotcom commented 7 years ago

@petrmenzel Thanks for providing! I've had a look and they seem to have a pretty decent API. Unfortunately I can't really test the endpoints due to the lack of login credentials. The only way I can look further into this is by having some login details. I don't expect you to provide me your login details, but is it possible to have a teamviewer session? Then I can try the endpoints while you're watching and Kuki won't detect a IP-switch cause we're still using your connection to test. Let me know if you're up for this! :-)

boldotcom commented 7 years ago

@petrmenzel Whoops! Guess I already found where the tokens come from 👍

https://as.kuki.cz/api/play-token.v2 This endpoint gets called every time you open a (new) channel. The JSON response provides both the values for the expires and sign parameters. Before you can call this, you need to authenticate yourself.

Best option would be option 1 like you suggested yourself. Create a PHP script that will automatically generate your new link or playlist. Run this localhost so Kuki won't detect any unexpected IP address switches.

All of the API codes can be found in the following python script on a Windows machine: PATH_OF_KUKI_INSTALLATION\addons\skin.netboxkuki\scripts\kuki_api.py

Good luck and if you need any more help, let me know! :)

petrmenzel commented 7 years ago

My brother has created php script which is generationg new m3u file every day. Thx you very much for help to find way 👍

rdudeja1133 commented 7 years ago

How can we get new m3u file... so we have a way to update on daily.... Please let me know

Regards RD

Sent from my iPhone

On Apr 9, 2017, at 8:00 AM, petrmenzel notifications@github.com<mailto:notifications@github.com> wrote:

My brother has created php script which is generationg new m3u file every day. Thx you very much for help to find way 👍

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/Cigaras/IPTV.bundle/issues/100#issuecomment-292784458, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ATF6sKPInhgDKYjplzf1CACjgYwoJGzXks5ruNZ8gaJpZM4M19Fm.

petrmenzel commented 7 years ago

How can we get new m3u file... so we have a way to update on daily

There will be php script and it will be run every day (via cron) on the NAS device where is my Plex server and IPTV.bundle app. Part of new m3u file will be dynamic with new sign and expiration recieved from my provider and part will be static with free IPTV from web (for example NASA).

petrmenzel commented 7 years ago

The m3u list works in VLC but in the Plex does not. :-/

error

Any idea?

petrmenzel commented 7 years ago

Strange: ☢ Web Plex - "There was a problem to playing this item" ☢❤ Android Plex - "Error: Playback has stopped because the connection to the Plex Media Server has been lost. Please ensure the server is aviable and retry." UPDATE - Direct play helped. ☢ Windows modern app Plex - "Connection error, title." ❤ Windows classic app Plex - works

I have tried Troubleshooting

  1. VLC works.
  2. UTF8 is ok.
  3. URL is m3u8.
  4. Direct play does not help.

I suppose that if it works in the one player it works. So where could be the problem?

I see the complication with direct play enabled/disbled because my server is weak to transcode movies so I prefer to direct play. If I want to use IPTV.bundle I will have to disble direct play for all media to play TV but I want play movie I have to go to the settings and enable it again.

There should be way to play this streams without transcoding? All my devices are able to play m3u8 streams out of the Plex in others apps.

Cigaras commented 7 years ago

@petrmenzel sorry, I lost Your last question and might be way too late with my answer, but if You want to leave Direct Play enabled on Your server and disabled for this plug-in only, You can disable option Optimized for streaming in preferences but I can not guarantee that it will work on all servers and clients. Also it is possible to use playlist attribute optimized_for_streaming that will overwrite said option for individual playlist entries.

petrmenzel commented 7 years ago

Thx you very much for answer. I have made solution this way: I have bought new server to be more powerful to play Plex :-). But I have not tried it so far. After that I do it I will let you know.

Scorpio256 commented 6 years ago

Any news on Kuki m3u?

petrmenzel commented 6 years ago

You have to generate your own depends on your login and password.

Scorpio256 commented 6 years ago

Can you tell me how? I have my own logins. I dont realy know how this work.

petrmenzel commented 6 years ago

Any news on Kuki m3u?

Solved by php script generating new .m3u8 file every day.

petrmenzel commented 6 years ago

Structure of playlist.m3u 📁open⯈ program.m3u 📁open⯈ program_resolution.m3u 📁open⯈ 5_sec_long_video_changed_every_time.ts

It works nice in the VLC and it works in the IPTV.bundle. But I would like to use all features of the Plex (EPG, recording etc.) and play it via tvhProxy (I prefer tvhProxy for the best stability).

@Cigaras I would like to ask you if you will be able to explain to me where is the difference between playing progam.m3u in IPTV.bundle and playing program.m3u via proxies like tvhProxy, Telly, Muxy? All of them are serving the program.m3u like IPTV.bundle. But only IPTV.bundle is able to play my 5_sec_long_video_changed_every_time.ts.

Thx you very much for explanation.

PM

Cigaras commented 5 years ago

Sorry @petrmenzel, I not have an answer to Your last question.