add-ons / service.iptv.manager

Integrate TV and radio channels with EPG data from other add-ons in Kodi PVR.
https://github.com/add-ons/service.iptv.manager/wiki
GNU General Public License v3.0
95 stars 28 forks source link

Add support for #KODIPROP #68

Closed michaelarnauts closed 3 years ago

michaelarnauts commented 3 years ago

This PR adds support to put #KODIPROP-lines in the generated m3u playlist. These properties can be used to give additional information to Kodi on how to play an URI. The property is optional.

Example python JSON-STREAMS object:

dict(
    id='channel1.com',
    name='Channel 1',
    preset=1,
    stream='plugin://plugin.video.example/play/1',
    logo='https://example.com/channel1.png',
    kodiprops={
        'inputstream': 'inputstream.ffmpegdirect',
        'inputstream.ffmpegdirect.is_realtime_stream': 'true',
        'mimetype': 'video/mp2t',
    }
)

This will generate the following m3u:

#EXTINF:-1 tvg-name="Channel 1" tvg-id="channel1.com" tvg-logo="https://example.com/channel1.png" tvg-chno="1" group-title="Example IPTV Addon" catchup="vod",Channel 1
#KODIPROP:inputstream=inputstream.ffmpegdirect
#KODIPROP:inputstream.ffmpegdirect.is_realtime_stream=true
plugin://plugin.video.example/play/1
dagwieers commented 3 years ago

Only remark is to rename it to kodiprops as it represents a list.

michaelarnauts commented 3 years ago

Only remark is to rename it to kodiprops as it represents a list.

Good point. Will change this.

michaelarnauts commented 3 years ago

When using plugin://-URI's as a stream, you will probably need to set the use the list_item.setProperty() before you pass them to setResolvedUrl.

I think these #KODIPROP are only needed when using direct http:// links in the stream-attribute of the JSON-STREAMS.

@Lunatixz when do you use #KODIPROP in your playlists?

Lunatixz commented 3 years ago

It's only needed when using direct url as your stream not for resolved paths.

dagwieers commented 3 years ago

I think that is valid, even when our normal use case tends to be plugin:// URLs (e.g. to reauthenticate when needed, or do additional lookups) there are cases where a direct URL is sufficient.

And we always wanted JSON-STREAMS to represent a full M3U8 feature set for Kodi use.

Lunatixz commented 3 years ago

Typically, if you're redirecting to a plugin:// path; it ought to inject kodi player properties... as you mentioned there could be a need somewhere and your m3u/xmltv feature set ought represent all parameters available.