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

#EXTGRP before #EXTINF breaks the parsing of playlist. #783

Open
noskill24 opened this issue Aug 16, 2023 · 19 comments
Open

#EXTGRP before #EXTINF breaks the parsing of playlist. #783

noskill24 opened this issue Aug 16, 2023 · 19 comments

Comments

@noskill24
Copy link

#EXTGRP after #EXTM3U breaks the playlist.
The first channel in this list will not work.

#EXTM3U
#EXTGRP:Entertainment
#EXTINF:-1,Channel 1
http://path-to-stream/live/channel-1.ts
#EXTINF:-1,Channel 2
http://path-to-stream/live/channel-2.ts
@phunkyfish
Copy link
Member

EXTGRP markers are only permitted after the channel is defined, and before the URL I believe.

@phunkyfish
Copy link
Member

EXTGRP markers are only permitted after the channel is defined, and before the URL I believe.

Ok, I just checked this and maybe it should work. What do you mean by breaks the playlist?

@noskill24
Copy link
Author

noskill24 commented Aug 19, 2023

EXTGRP marker - is begin named grouping.

All the channels (EXTINF-markers) after EXTGRP-marker belongs to the same group (EXTGRP) until the next EXTGRP will be found. Many IPTV players support EXTGRP in this manner. In this way EXTGRP works with group of channels.

EXTGRP after EXTINF and before channel-URL overrides the global EXTGRP found before and affects only current channel. Next channel without local EXTGRP belongs to global EXTGRP.

-- What do you mean by breaks the playlist?
Kodi can't parse the following sequence #EXTM3U; #EXTGRP; #EXTINF;. Also Kodi can't display the next channel if EXTGRP is found before EXTINF. But it should... And it should as I say above.

At least you should just skip global EXTGRP if you don't support it, but you should correctly parse the next EXTINF.
Just load the M3U from my post and see what happens.

The following M3U should be identical. First one is simply more optimized.

#EXTM3U

#EXTGRP:Entertainment
#EXTINF:-1,Channel 1
http://path-to-stream/live/channel-1.ts
#EXTINF:-1,Channel 2
http://path-to-stream/live/channel-2.ts

#EXTINF:-1,Channel 3
#EXTGRP:Sport
http://path-to-stream/live/channel-3.ts
#EXTM3U

#EXTINF:-1,Channel 1
#EXTGRP:Entertainment
http://path-to-stream/live/channel-1.ts

#EXTINF:-1,Channel 2
#EXTGRP:Entertainment
http://path-to-stream/live/channel-2.ts

#EXTINF:-1,Channel 3
#EXTGRP:Sport
http://path-to-stream/live/channel-3.ts

@phunkyfish
Copy link
Member

Groups are only supported per channel and only after the EXTINF and before the URL.

The amount of the effort to make this work how you want is not worth it. It would mean rewriting a large part for the M3U parser logic (in C++) for a feature that is not in widespread use. It would be less effort to just write a converter for your M3U file in Python.

@noskill24
Copy link
Author

noskill24 commented Aug 19, 2023

Ok! If you don't support EXTGRP in global space, then just SKIP and IGNORE them, as all IPTV software do with unsupported features.

KODIs parser simply fails and do not display the next channel (EXTINF) after EXTGRP. KODI can't load such playlists correctly. Other players load such playlists without errors, they simply ignore that unsupported EXTGRP.

I'm using online M3U provider with dynamic URLs, so I can't convert it every day after update.

@phunkyfish
Copy link
Member

Ok! If you don't support EXTGRP in global space, then just SKIP and IGNORE them, as all IPTV software do with unsupported features.

KODIs parser simply fails and do not display the next channel (EXTINF) after EXTGRP. KODI can't load such playlists correctly. Other players load such playlists without errors, they simply ignore that unsupported EXTGRP.

I'm using online M3U provider with dynamic URLs, so I can't convert it every day after update.

I can try to do something but it might not be possible. The parser has no concept of position in the M3U. It simply expects lines to be in the right order.

Will let you know if/when I have something ti test.

But a question first, is it only the first channel that gets skipped or is it every channel with an EXTGRP in the wrong place?

@noskill24
Copy link
Author

noskill24 commented Aug 20, 2023

Each first EXTINF (first only) after EXTGRP fails. These channels don't display.

Just load this M3U and see what happens... Channel 1 and 3 will not display.

#EXTM3U

#EXTGRP:Entertainment
#EXTINF:-1,Channel 1
http://path-to-stream/live/channel-1.ts
#EXTINF:-1,Channel 2
http://path-to-stream/live/channel-2.ts

#EXTGRP:Sport
#EXTINF:-1,Channel 3
http://path-to-stream/live/channel-3.ts
#EXTINF:-1,Channel 4
http://path-to-stream/live/channel-4.ts

@phunkyfish
Copy link
Member

Ok, so there was actually a small bug here. In your example channels 1 and 3 should be in a group and 2 and 4 should not.

Fixed in this PR: #784
Testbuilds for Nexus: https://jenkins.kodi.tv/blue/organizations/jenkins/kodi-pvr%2Fpvr.iptvsimple/detail/PR-784/4/artifacts
Testbuilds for Omega: https://jenkins.kodi.tv/blue/organizations/jenkins/kodi-pvr%2Fpvr.iptvsimple/detail/PR-785/1/artifacts

@noskill24
Copy link
Author

Actually channels 1, 2 should be in the same group, and 3, 4 in another as of EXTGRP describes a begin named grouping.
But ok, at least all the channels now will appear in the menu. Thanks.

@phunkyfish
Copy link
Member

phunkyfish commented Aug 21, 2023

Actually channels 1, 2 should be in the same group, and 3, 4 in another as of EXTGRP describes a begin named grouping. But ok, at least all the channels now will appear in the menu. Thanks.

That's your feature request though. The behaviour for the add-on is that EXTGRP behaves the same way as the group-title tag in the channel definition (i.e. it only affects the next channel). I have not found any examples online following your description. Just examples describing the former.

I'm happy to look at this if I can see examples of this online. But do note that if anyone was to mix EXTGRP and group-title, the group-title would end any EXTGRP block.

@phunkyfish
Copy link
Member

What platform are you running on and what version of Kodi do you use?

@noskill24
Copy link
Author

noskill24 commented Aug 21, 2023

-- I have not found any examples online following your description. Just examples describing the former.

BorPas-Soft IP-TV Player for Windows for example.
My local Internet providers M3U has the same structure. And their hardware support it.

-- What platform are you running on and what version of Kodi do you use?

Kodi v20.2 (Nexus) for Windows

@phunkyfish
Copy link
Member

Ok, can you try the testbuild from here and let me know how you get on?

https://jenkins.kodi.tv/blue/organizations/jenkins/kodi-pvr%2Fpvr.iptvsimple/detail/PR-784/8/artifacts

@noskill24
Copy link
Author

noskill24 commented Aug 22, 2023

What should I test exactly?

All the channels now appear in the menu (as expected). Thanks for fixing!

Only first channel after EXTGRP is in group as described in your comment:
#783 (comment)

@phunkyfish
Copy link
Member

What should I test exactly?

All the channels now appear in the menu (as expected). Thanks for fixing!

Only first channel after EXTGRP is in group as described in your comment: #783 (comment)

It should respect EXTGRP as a begin group specifier. But only in the test build above.

@noskill24
Copy link
Author

noskill24 commented Aug 23, 2023

EXTGRP affects only first channel... as described here #783 (comment)

@phunkyfish
Copy link
Member

Strange, let me rebuild the PR. Because it’s working for me with your example.

@phunkyfish
Copy link
Member

phunkyfish commented Aug 23, 2023

Ok, https://jenkins.kodi.tv/blue/organizations/jenkins/kodi-pvr%2Fpvr.iptvsimple/detail/PR-784/8/artifacts is definitely the correct build of the add-on.

With this exact example I get two channels in each group:

#EXTM3U

#EXTGRP:Entertainment
#EXTINF:-1,Channel 1
http://path-to-stream/live/channel-1.ts
#EXTINF:-1,Channel 2
http://path-to-stream/live/channel-2.ts

#EXTGRP:Sport
#EXTINF:-1,Channel 3
http://path-to-stream/live/channel-3.ts
#EXTINF:-1,Channel 4
http://path-to-stream/live/channel-4.ts

@noskill24
Copy link
Author

Oh, I apologize. I have checked my version and it was 20.10.0... It seems something gone wrong with my installation of 20.10.1.

I have re-downloaded and re-installed the version 20.10.1-win-x86_64. And it works fine!

Thank you very much!

@noskill24 noskill24 changed the title #EXTGRP after #EXTM3U breaks the playlist. #EXTGRP before #EXTINF breaks the parsing of playlist. Sep 5, 2023
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