Axinom integration with inputstream.adaptive
#1
Hi everyone,

can someone please advise on how to integrate Axinom DRM with Kodi inputstream.adaptive.
Background: I am maintainer of this plugin: LivGolf and the provider has recently activated drm.

What did I try?
There is a turtorial on how to use the DRM: here.
It even provides a demo that one can study.

The licence URL is provided and obviously correct. There is then a license token provided which is passed in the htttp header: X-Axdrm-Message
What I don't know is what should be the post data. I have tried |R{SSM}|R in this code:
Code snippet:

        playitem.setProperty('inputstream.adaptive.license_key',
                             license_url +
                             "|User-Agent=" + user_agent +
                             "&origin=https://www.livgolfplus.com" +
                             "&referer=https://www.livgolfplus.com/" +
                             "&X-Axdrm-Message=" + license_token + "|R{SSM}|R")
because I thought the data send and returned is raw - but I don't know...

During run-time it results in inputstream complaining with:
Error:

AddOnLog: inputstream.adaptive: LogDecryptError: Decrypt failed with error: 2 and key: xxx..xxx
AddOnLog: inputstream.adaptive: Decrypt Sample returns failure!

Maybe anybody more knowledgeable with inputstream can help.
Reply
#2
perhaps this would be helpful - https://github.com/xbmc/inputstream.adap...ntegration

you basically have to watch the mechanism in action when accessing the resource

from your linked readme url:
"licenseToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjogMSwiY29tX2tleV9pZCI6ICI0N2RhM2NlMC04ZjFlLTQ4NDYtYTUwZi1hZTc0MDAzY2Y0MmMiLCJtZXNzYWdlIjogeyAgInR5cGUiOiAiZW50aXRsZW1lbnRfbWVzc2FnZSIsICAidmVyc2lvbiI6IDIsICAiY29udGVudF9rZXlzX3NvdXJjZSI6IHsgICAgImlubGluZSI6IFsgICAgICB7ICAgICAgICAiaWQiOiAiOWViNDA1MGQtZTQ0Yi00ODAyLTkzMmUtMjdkNzUwODNlMjY2IiwgICAgICAgICJlbmNyeXB0ZWRfa2V5IjogIjgwOWxkUzVYM1VqU29ON1ovMjN6aFE9PSIgICAgICB9ICAgIF0gIH19fQ.OaOk2jS3KreIB4WCqBD4_0GI4S5Hb_yiWEORLRL-qCA"

that appears to be base64 to me, base64 url encoded would replace characters in the base64 string with their % values in certain cases (slashes for example)


hope that helps
Reply
#3
(2023-05-29, 13:24)Nirvana-777 Wrote: Hi everyone,


The licence URL is provided and obviously correct. There is then a license token provided which is passed in the htttp header: X-Axdrm-Message
What I don't know is what should be the post data. I have tried |R{SSM}|R in this code:
Code snippet:

        playitem.setProperty('inputstream.adaptive.license_key',
                             license_url +
                             "|User-Agent=" + user_agent +
                             "&origin=https://www.livgolfplus.com" +
                             "&referer=https://www.livgolfplus.com/" +
                             "&X-Axdrm-Message=" + license_token + "|R{SSM}|R")

Try with this
 
Code:
burl = 'https://www.livgolfplus.com'
lic = '{0}|User-Agent={1}&Referer={2}/&Origin={2}&X-AxDRM-Message={3}&Content-Type= |R{SSM}|'.format(license_url, user_agent, burl, license_token)
playitem.setProperty('inputstream.adaptive.license_type', 'com.widevine.alpha')
playitem.setProperty('inputstream.adaptive.license_key', lic)
playitem.setProperty('inputstream', 'inputstream.adaptive')
playitem.setProperty('inputstream.adaptive.manifest_type', 'mpd')
playitem.setMimeType('application/dash+xml')
playitem.setContentLookup(False)

There is an intentional space between `Content-Type` and `|`
Kodi 21 Windows 10 and 11 | 21 Xbox One X | 21 Linux Mint Virginia XFCE | CoreELEC NO 21 nightly S905X4 aarch64
Reply
#4
This used to work - the key has now expired but the formatting should be correct:

Code:

#KODIPROP:inputstream=inputstream.adaptive
#KODIPROP:inputstream.adaptive.manifest_type=mpd
#KODIPROP:inputstream.adaptive.license_type=com.widevine.alpha
#KODIPROP:inputstream.adaptive.license_key=https://drm-widevine-licensing.axtest.net/AcquireLicense|X-AxDRM-Message=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICJ2ZXJzaW9uIjogMSwKICAiY29tX2tleV9pZCI6ICI2OWU1NDA4OC1lOWUwLTQ1MzAtOGMxYS0xZWI2ZGNkMGQxNGUiLAogICJtZXNzYWdlIjogewogICAgInR5cGUiOiAiZW50aXRsZW1lbnRfbWVzc2FnZSIsCiAgICAidmVyc2lvbiI6IDIsCiAgICAibGljZW5zZSI6IHsKICAgICAgImFsbG93X3BlcnNpc3RlbmNlIjogdHJ1ZQogICAgfSwKICAgICJjb250ZW50X2tleXNfc291cmNlIjogewogICAgICAiaW5saW5lIjogWwogICAgICAgIHsKICAgICAgICAgICJpZCI6ICIzMDJmODBkZC00MTFlLTQ4ODYtYmNhNS1iYjFmODAxOGEwMjQiLAogICAgICAgICAgImVuY3J5cHRlZF9rZXkiOiAicm9LQWcwdDdKaTFpNDNmd3YremZ0UT09IiwKICAgICAgICAgICJ1c2FnZV9wb2xpY3kiOiAiUG9saWN5IEEiCiAgICAgICAgfQogICAgICBdCiAgICB9LAogICAgImNvbnRlbnRfa2V5X3VzYWdlX3BvbGljaWVzIjogWwogICAgICB7CiAgICAgICAgIm5hbWUiOiAiUG9saWN5IEEiLAogICAgICAgICJwbGF5cmVhZHkiOiB7CiAgICAgICAgICAibWluX2RldmljZV9zZWN1cml0eV9sZXZlbCI6IDE1MCwKICAgICAgICAgICJwbGF5X2VuYWJsZXJzIjogWwogICAgICAgICAgICAiNzg2NjI3RDgtQzJBNi00NEJFLThGODgtMDhBRTI1NUIwMUE3IgogICAgICAgICAgXQogICAgICAgIH0KICAgICAgfQogICAgXQogIH0KfQ._NfhLVY7S6k8TJDWPeMPhUawhympnrk6WAZHOVjER6M|R{SSM}|
https://media.axprod.net/TestVectors/Cma...nifest.mpd

The forum has forced a newline, sorry about that.
Reply
#5
By the way - you will quite often see those 2 error log statements when the license request is first being done. Please enable debug logging and check to see if the license server returns bad or not.
Reply
#6
Thank you everyone!

In the end this is the working code:

Code:

burl = 'https://www.livgolfplus.com'
lic = license_url + '|User-Agent=' + user_agent + '&Referer=' + burl +'/&Origin=' + burl + '&X-Axdrm-Message=' + license_token + '&Content-Type= |R{SSM}|'
playitem.setProperty('inputstream.adaptive.license_key', lic)

Really appreciated your help!
Reply

Logout Mark Read Team Forum Stats Members Help
Axinom integration with inputstream.adaptive0