tegon / traktflix

Trakt.tv + Netflix = :heart:
https://tegon.github.io/traktflix
MIT License
403 stars 45 forks source link

Traktflix reports "invalid URL" when manually pasting URL from Trakt #148

Open brycied00d opened 4 years ago

brycied00d commented 4 years ago

Chrome 84.0.4147.38 Traktflix 2.1.1

Netflix URL: https://www.netflix.com/watch/81209539 Trakt URL: https://trakt.tv/movies/patton-oswalt-i-love-everything-2020

image

Traktflix fails to find a match so I provide the URL to Trakt manually and click "Update Item". The response is the error "An error happened, please make sure you are entering a valid URL and try again"

Chrome's inspector panel shows Traktflix making 2 requests after I click "Update item":

This seems to make sense, it's listed as a "movie" on Trakt so a 404 from Trakt's "/shows" endpoint is logical.

Based on the API Netflix's "viewingactivity" API response viewedItems:

{"title":"Special: \"Patton Oswalt: I Love Everything\"","videoTitle":"Patton Oswalt: I Love Everything","movieID":81209539,"country":"US","bookmark":3925,"duration":4002,"date":1593830508487,"deviceType":1731,"dateStr":"7/3/20","index":2,"topNodeId":"81206879","series":81206879,"seriesTitle":"Patton Oswalt: I Love Everything","seasonDescriptor":"Special","episodeTitle":"Patton Oswalt: I Love Everything","estRating":"18"}

And src/class/NetflixApiUtils.js' https://github.com/tegon/traktflix/blob/772b7639e74c3c313c2d5dc03dc185ddef3ceafc/src/class/NetflixApiUtils.js#L142 we understand why Traktflix interpreted this as a "show" from Netflix's API response (because the "movie" has a "series" element).

The discrepancy between Netflix and Trakt is not the issue I'm raising, however. The issue I'm raising is that a URL that I, the the user, have painstakingly and meticulously gone to the effort to procure (okay so it was a simple Trakt search), and verify that it's the correct Trakt URL, is "invalid". I believe that Traktflix should "assume" that the user's manual override is correct and valid, at least so long as Trakt returns a valid API response with JSON object.

Please let me know how else I can assist troubleshooting and resolving this.