xbmc / inputstream.adaptive

kodi inputstream addon for several manifest types
Other
443 stars 240 forks source link

Support for clearkey #811

Open Zoom-Adr opened 2 years ago

Zoom-Adr commented 2 years ago

is there any development for clearkey support soon?

glennguy commented 2 years ago

It's not super high on the priority list - are there any services that use it?

Zoom-Adr commented 2 years ago

not sure which services but there are some streams that use clearkey

rysson commented 2 years ago

Hi, @glennguy, yes, discovery/eurosport for example (via player.pl).

carlosbalsas commented 2 years ago

Not implemented that yet?

glennguy commented 2 years ago

No not yet. Only really 2 active developers on this project at the moment, we're working our way through cleaning up and refactoring the code and once done we can look at new features such as this.

glennguy commented 1 year ago

Any service that use widevine can handle clearkey

Sure, anything can 'handle' clearkey however providers don't typically implement clearkey because as the name implies the key is not protected.

It's even easier to setup clearkey than widevine because you dont have to deal with http headers and stuff.

there's nothing preventing a provider from enforcing seeing particular headers for any stream

I get this feature is wanted, happy to review PRs anytime however if you want the very small active development team to implement then unfortunately it will wait until we have time.

mmBesar commented 1 year ago

clearkey support would be great, thank you.

glennguy commented 1 year ago

It's on my to-do list, I will try to get to it soon

aicynide commented 11 months ago

Please add clearkey

glennguy commented 11 months ago

Everyone - this isn't a poll. It will be done when it's done. No promises but hopefully in the next couple of months.

glennguy commented 9 months ago

Anyone watching this issue - Can I get a clearkey stream or two to test on?

glennguy commented 9 months ago

Any chance for something that isn't geoblocked or requiring sign in cookies?

gpascualUY commented 9 months ago

Two different manifest formats. Same KEY:

https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p_ClearKey.mpd
https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p.mpd
9eb4050de44b4802932e27d75083e266:166634c675823c235a4a9446fad52e4d
Uukrull commented 9 months ago

Another one from https://bitmovin.com/demos/drm:

https://cdn.bitmovin.com/content/assets/art-of-motion_drm/mpds/11331.mpd
eb676abbcb345e96bbcf616630f1a3da:100b6c20940f779a4589152b57d2dacb

And this one:

http://www.bok.net/dash/clearkey_example/stream.mpd
000102030405060708090a0b0c0d0e0f:00112233445566778899aabbccddeeff

Will it support multiple keys? i.e:

#KODIPROP:inputstream.adaptive.license_key={"kid1": "key1", "kid2": "key2", "kid3": "key3", "kid4": "key4"}

glennguy commented 9 months ago

@Uukrull I was thinking more along the lines of manifests that have clearkey specified in the content protection. But we could add support for giving IA key/keyID pairs.

From what I can see it looks like there's Android streaming players out there that have adopted the playlist format for inputstream.adaptive and extended it to support clearkey too. Is your example above #KODIPROP:inputstream.adaptive.license_key={"kid1": "key1", "kid2": "key2", "kid3": "key3", "kid4": "key4"} how this works for these streaming players? Or just your suggestion?

Uukrull commented 9 months ago

From what I can see it looks like there's Android streaming players out there that have adopted the playlist format for inputstream.adaptive and extended it to support clearkey too. Is your example above #KODIPROP:inputstream.adaptive.license_key={"kid1": "key1", "kid2": "key2", "kid3": "key3", "kid4": "key4"} how this works for these streaming players? Or just your suggestion?

Yes, that is how it works. Anyway, are you sure you want to add clearkey support to Kodi? That may open a pandora's box you don't want to deal with.

Clearkey means that if you don't a have real subscription to a service you still can use it if you know the mpd and the key(s).

glennguy commented 9 months ago

Happy to add it since it's a legitimate content protection method. Not so keen on the abuse side of things but I'm interested to hear how you will think it will play out. Most publishers also have security on access to the mpds and segments themselves and generally discovery of keys leads to downloading the content and reposting rather than allowing for streaming in which case the provider can rotate the keys or the content itself can expire...

Uukrull commented 9 months ago

Not so keen on the abuse side of things but I'm interested to hear how you will think it will play out.

Believe me, it will be abuse to the point that what remains of the good name Kodi has as a media player not related to piracy will be shattered to pieces.

CastagnaIT commented 9 months ago

Clearkey means that if you don't a have real subscription to a service you still can use it if you know the mpd and the key(s).

A service without protection cookies or other custom headers looks weird, however ill-intentioned users there are and always will be, but it is not our place to judge whether this DRM is unreliable or not, the important thing is to implement it correctly, since ClearKey is already supported by almost all browsers, and major brands like playstation android boxes apple products etc, i dont see big problems at the end its the service provider to decide whether to support it or not

for example shaka, allow to configure clearkey in similar way: https://shaka-player-demo.appspot.com/docs/api/tutorial-drm-config.html or https://developer.bitmovin.com/playback/docs/how-to-play-mpeg-cenc-clearkey-content

a sample is: https://reference.dashif.org/dash.js/latest/samples/drm/clearkey.html

Uukrull commented 9 months ago

A service without protection cookies or other custom headers looks weird

In this thread you have an example from a well known provider and there are hundreds of examples like that.

CastagnaIT commented 9 months ago

i think also that we should stop add new behaviours to inputstream.adaptive.license_key this very mess old property should be deprecated and changed with a new improved one

if we have to add a new support to add kid/key pairs would be better is introduce a new inputstream.adaptive.drm since there is intention to add a json lib depenency the value to be set can be as json string, where in future will replace inputstream.adaptive.license_key

python addons will do:

drm_config = {
    "clearkeys": {"kid": "key","kid": "key"},
    "license_servers": {"com.widevine.alpha": "http://www."},  # << this in future
    "license_headers": "...",  # << this in future
    ...
}
listitem...drm...prop = json.dumps(drm_config)

will be a bit more complex for C++ addons such as pvr to create manually the json string without json lib, but not so impossible

In this thread you have an example from a well known provider and there are hundreds of examples like that.

if so, you can play that stream with any players as shaka player

MiyasakiYoshi commented 9 months ago

Clearkey means that if you don't a have real subscription to a service you still can use it if you know the mpd and the key(s).

A service without protection cookies or other custom headers looks weird, however ill-intentioned users there are and always will be, but it is not our place to judge whether this DRM is unreliable or not, the important thing is to implement it correctly, since ClearKey is already supported by almost all browsers, and major brands like playstation android boxes apple products etc, i dont see big problems at the end its the service provider to decide whether to support it or not

for example shaka, allow to configure clearkey in similar way: https://shaka-player-demo.appspot.com/docs/api/tutorial-drm-config.html or https://developer.bitmovin.com/playback/docs/how-to-play-mpeg-cenc-clearkey-content

a sample is: https://reference.dashif.org/dash.js/latest/samples/drm/clearkey.html

Yes, you are right. I think there are illegal streamers that are just worried their leaked keys will now start to be useless as like @glennguy pointed out, providers will start to rotate keys and add more protection and hence the easy income a lot of IPTV providers will stop since Kodi is such a popular streaming platform. Probably for the better that the providers actually have to work.

aicynide commented 2 months ago

Patiently waiting

fkoemep commented 2 months ago

Patiently waiting too, for now I'm using shaka to cast some ClearKey streams to my device, but would love to have those streams in a playlist file ready to be played directly from Kodi!

Iniyan-I commented 2 weeks ago

Waiting...

glennguy commented 1 day ago

Hi all, can you please check out #1598 and give some feedback if possible?

fkoemep commented 23 hours ago

Hi all, can you please check out #1598 and give some feedback if possible?

Using your DASH sample it works on Android 14 with Kodi 21 aarch64! Unfortunately when I tried one of the playlists I normally use it force closes 😔

glennguy commented 4 hours ago

@fkoemep this change isn't designed to accept these playlists that have 'extended' the inputstream.adaptive Kodi properties.

Could you provide an example of the MPD or M3U8 file that the playlist you have is linking to, plus the Kodi properties that are in the main M3U8 playlist? At least we can look at getting it to not crash and instead give a useful error message.