Skip to content

Website parsing error: unable to extract reactContext.#3

Merged
atrHusK merged 1 commit into
atrHusK:masterfrom
biocoder-frodo:master
Jun 21, 2026
Merged

Website parsing error: unable to extract reactContext.#3
atrHusK merged 1 commit into
atrHusK:masterfrom
biocoder-frodo:master

Conversation

@atrHusK

@atrHusK atrHusK commented Jun 21, 2026

Copy link
Copy Markdown
Owner

As per: CastagnaIT#1727

Fixes regex capture problem that prevents the JSON data from loading correctly.

Check if this PR fulfills these requirements:

Types of changes

  • New feature (non-breaking change which adds functionality)
  • Feature change (non-breaking change which changes behaviour of an existing functionality)
  • Improvement (non-breaking change which improves functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactor (non-breaking performance or readability improvements)

Description

After getting a correct login for my daughter's Standard plan Netflix subscription using the NFAuthentication flle,
Kodi would greet me with the WebsiteParsingError: Unable to extract reactContext message.
This error was already reported before here:
CastagnaIT#1726
CastagnaIT#1711
CastagnaIT#1706

I already spotted those issues because getting the NFAuthentication key login to work took a little time.
https://github.com/CastagnaIT/plugin.video.netflix/wiki/Login-with-Authentication-key
NFAuthentication.key generation with Firefox

I got the login working after making sure Kodi was using the plugin.video.netflix-1.23.3+matrix.1 version, by going into the Addon options and selecting this version.
After realizing the login worked, I started preparing for some debugging on my LibreElec machine.
I made some changes in the plugin code to log the contents of the response from the Netflix server and see why the code failed.
The website returned/returns JSON data for the reactContext blob followed by </script><script>window.netflix = window.netflix || {};</script>
The plugin script expects to find netflix.reactContext and netflix.falcorCache JSON array assignments inside <script> tags and those tags were causing the problem. The original regex would select including the last </script> on a line returned by the server and this would mean the JSON deserialization would fail because of the trailing script tags.

We have tested the change by watching several episodes in HD without issue and also checked that the two stream limit for the Standard plan was properly checked. The error message that was designed to handle this, showed up.

In case of Feature change / Breaking change:

Describe the current behavior

N/A

Describe the new behavior

N/A

Screenshots (if appropriate):

N/A

Fixes regex capture that prevents the JSON data from loading correctly. The website returned/returns JSON data followed by  </script>script>window.netflix = window.netflix || {};</script>
@atrHusK atrHusK merged commit d7cc397 into atrHusK:master Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants