Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pvr.iptvsimple compatibility with plugin.video.live.streamspro (escaped) playlist entries #935

Open
enerdude opened this issue Jan 6, 2025 · 7 comments

Comments

@enerdude
Copy link

enerdude commented Jan 6, 2025

Hi there, I'm taking a long shot here but hoping you can help.

I don't code but over time with some googling taught myself a bit of python. So I've been using Livestreams Pro addon that allows some basic coding inside a xml file to write little scripts mainly to play streams I extract from various websites - this is much simpler than creating a whole kodi addon of which I don't know much.

plugin.video.live.streamspro was originally created by Shani but he stopped maintaining it while it was still in Python 2 form and I was glad to find it converted to Python 3 by Gujal. You can download it here

So to give you some example I will attach a sample xml file to this post which can be imported into the addon via its settings menu. One can then run it from there but first prize is obviously exporting the xml as a playlist entry - the only way I have found to do this is by long pressing on the entry and adding it to favourites (like any item in kodi).

Next step is then to open favourites.xml in Kodi userdata folder and find the "plugin://plugin.video.live.streamspro/?url=...(urlencoded xml code)", copy it to notepad, replace all
& with &

Final result in the case of the example I have given you would be:

plugin://plugin.video.live.streamspro/?url=%24doregex%5Bget-url%5D&mode=17&regexs=%7B%27get-url%27%3A%20%7B%27name%27%3A%20%27get-url%27%2C%20%27expres%27%3A%20%22%23%24pyFunction%5Cndef%20getUrl%28%29%3A%5Cn%20%20import%20xbmcgui%5Cn%20%20xbmcgui.Dialog%28%29.ok%28%27info%27%2C%20%27Press%20ok%20to%20start%20stream%27%29%5Cn%20%20url%20%3D%20%27https%3A//lightning-now70s-samsungnz.amagi.tv/playlist.m3u8%27%5Cn%20%20return%20url%5Cn%5Cndef%20GetLSProData%28page_data%2CCookie_Jar%2Cm%29%3A%5Cn%20%20import%20urllib.parse%5Cn%20%20origin%20%3D%20%27https%3A//example.com%27%5Cn%20%20referer%20%3D%20%27https%3A//example.com/%27%5Cn%20%20useragent%20%3D%20%27Mozilla/5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%3B%20rv%3A131.0%29%20Gecko/20100101%20Firefox/131.0%27%5Cn%20%20url%3DgetUrl%28%29%5Cn%20%20return%20url%20%2B%20%27%7CUser-Agent%3D%27%20%2B%20urllib.parse.quote_plus%28useragent%29%20%2B%20%27%26Origin%3D%27%20%2B%20urllib.parse.quote_plus%28origin%29%20%2B%20%27%26Referer%3D%27%20%2B%20urllib.parse.quote_plus%28referer%29%5Cn%22%2C%20%27page%27%3A%20None%2C%20%27cookiejar%27%3A%20%27%27%7D%7D

So the above playlist item plays fine when I put it inside a m3u or strm file, problem only arises when I import the the m3u into pvr.iptvsimple, then there is some error from plugin.video.live.streamspro and it does not play

The only thing that makes sense to me is maybe the way you parse playlist urls, as you can see the above line is url encoded and can also become quite long as one add more code to the xml file.

Let me know what you think? Thanks in advance.
example.zip

@enerdude
Copy link
Author

enerdude commented Jan 6, 2025

Maybe @Gujal00 can also give some input here?

@enerdude
Copy link
Author

enerdude commented Jan 6, 2025

Another thought that has come up, what is the longest the playlist url can be when parsed by pvr.iptvsimple? Maybe it is cutting off some of the code?

@phunkyfish
Copy link
Member

It will be either 1024 or 2048.

but this limit is removed in Kodi 22 if you want to try that.

@enerdude
Copy link
Author

enerdude commented Jan 6, 2025

It will be either 1024 or 2048.

but this limit is removed in Kodi 22 if you want to try that.

Ok guess it is 1024 cause my example link is 1116.
I tried it in the 05Jan2025 nightly build of Kodi 22 and it is working. Guess I will have to switch.

@phunkyfish
Copy link
Member

phunkyfish commented Jan 6, 2025

So your URL is really long. Does it really need to be that length?

Or can your plugin do most of the heavy lifting?

most plugin authors who leverage iptvsimple supply a shortened URL with just an id used as a key.

Edit: NVM, I misread your post.

@enerdude
Copy link
Author

enerdude commented Jan 6, 2025

Yeah the nature of the livestreamspro addon is that it embeds all the code in the url, so it can really become long. Not the most efficient way of doing things but the easiest for me (as a non-coder) to write little python scripts without having to create an addon from scratch.

@phunkyfish
Copy link
Member

Makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants