aussieaddons / repo

Aussie Add-ons repository for Kodi
http://aussieaddons.com/installation/
103 stars 44 forks source link

SBS on Demand authentication problem #26

Closed prfemlchem closed 8 years ago

prfemlchem commented 8 years ago

This issue reports a problem identified with the plugin.video.sbs v1.0.2 module and the resolution.

I just installed v1.0.2 of the SBS On Demand catchuptv module (plugin.video.sbs) in Kodi 15.2 on OS X10.10. Thank you for your work on this.

I have found the module is working fine up until the request to stream the selected item. Looking at the log file reveals the SBS server is responding with an authentication error to this GET request.

After checking the packet traces of the SBS On Demand app on my Samsung S6 android phone, I noticed a different Basic authentication token so I decided to replace the authentication token assigned to 'auth_string' in resources/lib/config.py with the one from my android phone. After doing this the authentication succeeded and the requested program(s) are now able to be streamed in Kodi.

Perhaps the authentication token in config.py has expired or been disabled?

Did this occur in earlier versions? If my assumption as to the cause of the problem is correct, perhaps SBS have changed something recently in their On Demand service?

I am not familiar with the SBS On Demand API and its use of authentication so my fix may really only be a temporary one and the new token I have used will cease working at some point. It would be good to understand the root cause and then see if we can come up with a suitable solution. I would be happy to assist.

Regards

Paul

alexmustafa commented 8 years ago

Hi @prfemlchem, can you paste in the authentication you scraped from your android device?

I created an issue for this for the sbs on demand module here: https://github.com/xbmc-catchuptv-au/plugin.video.sbs/issues/1

prfemlchem commented 8 years ago

I presume you are actually asking for the BASIC authentication token? I guess it's OK to put it into the public domain although I do wonder whether the token can be tracked to me given I obtained the SBS On Demand app from the Google Play store. I guess Adam, the author of the plugin, obtained the token in a similar way to me, given the other parameters passed in the GET request mentioning android.

As I recall, there isn't a typical HTTP BASIC authentication sequence/exchange between the client app and the server. Instead, the client sends a GET request with a BASIC authentication header and associated BASE64 encoded credentials token to the server.

It would be interesting to know whether a new token is automatically created for every installation of the SBS On Demand app or whether it is constant for the version of the app.

I will get back to you.

Regards

Paul

prfemlchem commented 8 years ago

Hi @alexmustafa , thanks for putting in a link to this issue in your issue on the plugin.video.sbs issue page. I didn't look hard enough when searching for the issue page specific to this plugin.

Apologies to Andy, the author of the plugin, for getting his name wrong:-(

Regards

Paul

pfsysadmin commented 8 years ago

Hi @alexmustafa , I am logged into github using an alternate account in case you are wondering:-)

The BASIC authentication token I extracted from the SBS On Demand app on a Galaxy S6 is: YW5kcm9pZDNhNTkwNWRmMmNmODcxMjNjY2EwMWQ1OWUwNTRhZDZmYjdiY2E2N2U6YW5kcm9pZA==

Use this to replace the one assigned to auth_string in resources/lib/config.py. ie. auth_string = 'YW5kcm9pZDNhNTkwNWRmMmNmODcxMjNjY2EwMWQ1OWUwNTRhZDZmYjdiY2E2N2U6YW5kcm9pZA=='

Let me know if you require further information.

Regards

Paul

andybotting commented 8 years ago

Thanks @alexmustafa for your sleuthing. I've added your basic auth string in commit 84dc7cc8e4eabfc34f1837f0ac6dd88ff24f3cfc

I'm not sure exactly how this works, like whether they generate per user or some other mechanism, but more investigation is definitely needed.

I've just pushed v1.0.3 of the SBS add-on to the repository, so it should be downloaded automatically.

Thanks again.