m3u icon indicating copy to clipboard operation
m3u copied to clipboard

Added support for processing M3U files in IPTV format

Open shnorbluk opened this issue 4 years ago • 10 comments

I added support for IPTV M3U format. It is used by players like Kodi or Perfect Player to watch free or paid TV channels. It can replace air or cable channels. You can see an example in the README.md of my fork repository (https://github.com/shnorbluk/m3u/blob/iptv/README.md). It is a replacement for PR#6, which I closed to open 3 simpler ones. This one contains only iptv specific features, isolated in dedicated modules, which are active only when "iptv" feature is used.

shnorbluk avatar Jan 31 '21 12:01 shnorbluk

@shnorbluk Thanks for your great work! Among them, there are non-standard tags that also widely used in IPTV: #EXTGRP, #EXTVLCOPT and others. The problem is that because is no standard, so they might be placed before or after #EXTINF tag.

So, it such cases could happened:

#EXTGRP:All
#EXTINF:-1 group-title="All",BR: AMC SD
http:/domain.net:80/token/here/29204

or

#EXTGRP:All
#EXTINF:-1 group-title="All",BR: AMC SD
#EXTVLCOPT:video-filter=invert:croppadd{croptop=50,cropbottom=50}
http:/domain.net:80/token/here/29204

Could you consider to implement support of these tags as well?

SerhiyRomanov avatar Mar 03 '21 11:03 SerhiyRomanov

Hi! Thank you for your comment. I don't have time for now but I will try to implement it later if you are interested. Do you have a link to a specification?

shnorbluk avatar Mar 04 '21 22:03 shnorbluk

Unfortunately, there is no standard regarding IPTV tags. I've implemented the support of such tags for a Python m3u parser library https://github.com/globocom/m3u8/pull/214/files

I use the next test case:

#EXTM3U
#EXTINF:-1 tvg-id="first" group-title="Common" catchup-days="7" catchup-type="flussonic" tvg-logo="http://ip.tv/icon/9195.png",First channel
#EXTGRP:Common
http://ip.tv/9195/mpegts/
#EXTINF:-1 group-title="News",Second News Channel
#EXTGRP:News
#EXTVLCOPT:param1=value1
#EXTVLCOPT:param2=value2
http://ip.tv/2/mpegts/

As you see, the #EXTGRP tag appears only one per segment and also means the same as group-title, but I store it as a separate string variable alongside with map of EXTINF properties.

The #EXTVLCOPT tags can appear many times per segment, so I store them as a list (vector, array).

Please write me an email when you will have free time. I very interesting in introducing this functionality but no have enough experience with Rust.

SerhiyRomanov avatar Mar 05 '21 12:03 SerhiyRomanov

Thank you! I found no more specs on Internet, so I can try to implement it with your example. But be patient :)

shnorbluk avatar Mar 20 '21 00:03 shnorbluk

Thanks for your contributions @shnorbluk, and sorry for the delayed response!

At a glance these changes look good. Is there any chance you'd be interested in helping to maintain the crate? I'd be happy to add you as a maintainer both here and on crates.io if you're interested? I'm afraid I'm swamped with crates these days and don't have a lot of time for m3u, and I don't want to block your progress on this!

mitchmindtree avatar Apr 13 '21 22:04 mitchmindtree

Yes I'm interested, as I continue to develop on this crate. It would be nice for me to have these features integrated in crates.io version. Thank you.

shnorbluk avatar Apr 17 '21 22:04 shnorbluk

@shnorbluk great to hear!

I think you should now have merge access to this repository. If you could let me know your crates.io user name, I can give you publishing access too (I tried your github user but cargo gave an error saying it could not find the user).

mitchmindtree avatar Apr 18 '21 14:04 mitchmindtree

@shnorbluk great to hear!

I think you should now have merge access to this repository. If you could let me know your crates.io user name, I can give you publishing access too (I tried your github user but cargo gave an error saying it could not find the user).

Thank you! In fact I don't have any account on crates.io, as I haven't published any crate yet. I am not a rust power user, my changes to your crate were necessary for my small project,. But if you want to give me access to your crate, you should now be able to do it. Thank you.

shnorbluk avatar Apr 19 '21 21:04 shnorbluk

OK, I think I've added you!

[nix-shell:~/programming/rust/m3u]$ cargo owner --add shnorbluk
    Updating crates.io index
       Owner user shnorbluk has been invited to be an owner of crate m3u

mitchmindtree avatar Apr 21 '21 14:04 mitchmindtree

Hello @shnorbluk and @mitchmindtree, I'm really interested in this feature, but I see that no update has been made. any news about this?

LindonAliu avatar May 03 '24 19:05 LindonAliu