trakt-tools / universal-trakt-scrobbler

MIT License
559 stars 54 forks source link

Netflix sync is broken again #394

Closed AcidSlide closed 1 month ago

AcidSlide commented 2 months ago

Expected Behavior

Netflix sync to Trakt Watched items

Current Behavior

Unable to sync with Netflix, but instead showing "Not Logged In" message. This is somewhat related/similar to the previous issue #384 and #385

image

It seems Netflix has changed the watch history link again, and basing on the changes, the fix is not just a change in the ACTIVATE_URL variable but also need to track the profile ID (hashed)

r3dicalnusz commented 2 months ago

Would love to see the fix being pushed to the addon stores asap. Really fed up with switching between manual und automatic installs every couple months.

AcidSlide commented 2 months ago

Would love to see the fix being pushed to the addon stores asap. Really fed up with switching between manual und automatic installs every couple months.

There is no fix yet to the latest changes by Netflix for the watch history

r3dicalnusz commented 2 months ago

Would love to see the fix being pushed to the addon stores asap. Really fed up with switching between manual und automatic installs every couple months.

There is no fix yet to the latest changes by Netflix for the watch history

I know.

odin-h commented 2 months ago

This regex pattern is the reason it doesn't work. https://github.com/trakt-tools/universal-trakt-scrobbler/blob/68f410d5f22d0e0515e0e3bda80b463bbc174a8f/src/services/netflix/NetflixApi.ts#L454 Netflix changed the structure of that specific object, so the new pattern needs to be: /"userInfo":\{"data":\{"name":"(?<profileName>.*?)"/

As a quick fix, just replace all occurrences of /"userInfo":\{"name":"(.*?)"/ with /"userInfo":\{"data":\{"name":"(.*?)"/ on all files in the extension folder using Visual Studio Code, and then reload the extension.

leandroalves99 commented 2 months ago

To those who don't want to use VS Code, there's a workaround using the Chrome Dev Tools with the regex shared by @odin-h. To do so, just do the following:

  1. Open the extension in the History page and open Dev Tools (Right Click -> Inspect).
  2. In Dev Tools, go to Sources and select history.js
  3. Search for /"userInfo":\{"name":"(.*?)"/ and put a breakpoint in that line
  4. Reload the extension and click on Netflix (The dev tool will pop up)
  5. Advance 1 time (Step over next function call option) and paste this in the console: s = /"userInfo":\{"data":\{"name":"(?<profileName>.*?)"/
  6. Resume script execution (play button) in the debug and the history will show up.

    Let's hope for a quick fix by the devs!

ZaViper commented 2 months ago

To those who don't want to use VS Code, there's a workaround using the Chrome Dev Tools with the regex shared by @odin-h. To do so, just do the following:

1. Open the extension in the History page and open Dev Tools (Right Click -> Inspect).

2. In Dev Tools, go to Sources and select history.js

3. Search for `/"userInfo":\{"name":"(.*?)"/` and put a breakpoint in that line

4. Reload the extension and click on Netflix (The dev tool will pop up)

5. Advance 1 time (Step over next function call option) and paste this in the console: `s = /"userInfo":\{"data":\{"name":"(?<profileName>.*?)"/`

6. Resume script execution (play button) in the debug and the history will show up.

Let's hope for a quick fix by the devs!

I wanted to dumb this down further for others who aren't familiar with Chrome Dev Tools. As someone who isn't I spent about 40 minutes trying to figure out steps 3-5 as it wasn't clear to me.

  1. Is pretty simple and straight forward.
  2. For sources: when you open "Inspect" a new side window will pop up. If this window is small enough you'll see a button at the top of this newly created window that looks like ">>". You'll want to click on ">>" and select "Sources". If this window is large enough you should just see "Sources" at the top of this new window and you just need to select it. You should anyway stretch the size of this window out to make things easier. When you select "Sources" you'll find "history.js" in the top left column.
  3. When you open "history.js" click anywhere on the top right column where it looks like there is a butch of code then press CTRL+F to bring up the search function. In the "Find" text area search for what leandroalves99 said. To put a breakpoint into that line you'll need to click on the "-" to the left of the code that is in the same line as what you searched for. You should now see what looks like an orange bookmark covering that "-".
  4. To reload the extension just hit the refresh button for the entire page or press F5.
  5. After clicking on Netflix on top of the webpage a yellow popup that says "Paused in debugger" will show. To "Advance 1 time" click on the the arrow "->" that looks like its jumping over a "." After click on the arrow look at the "Inspect" window and at the top where you selected "Sources" in step two, you'll want to click on "Console" which is right next to "Sources". In this window just paste what leandroalves99 said, hit enter.
  6. Press the "play button" on that yellow popup at the top of the webpage.

Hope this further details help those who know nothing about Dev Tools.

cooldude2200 commented 2 months ago

To those who don't want to use VS Code, there's a workaround using the Chrome Dev Tools with the regex shared by @odin-h. To do so, just do the following:

Thank you so much for dumbing it down for us less technically adept, that worked perfectly.

Hope the devs resolve this.

AcidSlide commented 1 month ago

Any updates on this? It's been 2 weeks already