Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video playback dont works on Windows, MacOS, Android limited to SD #1627

Open
CastagnaIT opened this issue Sep 20, 2023 · 10 comments
Open

Video playback dont works on Windows, MacOS, Android limited to SD #1627

CastagnaIT opened this issue Sep 20, 2023 · 10 comments
Labels
Help needed We need the help of other volunteer developers Triage: Confirmed Issue has been reproduced by the add-on maintainers

Comments

@CastagnaIT
Copy link
Owner

CastagnaIT commented Sep 20, 2023

[ INFO THREAD ]

PLEASE KEEP THE THREAD CLEAN, COMMENT ONLY TO PROVIDE HELP FOR A POSSIBLE SOLUTION TO THE PROBLEM
IF YOU WANT TO DISCUSS OPENLY USE THIS THREAD: #1678
THANK YOU

From some month this add-on is not able to play videos on Windows and MacOS systems and Android.
This problem causes only the first 2 minutes of the video to be playable,
on Android its possible mitigate the problem by playing SD resolutions (~540p) only.

this is due to website changes that seem to have introduced some custom Widevine DRM implementation or maybe a new VMP protection, i dont know exactly.

Some details in to the investigations done can be read from this comment link
#1585 (comment)
and following the discussion on subsequent comments.

In short the problem is about the Widevine DRM license request and at moment from my part i have no idea how find a solution,
that is the reason why the videos can be played only for the first 2 minutes, because without license you cannot decrypt videos,
only unencrypted videos like trailers can be played.

One workaround that could be done in future, but only for Windows systems, is to use PlayReady DRM instead of Widevine DRM. But this require to be first implemented in to InputStreamAdaptive add-on, then in future try to implement this support to this add-on. It is not an easy thing and also will take a long time (more months not days).

If anything changes on the website in the meantime, the addon still allows you to try test to play the videos also if dont works.

UPDATE 16/04/2024:

According to the old discussion reachable from the comment 1585 above linked
i leave here my last vague remarks from my latest attempts to debug the website
in the hope that in the future someone will be able to help me or propose a complete solution
because with my knowledge alone i will never be able to deal with this problem

As said above the problem is in the license request
DRM license can be obtained in two ways:

  1. From licensedManifest request, this is already implemented, (see msl_handler.py _build_manifest_v2 method), so by including drmSessionId/challengeBase64 the manifest response will include the license, and this dont happens anymore due to not accepted challenge data
  2. "Manually" requesting the license, (see msl_handler.py get_license method), always required the drmSessionId/challengeBase64 and the response will have the license

both drmSessionId/challengeBase64 are obtained by DRM session initialization done by InputStream Adaptive,
now in the website seem happens more or less in the same way of the addon
but on the website when the drmSessionId/challengeBase64 are provided by DRM somewhat happens like a middle step between the browser DRM and the website where the DRM challenge data seem to be wrapped or modified by using some kind of "certificate"!? at least seem to contains some parts of this data

this "certificate" can be found in the cadmium-playcore.js of website, at today is this:

CAUSwwUKvQIIAxIQ5US6QAvBDzfTtjb4tU/7QxiH8c+TBSKOAjCCAQoCggEBAObzvlu2hZRsapAPx4Aa4GUZj4/GjxgXUtBH4THSkM40x63wQeyVxlEEo1D/T1FkVM/S+tiKbJiIGaT0Yb5LTAHcJEhODB40TXlwPfcxBjJLfOkF3jP6wIlqbb6OPVkDi6KMTZ3EYL6BEFGfD1ag/LDsPxG6EZIn3k4S3ODcej6YSzG4TnGD0szj5m6uj/2azPZsWAlSNBRUejmP6Tiota7g5u6AWZz0MsgCiEvnxRHmTRee+LO6U4dswzF3Odr2XBPD/hIAtp0RX8JlcGazBS0GABMMo2qNfCiSiGdyl2xZJq4fq99LoVfCLNChkn1N2NIYLrStQHa35pgObvhwi7ECAwEAAToQdGVzdC5uZXRmbGl4LmNvbRKAA4TTLzJbDZaKfozb9vDv5qpW5A/DNL9gbnJJi/AIZB3QOW2veGmKT3xaKNQ4NSvo/EyfVlhc4ujd4QPrFgYztGLNrxeyRF0J8XzGOPsvv9Mc9uLHKfiZQuy21KZYWF7HNedJ4qpAe6gqZ6uq7Se7f2JbelzENX8rsTpppKvkgPRIKLspFwv0EJQLPWD1zjew2PjoGEwJYlKbSbHVcUNygplaGmPkUCBThDh7p/5Lx5ff2d/oPpIlFvhqntmfOfumt4i+ZL3fFaObvkjpQFVAajqmfipY0KAtiUYYJAJSbm2DnrqP7+DmO9hmRMm9uJkXC2MxbmeNtJHAHdbgKsqjLHDiqwk1JplFMoC9KNMp2pUNdX9TkcrtJoEDqIn3zX9p+itdt3a9mVFc7/ZL4xpraYdQvOwP5LmXj9galK3s+eQJ7bkX6cCi+2X+iBmCMx4R0XJ3/1gxiM5LiStibCnfInub1nNgJDojxFA3jH/IuUcblEf/5Y0s1SzokBnR8V0KbA==

but i have no idea on how the DRM challenge and data above are "combined"
and this in my opinion is what is missing to solve all the playback problems in the various systems (probably also android)

@CastagnaIT
Copy link
Owner Author

CastagnaIT commented Apr 15, 2024

EDIT: updated first post

@CastagnaIT CastagnaIT changed the title Video playback dont works on Windows and MacOS Video playback dont works on Windows, MacOS, Android limited to SD Apr 16, 2024
@CastagnaIT CastagnaIT added Help needed We need the help of other volunteer developers Triage: Confirmed Issue has been reproduced by the add-on maintainers labels Apr 16, 2024
@matthuisman
Copy link

For HBO, wv server returns error if send license data including default kid from the higher quality l1 only streams. I have to proxy and remove the l1 kids and then send the request just with the lower quality kids. Not sure if that's the case here.

@CastagnaIT
Copy link
Owner Author

here license request is full customized,
there is only a single variable the DRM "challenge" (SSM), (and DRM sessionid but its irrilevant)

the challenge should be attached in the manifest request data, since the manifest can return directly also the license data to avoid a separate license request

even if license request is made separately, same thing there is no kid specified

@d1g33k
Copy link

d1g33k commented Jul 30, 2024

Just to add to the observations. I was until now using the Netflix Basic plan (720p) on my Chromecast with Google TV and the add-on worked perfectly. Just a couple of days back, I upgraded to the Standard (1080p) plan and started encountering the aforementioned issues. On the 1080p plan, I am able to watch at 576p resolution.

Seems in addition to the resolution associated with the account, the plan itself also has an impact on the playback issue.

@hampoelz
Copy link

hampoelz commented Jul 31, 2024

The readme states that playback, when it works, is limited to SD quality and only on some andoid/linux devices. Interestingly, this is not the case on my Raspberry Pi 4 running LibreELEC 11. I can still watch Full HD without any problems.

@tyshiro
Copy link

tyshiro commented Aug 4, 2024 via email

@Barri-G
Copy link

Barri-G commented Aug 19, 2024

First test made today (Kodi 21.1 + InputStream 21.5.2):
I have configured InputStream Adaptive (Expert) to:
Save stream manifests
Save license data

After that, I have played a Netflix video, getting just .init & .challenge files at cdm folder (C:\Users\MyUser\AppData\Roaming\Kodi\cdm)

Funny part is those files are created BEFORE selecting video quality (I have the option "Override stream selection type -> Ask video quality").

If I play Disney+ video and check the same folder I get .init, .challenge & .response, so the video plays correctly, but the big difference is those files are created AFTER selecting ratio (I cannot activate quality selector as it is only for Slyguy supporters, but I can imagine is the same behaviour as ratio).

*Disney+ repo (for inspiration): https://github.com/matthuisman/slyguy.addons/tree/master/slyguy.disney.plus

Second test made today:
Kodi 21.1: I have tried to use Slyguy InputStream Helper (Wrapper), designed to replace original Helper, and the result was the same as the original Helper (Only first 2 min. of video).
Kodi 19.5: When playing a Netflix video, original Helper throws "nf_is_ads_stream" error, but Slyguy Wrapper have the same beaviour as in 21.1, so no errors are shown.

Regarding .response files, they are not created for Netflix in any case.

@Falke-Design
Copy link
Contributor

Falke-Design commented Aug 21, 2024

Last week I tried if anything has changed and then I was able to watch multiple streams of "Rick & Morty Season 7". It hasn't stopped after 2 minutes. Today I tried it again and it didn't worked anymore. The 2 minutes issues was there again... Saddly I don't have any logs from last time

Starting Kodi (21.1 (21.1.0) Git:20240817-d00181569e). Platform: Android ARM 32-bit
Using Release Kodi x32
Running on Sony BRAVIA 4K VH22 with Android TV 10.0.0 API level 29, kernel: Linux ARM 32-bit version 4.19.7

@d1g33k
Copy link

d1g33k commented Aug 24, 2024

Just to add to the observations. I was until now using the Netflix Basic plan (720p) on my Chromecast with Google TV and the add-on worked perfectly. Just a couple of days back, I upgraded to the Standard (1080p) plan and started encountering the aforementioned issues. On the 1080p plan, I am able to watch at 576p resolution.

Seems in addition to the resolution associated with the account, the plan itself also has an impact on the playback issue.

Since I subscribe to Netflix through my operator, I downgraded to the 720p Basic plan from the 1080p Standard one and the plugin works perfectly again. It doesn't stop after 2 minutes, I can resume playback from any location and use video speed plugin with Kodi 21. So, for me at least, the solution is to use the Basic plan.

@Barri-G
Copy link

Barri-G commented Aug 24, 2024

I have spend some hours today investigating the challenge generation.

This part of the cadmium.js seems to generate an array called data:

c.prototype.b4b = function(v, w) {
    return this.yF(w, v.type, v.context).then(function(x) {
        return x.e4b(v.initData, v.Bfa).then(function(y) {
            return [x, {
                uu: x.Ww(),
                data: y.Fl
            }];
        });
    });
}

And data is later turned into challengeBase64 here:

q = p.zc.encode(q.data[0]);
p.log.trace("Challenge generated", q);

Current addon challengeBase64 length (including xid): 2317
JS challengeBase64 length: 5752

So, I think the key is to understand how y is generated.

I have also observe a difference on drmVersion parameter:

drmVersion: "playready" === M ? 30 : 0,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help needed We need the help of other volunteer developers Triage: Confirmed Issue has been reproduced by the add-on maintainers
Projects
None yet
Development

No branches or pull requests

8 participants
@CastagnaIT @matthuisman @Falke-Design @Barri-G @hampoelz @d1g33k @tyshiro and others