Kodi Community Forum
Release Disney+ - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Video Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=154)
+---- Thread: Release Disney+ (/showthread.php?tid=353316)



RE: Disney+ - kk20 - 2021-07-21

thought it was best to just completely reformat - no backup or restore, a fresh install from scratch

libreelec 9.2 branch leia 18.9

https://paste.kodi.tv/izosahodiq.kodi

Only two addons and from non blacklisted repos (CastagnaIT/slyguy).  Netflix addon (works) and disney+ (doesnt work).

I get further than I did before, I can now "log in" and get the usual disney+ list selections (featured, hubs, movies, series etc) but if I click on a menu item (say featured) then I get the error "API request failed Server Error: Bad Request"

This is a completely fresh format no tweaking so far.  I have no issues logging into disney+ via chrome browser ( https://imgur.com/a/BPhHKvR ) as this is what I have been doing via HDMI

edit: I have two profiles, one named "profile" which has no age restrictions, one named "kids" which has the kids profile ticked.  The default has always been "profile"

other edit:  I decided to download KODI for windows on this very machine.  The only thing I did was install slyguy repo and disney+  I got the same error "API request failed Server Error: Bad Request".  I can alt tab out of the kodi and play disney+ in chrome browser...  Im stumped.  There is noone else using my account so im not at the "4 stream limit" (I opened the browser for disney+ AFTER the error)  Log from windows kodi https://paste.kodi.tv/xibisikaqe.kodi

last edit - I can actually "search" from the addon in both windows and libreelec.  It returns the videos from the search but trying to play one gives the same error message.  I have tried "log out of all devices", renaming the profile, deleting the kids profile, changing the language to "English US".  I had a look in "settings.xml" and the access_token is populated, it is very large 6878 characters according to notepad++


RE: Disney+ - matthuisman - 2021-07-21

hmm, something is wrong / changed with your tokens.
Tokens I get in the add-on and their website is around 4100 characters and works with https://jwt.io/
I get the same behaviour if I edit the token in the settings so it becomes invalid

it seems they aren't JWT tokens.
all I can think is Disney+ is trying new tokens on some users..

Is there anyway you can change your password to something random then PM your login details so I can see what is going on?
Its the only way I can think of that will allow me to observe the new tokens and find a fix.
Oh, and also advise which country your in - the "experiments" may be based on that too

If that is not possible, then please enable Debug logging in kodi settings.
Then logout, then login and select profile (if possible), and then send me the log of the login so I can see the api endpoints it uses


RE: Disney+ - carpedroidiem - 2021-07-22

For what it's worth I have the exact same error and I'm in the USA. Just started happening after the update from 0.7.0. Hopefully you get it figured out!


RE: Disney+ - matthuisman - 2021-07-22

the add-on update was coincidence.
You can install 0.6.9 from here to confirm: https://k.slyguy.xyz/.repo/slyguy.disney.plus/slyguy.disney.plus-0.6.9.zip

It seems they are switching some users over to a new token system.
I'm working on ESPN+ currently and they use encrypted tokens - so I suspect thats what is happening with Disney+.

I can't do anything until my NZ login switches or I get a login to test with which has the issue

UPDATE:
I may have fixed it. Please update to latest Disney+ v0.7.3 and test.
I noticed with ESPN+ JWE tokens - you don't prefix the authentication header with "Bearer".
So, updated Disney+ to not prefix auth header if it detects a JWE token (has .. in it, where JWT is single .)

Pretty sure JWE token is what is happening.
I noticed my refresh tokens with Disney+ are now JWE.
So makes sense that the auth tokens will also switch

Oh, JWT / JWS = non-encrypted
and JWE = encrypted
more info: https://medium.facilelogin.com/jwt-jws-and-jwe-for-not-so-dummies-b63310d201a3


RE: Disney+ - kk20 - 2021-07-22

(2021-07-22, 03:19)matthuisman Wrote: the add-on update was coincidence.
You can install 0.6.9 from here to confirm: https://k.slyguy.xyz/.repo/slyguy.disney.plus/slyguy.disney.plus-0.6.9.zip

It seems they are switching some users over to a new token system.
I'm working on ESPN+ currently and they use encrypted tokens - so I suspect thats what is happening with Disney+.

I can't do anything until my NZ login switches or I get a login to test with which has the issue

UPDATE:
I may have fixed it. Please update to latest Disney+ v0.7.3 and test.
I noticed with ESPN+ JWE tokens - you don't prefix the authentication header with "Bearer".
So, updated Disney+ to not prefix auth header if it detects a JWE token (has .. in it, where JWT is single .)

Pretty sure JWE token is what is happening.
I noticed my refresh tokens with Disney+ are now JWE.
So makes sense that the auth tokens will also switch

Oh, JWT / JWS = non-encrypted
and JWE = encrypted
more info: https://medium.facilelogin.com/jwt-jws-and-jwe-for-not-so-dummies-b63310d201a3

0.7.4 same error (bad API).  I did poke around a little and found b64_string = token.split('.')[1] looking at my token it did have .. so assumed I had something different with the access_token.  

Looking at your link you sent, my access_token looks screwed up (in settings.xml).  I appear to have two access_tokens glued together with "","expires":1626955227,"refresh_token":"" in the middle of them.  Neither access token looks correct, I only have 4 elements and appear to be missing the JWE Encrypted Key.  The JOSE header first portion does decode but the ALG element is "dir" and enc "C20P" which makes no sense to me.


RE: Disney+ - matthuisman - 2021-07-22

yes, its encrypted. 
Still old tokens with NZ based login

when I look at my JWT token data, there is this data in it
Code:
    "experiments": {
      "wpnx-Disney-JWE-account-access-tokens": {
        "variant_id": "control",
        "version": 1
      },
As you can see, JWE account access tokens is an "experiment" they must be running on some logins.
Obviously my login doesn't have it... 
Who knows if or when it will

It should be a simple fix once I can test what it is doing.
I suspect they will just send a different header if its using JWE


RE: Disney+ - kk20 - 2021-07-22

(2021-07-22, 10:56)matthuisman Wrote: yes, its encrypted. 
Still old tokens with NZ based login

when I look at my JWT token data, there is this data in it
Code:
    "experiments": {
      "wpnx-Disney-JWE-account-access-tokens": {
        "variant_id": "control",
        "version": 1
      },
As you can see, JWE account access tokens is an "experiment" they must be running on some logins.
Obviously my login doesn't have it... 
Who knows if or when it will

It should be a simple fix once I can test what it is doing.
I suspect they will just send a different header if its using JWE
 "experiments": {
      "wpnx-Ornella_Test_2": {
        "variant_id": "variant1",
        "version": 1
      },
      "wpnx-Disney-JWE-device-access-tokens": {
        "variant_id": "control",
        "version": 1
      }

yep, there you go.  Im experimenting with manually getting a token from desktop python.  Learning JWT rapidly....  I can get the bearer.  I can get to authorization with the endpoint https://global.edge.bamgrid.com/idp/login  but cannot get a token to stick {'errors': [{'code': 'access-token.invalid', 'description': 'auth.missing'}]}

I assume I am sending the wrong header to the login (or have a wrong payload).  I'll keep playing with it.


RE: Disney+ - kk20 - 2021-07-22

(2021-07-22, 14:39)kk20 Wrote:
(2021-07-22, 10:56)matthuisman Wrote: yes, its encrypted. 
Still old tokens with NZ based login

when I look at my JWT token data, there is this data in it
Code:
    "experiments": {
      "wpnx-Disney-JWE-account-access-tokens": {
        "variant_id": "control",
        "version": 1
      },
As you can see, JWE account access tokens is an "experiment" they must be running on some logins.
Obviously my login doesn't have it... 
Who knows if or when it will

It should be a simple fix once I can test what it is doing.
I suspect they will just send a different header if its using JWE
 "experiments": {
      "wpnx-Ornella_Test_2": {
        "variant_id": "variant1",
        "version": 1
      },
      "wpnx-Disney-JWE-device-access-tokens": {
        "variant_id": "control",
        "version": 1
      }

yep, there you go.  Im experimenting with manually getting a token from desktop python.  Learning JWT rapidly....  I can get the bearer.  I can get to authorization with the endpoint https://global.edge.bamgrid.com/idp/login  but cannot get a token to stick {'errors': [{'code': 'access-token.invalid', 'description': 'auth.missing'}]}

I assume I am sending the wrong header to the login (or have a wrong payload).  I'll keep playing with it.
OK, I can now log in using my test harness, I will try and get this translated into the addon.

{'token_type': 'Bearer', 'id_token': '<SUPER SECRET TOKEN THAT HAS EXPIRED NOW ANYWAY>', 'expires_in': 900}

Im having a play about and the only difference is that im not using your class but calling requests.post manually.  I have to include a headers=<your header class> in each call (mindful of the 900s expiry as I dont have a refresh function).   Im getting {'status': 400, 'message': 'Bad Request'} for my manual information calls such as collection_by_slug for 'home','home' (no more bad auth messages at least)


Work calls so I cannot spend more time today.


RE: Disney+ - matthuisman - 2021-07-22

We already know how to get the token..

What you need to do is use chrome devtools to see how their website is sending the new version of the token to their servers.

Again, it all should be relatively simple once I can test


RE: Disney+ - kk20 - 2021-07-22

fair enough,  im out then as im clearly in above my head, ive had a poke about the network headers around the timeframe of login, change of section.  I found the relevent headers (for say a call to Request URL:
https://content.global.edge.bamgrid.com/svc/content/DmcSeriesBundle/version/3.3/region/GB/audience/false/maturity/1450/language/en-GB/encodedSeriesId/3RUQKboZV3FF ), I have also poked around some request payloads and looked at various JWT requests but im conceding as this is not my area of coding expertise. 

Thanks for all the help everyone, appreciated for the time.


RE: Disney+ - KillerSkunk - 2021-07-23

I've been using disney + add-on for a long while without any troubles at all, and was pretty satisfied and happy with it's working.
But since yesterday suddenly it stopped working.
I checked the log and it says the next:
2021-07-23 09:05:53.476 T:8672   ERROR: Control 50 in window 10025 has been asked to focus, but it can't
2021-07-23 09:05:53.904 T:396   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.ImportError'>
                                            Error Contents: cannot import name gui
                                            Traceback (most recent call last):
                                              File "C:\Users\XBMC\AppData\Roaming\Kodi\addons\slyguy.disney.plus\default.py", line 3, in <module>
                                                from resources.lib.plugin import plugin
                                              File "C:\Users\XBMC\AppData\Roaming\Kodi\addons\slyguy.disney.plus\resources\lib\plugin.py", line 8, in <module>
                                                from slyguy import plugin, gui, userdata, signals, inputstream, settings
                                              File "C:\Users\XBMC\AppData\Roaming\Kodi\addons\script.module.slyguy\resources\modules\slyguy\plugin.py", line 14, in <module>
                                                from . import router, gui, settings, userdata, inputstream, signals, migrate, bookmarks
                                              File "C:\Users\XBMC\AppData\Roaming\Kodi\addons\script.module.slyguy\resources\modules\slyguy\gui.py", line 10, in <module>
                                                from slyguy.dns import get_dns_rewrites
                                              File "C:\Users\XBMC\AppData\Roaming\Kodi\addons\script.module.slyguy\resources\modules\slyguy\dns.py", line 7, in <module>
                                                from .mem_cache import cached
                                              File "C:\Users\XBMC\AppData\Roaming\Kodi\addons\script.module.slyguy\resources\modules\slyguy\mem_cache.py", line 11, in <module>
                                                from . import signals, gui, router
                                            ImportError: cannot import name gui
                                            -->End of Python script error report<--
2021-07-23 09:05:53.945 T:5796   ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://slyguy.disney.plus/
2021-07-23 09:05:53.948 T:8672   ERROR: CGUIMediaWindow::GetDirectory(plugin://slyguy.disney.plus/) failed

it doesn't tell me anything i understand sadly enough


RE: Disney+ - matthuisman - 2021-07-23

Fixed yesterday.
You need to force an update by following the below:
https://www.matthuisman.nz/2019/09/how-to-force-kodi-to-update-add-ons.html

And in future, please post links to a log instead of the log in the comment


RE: Disney+ - KillerSkunk - 2021-07-23

(2021-07-23, 09:13)matthuisman Wrote: Fixed yesterday.
You need to force an update by following the below:
https://www.matthuisman.nz/2019/09/how-to-force-kodi-to-update-add-ons.html

And in future, please post links to a log instead of the log in the comment
Ah didn't knew, i shall, and thank you for the quick response


RE: Disney+ - KillerSkunk - 2021-07-23

(2021-07-23, 09:24)KillerSkunk Wrote:
(2021-07-23, 09:13)matthuisman Wrote: Fixed yesterday.
You need to force an update by following the below:
https://www.matthuisman.nz/2019/09/how-to-force-kodi-to-update-add-ons.html

And in future, please post links to a log instead of the log in the comment
Ah didn't knew, i shall, and thank you for the quick response

The force method didn't do anything as i was already at 0.7.4, but when i downloaded the latest.zip manually from the repo adres and updated my addon directory with it it all started working again. Thanx Smile Smile


RE: Disney+ - matthuisman - 2021-07-23

You didn't follow the link I posted ...
You were doing the update wrong.
You don't do it via the addon. You do it via the repo. All explained in the link

Don't worry, your not the 1st who hasn't followed it Smile I'm going to add a button somewhere to do it