CastagnaIT / plugin.video.netflix

InputStream based Netflix plugin for Kodi
MIT License
1.9k stars 258 forks source link

RPI4: No HD playback anymore (ARM devices) #1281

Closed the-dreamer closed 2 years ago

the-dreamer commented 2 years ago

Bug report

Your Environment

Used Operating system:

Describe the bug

As written in title. RPI4 has no HD Playback anymore. Few Days before it was working. It is stuck in 940x. Netflix/Germany Premium Subscription i have tried VP9/x254 codec. no change.

Expected behavior

Full HD playback

Actual behavior

SD Playback only where shows had Full HD before and on x86 still Full HD playback is possible. Sample Shows: Titans, Gypsy, Clickbait...

Steps to reproduce the behavior

1. 2. 3.

Possible fix

Debug log

The debug log can be found here:

http://ix.io/3It4

Additional context or screenshots (if appropriate)

Other information

Screenshots

github-actions[bot] commented 2 years ago

Thank you for your interest in this add-on development, this is an automatically generated message by our Bot

It seems that you have not full followed the template we provide and require for all bug reports.

Attach the debug log is mandatory for a bug report, the log rules are explained in the Issue creation page or in the ReadMe.

Please edit your Issue message to follow our template. The issue will be closed after about one week has passed without satisfactory follow-up from your side.

If you believe it was sent in error, please say so and a team member will remove the "Ignored rules" label.

CastagnaIT commented 2 years ago

I have seen, unfurnately in these days netflix has done changes on website and the problem of the SD limit on all ARM devices seems returned

not sure what is wrong this time (and if it is our problem?) they may have retouched other things we don't know about.

A first thing to check is to check is if you can get 1080P in some way through the RPI chromium browser (by using website) @wagnerch can you try to see?

wagnerch commented 2 years ago

@CastagnaIT Yeah, 1080p is working on Chromium on Raspberry Pi OS Bullseye. Tested with Biohackers S02E04, however The Unforgivable and Small Crimes would only do 720p. But this might be more about bandwidth/CPU/network/OS [bullseye has a few performance problems w/ new display pipeline & chromium], as I have gone back and tried to replay and was only able to get 720p and in some cases 540p. Attached screenshot.

On CE, The Unforgivable is 540p.

2021-12-15-094121_3440x1440_scrot

wagnerch commented 2 years ago

@CastagnaIT I did try changing the UA to match what is in the screenshot, it made no difference.

wagnerch commented 2 years ago

I was testing a bit more and it's hit or miss even on the same videos for me, 540p. There is an AWS outage affecting multiple sites, not sure if that factors in at all with Netflix and their CDN hosting.

ohhmyy commented 2 years ago

Hi. I have 2 ARM devices here, same account and same network. One (odroid n2 - matrix) is only playing in 540p, the other (rpi4 - leia) is still playing in 1080p.

rpi4 -> 1080p: LibreELEC 9.2.7 (Kodi 18.9) inputstream.adaptive v2.4.8.1 plugin.video.netflix v1.12.7

odroid n2 -> 540p: CoreELEC 19.3 (Kodi 19.3) inputstream.adaptive v19.0.1.1 plugin.video.netflix v1.18.2+matrix.1

jdsmall25 commented 2 years ago

Hello, just wanted to confirm I have 2 rpi4 devices that I've recently upgraded to LibreELEC 10.0.1 and now both are no longer able to play above 540p content. I can add (but may not be related) that I'm struggling to get a few different addons to get above 540p which are Netflix, Amazon VOD, and HBO Max. Slyguys' Disney+ and Hulu still seem to be working if that's helpful at all.

LibreELEC 10.0.1 (Kodi 19.3) inputstream.adaptive v19.0.1.1 plugin.video.netflix v1.18.2+matrix.1 plugin.video.amazon-test v0.9.4+matrix.1 slyguy.hbo.max v0.7.8 slyguy.disney.plus v0.10.6 slyguy.hulu v0.2.1

wagnerch commented 2 years ago

@CastagnaIT

It looks to me they consolidated the licensedManifest request with license request, and license is eliminated. Therefore xid is pulled up to the licensedManifest. They also changed it from a PRE_FETCH to STANDARD. I'll send you the logs, you can take a look, you will probably have a better clue than me. :)

The licensedManifest response has under the video_tracks a "license" section which has: licenseResponseBase64 links.releaseLicense

Which I think replaces the response from the existing license call?

CastagnaIT commented 2 years ago

@wagnerch thanks! i need to check better, from your log only one manifest has been set with the flavor: STANDARD then seem not always used at least for now

Which I think replaces the response from the existing license call?

yes it should works but from your log i have seen also that the xid seems no longer constant between different calls (license manifest, events)

the changes to do to the license code for now is backward compatible, i tried set flavor: STANDARD but still in SD from the message above of @ohhmyy that affirm that 1080p works with the old manifest request (kodi 18), this make me suspect that maybe we should wait for some other website changes, boh...

EDIT: just tried with proxy, in my country your last website change is not applied yet so the license call is always as before, better wait a bit of time

wagnerch commented 2 years ago

@CastagnaIT Yeah, I tried to hack together some changes and the license callback from ISA failed which makes me suspect that additional changes are needed in ISA to not dispose the decrypter session between pre-init & license. I believe the current implementation creates a new drm session id?

Basically I captured the licenses_xid, licenses_session_id, licenses_release_url, inserted xid into the sesison table as done in get_license. And added another variable to capture licenseResponseBase64, and then proceeded to strip everything from get_license and just return the b64decoded value of licenseResponseBase64, and ISA failed for no license keys.

I agree with you, it looks like Netflix is doing a multi-stage/multi-region roll-out, clearly changes from last week were the initial changes, then they probably rolled out a newer cadmium player, and I bet at some point they are going to drop some of the legacy license calls.

Uploaded what I tried so far here, not that it's of much use as it just fails. Other thing to note, the manifest was still only 540p, so there is a bit more to it that isn't clear, perhaps I missed something on the manifest request.

CastagnaIT commented 2 years ago

Yeah, I tried to hack together some changes and the license callback from ISA failed which makes me suspect that additional changes are needed in ISA to not dispose the decrypter session between pre-init & license. I believe the current implementation creates a new drm session id?

right the drm session is created just before making the manifest request in order to provide the challenge/sid, then will be closed. After that ISA create another session for the playback. some time has passed right now I can't remember why I implemented it this way, maybe because there was some implementation difficuties in keeping the session opened between the operations... ISA code currently is not so elastic

then there are two problems: 1) manifest request still have SD only (unknown reason for now) in the past was due to the missing challenge/sid, but now this data are provided. You could trying to provide the same profiles as the website? to see if anything changes 2) with the new adaptions, if we pass the license response provided in the manifest to ISA license callback, ISA fails with AddOnLog: inputstream.adaptive: License update not successful (no keys) perhaps it is possible to solve this by reusing the same session, just a theory, it will be necessary to study ISA code again to try make a test

nice potato boils...

jon10220 commented 2 years ago

Hi

If HD runs on kodi Leia 18.9 Is there any chance of HD in kodi Matrix on Raspberry pi? Maybe rollback to older ISA version & older Netflix addon Does it have a chance to work?

fumantsu commented 2 years ago

Older versions of the addon as they are, will not work. I tried but I'm getting this error message which was fixed in this version.

On Thu, Dec 23, 2021 at 10:04 AM jon10220 @.***> wrote:

Hi

If HD runs on kodi Leia 18.9 Is there any chance of HD in kodi Matrix on Raspberry pi? Maybe rollback to older ISA version & older Netflix addon Does it have a chance to work?

— Reply to this email directly, view it on GitHub https://github.com/CastagnaIT/plugin.video.netflix/issues/1281#issuecomment-1000149166, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWRA676J2S2HH2MDRY7G63USLQYRANCNFSM5KDDRN7A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Thank you Alexandros

wagnerch commented 2 years ago

@CastagnaIT Is servicetokens something new in the MSL request header data?

CastagnaIT commented 2 years ago

@CastagnaIT Is servicetokens something new in the MSL request header data?

no are not new, until now have been optional

wagnerch commented 2 years ago

@CastagnaIT Is servicetokens something new in the MSL request header data?

no are not new, until now have been optional

I took another look yesterday, and updated the profiles to match:

And nothing changed. So either I missed something, it's in the MSL layer (which servicetokens is the only thing I noticed that wasn't implemented), or it's a combination of some earlier HTTP call.

Edit: Or perhaps they check if the DRM session is closed?

cube79 commented 2 years ago

Hi,

I have the sam problem on Odroid N2 with Coreelec. Yesterday I've installed Kodi with your addon on my laptop (Win10) and it is working in FullHD. If there is any data (logs )I could provide let me know.

BR. Jakub

Sholander commented 2 years ago

On Odroid N2, with CoreElec 9.2.8/Kodi Leia with the latest Netflix addon version 1.12.8, HD 1080p works OK. One should not enable H265-HDR-DV options in settings, only H264 to get 1080p...

cube79 commented 2 years ago

On Odroid N2, with CoreElec 9.2.8/Kodi Leia with the latest Netflix addon version 1.12.8, HD 1080p works OK. One should not enable H265-HDR-DV options in settings, only H264 to get 1080p...

Maybe it works on Leia, but not on Matrix, at least I cannot find the option regarding the h265 codec

CastagnaIT commented 2 years ago

And nothing changed. So either I missed something, it's in the MSL layer (which servicetokens is the only thing I noticed that wasn't implemented), or it's a combination of some earlier HTTP call.

Edit: Or perhaps they check if the DRM session is closed?

@wagnerch implement servicetokens could be not easy, experiments to test it could be tried but later, I think we should first solve the problem of the error in the ISA license request. The manifest request is the first call, as the licence request is not made now, IMO they cannot verify if session is changed. can you check in the Chromium if there are some suspects new parameters/arguments that we do not have in the http manifest call? also can you write here the exact user agent string that Chromium use for the http requests?

@cube79 the thread is for ARM linux only, netflix makes a distinctions between each type of operating system. Leia works in HD because still use the deprecated MSL request, when this MSL request will be no longer usable, there is a risk that the addon will be dead (on Leia)... on Matrix we use the new MSL request, but has been changed and requires new changes on addon and most likely on InputStreamAdaptive addon

you might think about to reimplement the old MSL request, with a expert settings to be enabled manually, this in theory if there are no particular problems to make coexistent in clean way the two methods I will think about it, as i do not know how long it will take to find the final solution

h265 codec can works only on android, if forced enabled on other systems will only cause playback problems

CastagnaIT commented 2 years ago

@wagnerch as temporany solution i have re-add the old manifest as option setting, so we have more time to solve the problem This is the test build: plugin.video.netflix_1.18.2+matrix.1_20211229_t1.zip

How to enable the old Manifest to get HD with a linux ARM device: 1) Open addon Expert settings 2) Set Version 1 to MSL manifest version setting 3) Let me know if there are side effects

cube79 commented 2 years ago

@CastagnaIT I have OdroidN2 and CoreELEC, so it is an ARM linux as far as I know.

I have downloaded the zip and tested it - it works in FullHD again. Thank you.

betatester3016 commented 2 years ago

Confirming plugin.video.netflix_1.18.2+matrix.1_20211229_t1.zip combined with the instructions above provide 1920x1080p under CoreELEC 19.3 Matrix.

Test environment: S905X2 & S905X3 with CoreELEC 19.3 and Widevine 4.10.2252.5 (FIEVEL) / ISA 19.0.1.1

screenshot00005

jon10220 commented 2 years ago

For me also Full HD 1080p is back and it works!

Raspberry pi 4b, Xbian, kodi 19.3

wagnerch commented 2 years ago

as temporany solution i have re-add the old manifest as option setting, so we have more time to solve the problem

This is working.

The manifest request is the first call, as the licence request is not made now, IMO they cannot verify if session is changed. can you check in the Chromium if there are some suspects new parameters/arguments that we do not have in the http manifest call? also can you write here the exact user agent string that Chromium use for the http requests?

Yeah, honestly it's all over the place. I ran another proxy log and what's interesting is in some cases it will do a prefetch/licensedManifest, and in other cases it is just a licensedManifest. The difference between the two is licensedManifest has an xid, which almost suggests the intent is to implement it as a license replacement. But what's weird is if you look through cadmium player the client can conditionally call prefetch/manifest, prefetch/licesensedManifest, and licensedManifest. And in the testing I was doing this morning it called prefetch/licsensedManifest and license. Also one thing I noticed is some of the prefetch/licensedManifest include challenge and some do not and challenge is different than challenges/default/challengeBase64. So I don't know if licensedManifest has an additional challenge now and perhaps that is an issue. One thing to note is prefetch/licensedManifest and licensedManifest are different in that:

  1. prefetch uses flavor: 'PRE_FETCH', licensedManifest uses flavor: 'STANDARD'
  2. prefetch includes challenge (conditionally -- not sure why, never saw it in licensedManifest)
  3. prefetch uses licenseType: 'limited', licensedManifest uses licenseType: 'standard'
  4. licensedManifest includes xid, prefetch does not.

I didn't notice any additional arguments to the router for the manifest. Right now it seems like the call flow is:

I tried to mimic this prefetch/licensedManifest and still nothing for HD content. I can send over proxy.log and EMELogFile.txt if you want to take a look.

wagnerch commented 2 years ago

@CastagnaIT Here is the headers sent (excluding cookie) for the prefetch/licensedManifest call the browser was doing:

2021-12-28 20:51:11.618 INFO    :    content-length: 15212
2021-12-28 20:51:11.618 INFO    :    sec-ch-ua: "Chromium";v="95", ";Not A Brand";v="99"
2021-12-28 20:51:11.618 INFO    :    sec-ch-ua-mobile: ?0
2021-12-28 20:51:11.618 INFO    :    user-agent: Mozilla/5.0 (X11; CrOS aarch64 13597.84.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.78 Safari/537.36
2021-12-28 20:51:11.618 INFO    :    sec-ch-ua-platform: "Linux"
2021-12-28 20:51:11.618 INFO    :    content-type: text/plain
2021-12-28 20:51:11.619 INFO    :    accept: */*
2021-12-28 20:51:11.619 INFO    :    origin: https://www.netflix.com
2021-12-28 20:51:11.619 INFO    :    sec-fetch-site: same-origin
2021-12-28 20:51:11.619 INFO    :    sec-fetch-mode: cors
2021-12-28 20:51:11.619 INFO    :    sec-fetch-dest: empty
2021-12-28 20:51:11.619 INFO    :    referer: https://www.netflix.com/watch/80189685?trackId=259445521&tctx=5%2C1%2C0b2422db-f873-4582-adc1-3eb9c7e8421f-67986866%2C67f1a27f-2256-4c34-800f-ebf354ad0e97_44295756X101XX1640742640546%2C67f1a27f-2256-4c34-800f-ebf354ad0e97_ROOT%2C%2C%2C
2021-12-28 20:51:11.619 INFO    :    accept-encoding: gzip, deflate, br
2021-12-28 20:51:11.619 INFO    :    accept-language: en-US,en;q=0.9
CastagnaIT commented 2 years ago

@wagnerch well detailed thanks

But what's weird is if you look through cadmium player the client can conditionally call prefetch/manifest, prefetch/licesensedManifest, and licensedManifest.

I saw something similar in the website player but wasn't sure (not test with proxy yet), it is possible that the choice of type of manifest used is determined by the type of content played, example "trailer" (unprotected) VS "movie" (DRM protected) you should check the type of videoid in the manifest request

I can send over proxy.log and EMELogFile.txt if you want to take a look.

yes if you can send to my email so i understand better your flow, i will try to examine the situation in the next days .... oh yes over the new year :)

wagnerch commented 2 years ago

@CastagnaIT yeah, best I can tell it used prefetch/licensedManifest for The Witcher S01E01 (80189599) then did a license call, that was navigating through the website. I have seen it do licensedManifest if you do direct URL /watch/80189599.

I assume that portion of code is probably reusable for the two different requests.

wanlill commented 2 years ago

Sorry to jump in, not sure whether it’s well known here but it seems the nonexistence of the “cad” service token controls whether a manifest request contains the challenge field in the vanilla cadmium js code, and the “cad” service token is most likely set by the first msl request after user signs in. (I came across this thread when I was investigating a 4k streaming issue for my M1 MAC mini with Netflix website, this repo helped me understand the obfuscated cadmium code a lot, thanks!)

notoco commented 2 years ago

Coreelec 9.3 nightly, s922x fullhd works again with this versio

jdsmall25 commented 2 years ago

Confirming the test build works for Libreelec 10.0.1. Getting FullHD on both my rpi4s.

vteccorp commented 2 years ago

@CastagnaIT 1080p again works perfect on latest build... on Beelink GT King @ CoreELEC 19.4 :thumbsup: (SOC is Amlogic S922x with ARM Cortex-A73/A53) At the moment I don't find any disturbing side effects

Thanks for Your work... You're most reliable dev that i know! :grin:

Thunderbird2086 commented 2 years ago

I have Confirmed that 1080p is now working again for my Vero 4K+. Thanks for your hard work, @CastagnaIT!

dmu7004 commented 2 years ago

Works for me too : Rpi 4 - Librelec 10.0.1 - Kodi 19.3 But i had to put the option manifest to 1, don't know if it's important :)

Thanks for this great job ... :+1:

hevet commented 2 years ago

I also have 1080p on RPi4 with Libreelec 10.0.1, but some movies are still 540p, eg Doctor Doolittle.

vascobraga41 commented 2 years ago

I also have 1080p on RPi4 with Libreelec 10.0.1, but some movies are still 540p, eg Doctor Doolittle.

Not all of the content is displayed in HD with the addon, namely some of the content that's not from Netflix and particularly movies. It's been like this since the beginning.

betatester3016 commented 2 years ago

The magic happens here folks:

image

hevet commented 2 years ago

Okay, I didn't know, but it's always worth finding out. @betatester3016 I have that set.

betatester3016 commented 2 years ago

I also have 1080p on RPi4 with Libreelec 10.0.1, but some movies are still 540p, eg Doctor Doolittle.

For several months, some users have reported a restriction in the quality of streaming in 540p, especially on Netflix. An issue due to the Widevine license lowering on their device. A problem that Google still has not fixed.

CastagnaIT commented 2 years ago

@wagnerch i have do the changes to ISAdaptive, and the license error is gone now is possible check better for 1080P problem

if you want test you need: ISA PR: https://github.com/xbmc/inputstream.adaptive/pull/873 NEFLX PR: https://github.com/CastagnaIT/plugin.video.netflix/pull/1295

Here there are some jenkins artifacts of ISA PR for Kodi 20: https://jenkins.kodi.tv/blue/organizations/jenkins/xbmc%2Finputstream.adaptive/detail/PR-873/1/artifacts Compiled for CoreElec ARMv8 - Kodi 20: isa-linux-armv8-Nexus.zip

for all other devices/os and/or Kodi 19 you needed to compile/backport it manually

wagnerch commented 2 years ago

@CastagnaIT It does indeed get past the manifest, but it looks like the cherry-pick of the ISA PR to Matrix has an issue. The issue is it will download the first few segments, and then just stalls with the "busy" spinning indicator on screen. It's odd because it acts like it is starting the video, switch the refresh rate, screen goes black, then it drops back into the GUI with the "busy" spinning indicator like it's buffering.

I assume the backport is a bit more involved than just a cherry-pick, haven't had a chance to look into it.

CastagnaIT commented 2 years ago

You have right initially i did not played a video for a long time so i always stopped at the first minute now i have tested again and i have a similar problem the only difference to me is that the video starts and is played correclty until to about 2 minuts after that the image freeze with a lot of Decrypt failed as you can see: https://paste.kodi.tv/pimanosula.kodi https://paste.kodi.tv/sevuvagizi.kodi on both Kodi same error seems some other changes to ISA are required around the decrypter

demod-au commented 2 years ago

Just a quick update to this issue. Running on an ARM device, I had the issue with no hd playback, and fixed it by setting the MLSVersion to Version 1 as per above. Yesterday I started getting "MSLError: This title is not available to watch instantly".
Switched MLSVersion back to default and all is working again.

b4zyl commented 2 years ago

Is there temp version to enable old MSL manifest for Kodi 18.7? plugin.video.netflix_1.18.2+matrix.1_20211229_t1.zip gives me an error like : python dependency 3.0.0 cannot be meet

wagnerch commented 2 years ago

@b4zul My understanding is Kodi 18 uses the "old MSL manifest" (as you have called it), which is now broken. The new MSL manifest (in the Kodi 19 and later add-on) requires changes in ISA which are not available in Kodi 18. So you would have to uprgade, as far as I know.

@CastagnaIT As others have noted, it seems Netflix reverted whatever they were playing with, as the "default" manifest option in Kodi 19 + 20 is working again with HD and the "v1" option is broken (title not available). 🤷‍♂️

b4zyl commented 2 years ago

@b4zul My understanding is Kodi 18 uses the "old MSL manifest" (as you have called it), which is now broken. The new MSL manifest (in the Kodi 19 and later add-on) requires changes in ISA which are not available in Kodi 18. So you would have to uprgade, as far as I know.

Indeed, i get MSL error whenerver i try play anything in Netflix plugin. However, i use Raspberry Pi OS where latest Kodi in their repo is 18.7. Sure, i can try compile Kodi 19 by myself and maybe get it working but what about my older Xiaomi Android projector where latest supported Kodi is 18.5 and due to some hardware limitation i cannot use anything above it? I believe i am not the only one in this situtation.

HATT0R1HANZ0 commented 2 years ago

I'm in the same situation like b4zyl. I've coreelec running with kodi leia and can't upgrade to matrix because of the hardware. A solution for kodi leia would be really great. Cheers

wagnerch commented 2 years ago

Indeed, i get MSL error whenerver i try play anything in Netflix plugin. However, i use Raspberry Pi OS where latest Kodi in their repo is 18.7. Sure, i can try compile Kodi 19 by myself and maybe get it working but what about my older Xiaomi Android projector where latest supported Kodi is 18.5 and due to some hardware limitation i cannot use anything above it? I believe i am not the only one in this situtation.

Upgrade to Bullseye, 19.3 is available there. For unsupported hardware, not sure what else you can do other than a) buy new hardware, or b) find someone who will backport the ISA & Netflix changes and see if the maintainers will push another release.

At some point the maintainers will move forwards and drop support for older versions, most of these guys do it in their free time with no funding.

b4zyl commented 2 years ago

Upgrade to Bullseye, 19.3 is available there.

Thx, will do tomorrow. But still, i need workarround for my older hardware not supported by new version of Kodi.

wagnerch commented 2 years ago

But still, i need workarround for my older hardware not supported by new version of Kodi.

I updated my comment above, But I would suggest opening a new issue, attach the debug logs, and see if the maintainer is willing to do the backports. This issue & cause is specific to Kodi 19.