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

Website parsing error: unable to extract reactContext. #1727

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

biocoder-frodo
Copy link

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:
#1726
#1711
#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>
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.

1 participant