Coder Social home page Coder Social logo

traktflix's Introduction


Traktflix
traktflix

A Trakt.tv scrobbler for Netflix.

github release travis Coverage Status

Get the extension on Chrome

Get the extension on Firefox

Table of Contents

What is Trakt?

Automatically scrobble TV show episodes and movies you are watching to Trakt.tv! Keep a history of everything you've watched! Sign up for a free account at Trakt.tv and get a ton of features.

Why do I need this extension?

Trakt.tv has a lot of plugins to automatically scrobble the movies and episodes you watch from your media center. But there are none for Netflix. This extension allows you to scrobble from Netflix to Trakt.tv. Cool, isn't it?

How does traktflix work?

Unfortunately Netflix doesn't provide a public API, so the movie or episode info is extracted from the HTML of the player.

Limitations

This extension only works with Netflix HTML player and new layout. If you are in the old layout, please open the new one. See this link for more info: https://help.netflix.com/en/node/23742

Problems

If you find any problems or have suggestions or questions, feel free to open an issue

Multi-Account Containers / Temporary Containers (Firefox)

If you are using Multi-Account Containers on Firefox, make sure to enable the cookies permission in the options, otherwise the extension will not work properly. If you are using Temporary Containers in automatic mode, it might duplicate tabs when trying to login.

Development

Create an application in Trakt API.

Don't forget to check /scrobble permission.

In Redirect uri: put https://www.netflix.com/Activate

In Javascript (cors) origins: put https://www.netflix.com, moz-extension:// and chrome-extension://

Copy the config.json example file and change Trakt.tv credentials:

cp config.dev.json config.json

Use nvm to run in the correct version of node

nvm use

Install the dependencies

npm install

To run in development mode

npm start

To get build version for development mode (unlike npm start this does not watch the files for changes)

npm run build-dev

To get build version for production mode (generates app.zip, ready for deployment)

npm run build
npm run zip

To run tests

npm test

The commands above have only been tested on Linux.

Credits

This product uses the TMDb API but is not endorsed or certified by TMDb.
This product uses the Trakt.tv API.

gsrafael01 Ported this extension to Firefox and also added a lot of improvements. He is the most active maintainer now.

LICENSE

traktflix's People

Contributors

dependabot[bot] avatar edvorg avatar juaoose avatar mrmamen avatar rafaelgomesxyz avatar some-guy-23 avatar tegon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

traktflix's Issues

No 'Access-Control-Allow-Origin' header is present on the requested resource.

Was trying to log into Trakt.tv through the extension and was not ever able to click the button to do so. I brought up the developer console and the following error message was displayed:

Failed to load https://api.trakt.tv/scrobble/start: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'chrome-extension://bmoemkaigjgcgjjnpmdgkifndiidkeji' is therefore not allowed access. The response had HTTP status code 401.

History sync not saving

Went into history from Netflix - clicked 100 item toggles (made the toggle red) and then hit sync - Popup with x items synced shows up. Closed tab I refreshed Netflix, reopened trakt history - not saved (toggles grey on same episodes).

I attempted a second time about the same amount of items hit sync, closed and reopened not saved.

Finally tried one item thinking the issue might be I'm trying to sync to many things, hit sync - none of my items are red anymore all grey. I closed and reopened history in trakt a few times to refresh. Still all grey toggles.

Apologies if I'm doing something wrong.

Thanks for the hard work.

Viewing Activity Parser - error with some titles

Just installed this extension, and on running the sync the first time the progress spinner kept going until I clicked on something else. I dug into it, and narrowed down the issue to this line in the parser -

https://github.com/tegon/traktflix/blob/master/app/scripts/src/content/viewing-activity-parser.js#L25

It was getting to the episode title, with a NULL splittedTitle[1], which caused trim() to blow up.

I pulled open my results for the API call to viewing activity to see what could be causing this. The problem is caused specifically by a case where the series title doesn't have the season in title, but does have a number. For example for the TV show Ascension -

""Chapter One, Part 1""

Here the script splits on ":", which does not exist. So, the entire title is included in splittedTitle[0]. At this point, it parses the "1" as the season. Then, it caries on to get splittedTitle[1], which does not exist. Hopefully this info helps!

Netflix history sync freezing/taking forever...

Hi there,

I installed the plugin, logged into Netfliex, and completed the integration with Trakt. i then click on History sync, and it showed the header, but just keep spinning away for minutes without any error or data...

What can I do to troubleshoot/resolve this?

Thank you.

Chris

Position of the Sync Now button

Because I like to keep my syncing up to date, it is a little annoying that I have to scroll all the way to the bottom of the page to click on the Sync Now button.
Would it be possible to move it, or duplicate it to the top of the page?

(love the extension, and I actually use it in Opera also, with the help of the "Download Chrome Extension")

Feature Request: Mine Viewing Activity

It's fairly easy for a user to access their Viewing Activity, which includes comprehensive information regarding which shows/movies/episodes have been watched, and the date on which they were watched. The data on the page is structured very well, and using something like Kimono or a homespun extractor would collect that data perfectly. From there, adding those shows to Trakt would be fairly easy. It could even be extended to ratings as well.

traktflix not listing trakt.tv play dates after sync

Hi,

I just synced a lot of shows with my trakt.tv account using the history sync for some reason it displayed 0 movies and 0 shows synced at the end, however when i go to my trakt.tv account / website i do see the plays were registered so i don't want to sync them again since i had this problem in the past when doing the sync a second time the plays get duplicated on the trakt.tv site.

Now the problem is whenever i use the history sync the traktflix plugin is not listing the play dates from from trakt.tv even though the play dates are there.

So it seems to me there are 2 problems:

  1. it sometimes seems to sync history but displays it did not sync anything even though the plays are being registered in the trakt
  2. if the above happens history sync want's to sync them again because for some reason even though they did get registered in point 1 but traktflix said it did not sync anything it is not listing the play dates so it can't compare the data.

are there any log files being generated if so where so i can have a look at them or supply them ?

Incorrect scrobble time

It looks like some episodes were scrobbled with incorrect timestamp.
I watched it recently in January '16 but the scrobble date on trakt.tv appears to be August 1st, 2016.
Is it a change in trakt.tv API? How can this be fixed somehow?

"Select all" button for history

When viewing history, it would be nice a "check all" button on top to select all episodes and sync them.
The sync could have a status bar instead of a infinite loading status icons.

Thanks! =)

Manual history sync - next page

Is there any chance you will be modifying the app to pull all of the netflix history at once? I try to go page by page but at most it seems to get about 5x pages into my history and then lags out.

I have several years worth of history that I would like to sync if possible.

[Suggestion] The ability to add movie to Trakt.tv watchlist

Would it be possible to add a button on the Netflix page, or by clicking the extension, to add the movie to your Trakt.tv watchlist? Otherwise, if it cant find a match, open a new tab to manually search for it.

I have bookmark folders with 100s of Netflix movies I want to watch and would love an easy way to instead directly add to a Trakt.tv watchlist for easy organizing.

Only sync history from active netflix profile

I share a netflix account with my family, and each person has a separate netflix profile on the same account. I go to my profile, but when I try to sync the history, the history for all profiles goes into trakt.tv.

Would it be possible to have only the current netflix profile's history be synced, so that i don't have to remove all the stuff that other profiles watch?

Not syncing history

When I've opened my Netflix history sync tab (of the extension), I see some episodes not synced, e.g:
screenshot from 2016-04-08 20-50-20

It would be logical if I pressed the red switch and it's being synced, but it doesn't seems to? Is there any way to sync the missing episodes through this screen? And does that switch do something? (instead of let you see if it's synced or not)

Thanks!

Error accesing "Netflix history sync"

When I click on the "history" link in the traktflix dropdown header the new tab opens the header appears and an animated loading icon appears, and stays there forever.

When I check the console I found this error:

Failed to load resource: the server responded with a status of 404 (Not Found)

For the following URL:

https://www.netflix.com/api/shakti/XXXXXXXX/viewingactivity?authURL=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=&pg=0

(I replaced the X for the actual values).

Authorization with Netflix failing

History sync is failing to load any episode details for me, and I suspect there might be an issue with extracting the authorization details. For example, the GET to:

https://www.netflix.com/api/shakti/[redacted]/viewingactivity?authURL=[redacted]&pg=0

is returning a 401 Unauthorized response (which is empty). I suspect that this may be because the authURL contains literal \x2B, \x2F and \x3D sequences instead of +, /, and =.

It looks like maybe there should be some interpretation of these escape sequences in https://github.com/tegon/traktflix/blob/master/app/scripts/src/history-sync/utils/netflix-web-api-utils.js#L17 and possibly other locations.

Is it perhaps possible to grab the entire JSON blob that's being "read" by the regexps here, and interpret it as actual JSON? Failing that, what about returning JSON.parse('"' + resultOfRegexpMatch + '"')?

Sync errors; also multiple plays?

Notice a couple issues. Note that I'm canceling my Netflix account so this really isn't a big deal for me - feel free to close it. I'm reporting it as an fyi. I'll also drop a link to this into the VIP forum thread at https://trakt.tv/forums/general/topics/trigger-a-resync-with-netflix?page=1.

  1. The first one, when I log in and try to access Netflix:
    image

I'm pretty sure I successfully logged in initially...

  1. I noticed that some things that I all the way through show multiple plays - often 3. Wondering if it might be due to stopping and starting, but all episodes in an entire series sometimes have 3. Is or was this a known issue? If I leave and pick up something later, is a new play recorded? Because I'd rather not record a play for every click... perhaps a note could be put on the readme about this type of issue.

History: Remember sync settings

When I check/uncheck episodes for syncing history with trakt, the plugin should remember those decisions. E.g. there are movies I only watched a couple of minutes before deciding that they're not my cup of tea, still Netflix considers them "watched".

Each time I open the history sync, those movies are marked for syncing again, even if I manually disabled syncing for them the last time.

TraktFlix missing items in history due to title mismatch between Trakt and Netflix

So it looks as though the titles in Netflix have to match perfectly to Trakt in order for it to be shown in TraktFlix?

I noticed a couple of things missing:

Last Man Standing S03E15 - Netflix title: "Taser," Trakt title: "Tasers"
Last Man Standing S03E21 - Netflix title: "April Come She Will," Trakt title: "April, Come She Will"

I'm guessing this is due to the fact that the Netflix history doesn't have episode numbers? It would be helpful though to show approximate matches using a fuzzy search with some adjustable threshold. Or at the very least be able to manually enter Trakt IDs to unmatched items in TraktFlix in order to sync the datetime stamp of the viewing.

Great work by the way!!! Really love this plugin. The work on the history sync has been great!

Some questions ...or issues?

Hello! I've tried using your plugin, it's great that finally we have something like that, so I'm very greatful. But for some reason my checkin doesn't seem to work? Is it scrobbles only at the end of the episode as a "watched"? Could it be possible to make it check in as I start watching the episode or it should already do that just bugging for me? It's not quite clear from the documentation for me.

Unable to load history

I am unable to load my viewing history in traktflix. The history sync feature has been working fine up until a few days ago. Now, the history sync page fails to load any watched items.

To reproduce:
1 Log into traktflix
2 Click the 'History' tab in the chrome widget
3 Observe the history sync page - loading indicator moves continuously and the page fails to load

The console is filled multiple instances of the following error data for different watched items:

OPTIONS https://api.trakt.tv/sync/history/episodes/40970 504 ()
r._send @ history-sync.js:1
(anonymous) @ history-sync.js:1
safeCallbackApply @ VM412 extensions::sendRequest:21
handleResponse @ VM412 extensions::sendRequest:74
history-sync.html:1 XMLHttpRequest cannot load https://api.trakt.tv/sync/history/episodes/40970. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'chrome-extension://bmoemkaigjgcgjjnpmdgkifndiidkeji' is therefore not allowed access. The response had HTTP status code 504.

I have tried reinstalling the extension and clearing web data/cache, but the problem persists.

Some episodes don't have a season causing the JS to bomb out

I have just got this addon and am getting an error as Line 26 of "viewing-activity-parser.js" expects 3 elements in the array but some shows only have one season and don't return a season at all so the array only has one two elements the show's name and episodes name (see screenshot below).

In the example below you can see the Series Delete doesn't have a season (or is only got one and they call it "Delete" after the Show's name). I have also got this issue with the show Ascension. I'm sure there are others.

This causes the whole "SYNC NOW" button to bomb out and it is left on the spinning progress icon and Trakt.tv never seems to get any titles. :(

Chrome Error

More verbose history syncing

As seen in other bug reports, the history syncing has some issues from time to time, depending on various factors. It would be much easier to correct/clean up invalid data if the complete list of synced (or rejected) data was listed. Even better if the user might check which plays to accept, and which to reject in advance.

A few reasons why this would be useful:

  • #15 Data are doubled
  • #13 Incorrect date format in localized areas
  • Netflix adds everything you start playing to the history. (even if you just watch 10 seconds.)
  • The user may already have checked in or marked episodes as played but not necessary the same time as Netflix recorded it.

Not detecting anything

It says to login to trakt, I then click to log in, it loads for a bit and then nothing happens?

Traktflix history and netflix history

Hello,

both history aren't the same. I watch 2 episodes of Better call saul yesterday, they are in my netflix history, but not in traktflix history. I've tried to refresh, I've the last version 1.0.6.3

Doesn't identify the episodes

Seems like it only recognizes some episodes not all. For example it only identify the "Ching Chong Chang" but not the other.

image

Probably because its german? I can't do much on the netflix settings page since my subscription run out.

Dates incorrect with Netflix Viewing Activity sync

Dates are specified in local format, i.e. Australian accounts show with DD/MM/YYYY instead of MM/DD/YYYY, but the parser uses JS Date constructor to parse the date. This results in invalid dates like 2/01/2016 being interpreted as the 1st of February (in the future).

screenshots

screen shot 2016-01-02 at 2 47 13 pm
screen shot 2016-01-02 at 2 47 48 pm

A potentially better solution would be to hit the JSON API directly at https://www.netflix.com/api/shakti/7ffaa772/viewingactivity?pg=0&authURL=, where it includes the date as number of milliseconds since unix epoch (also meaning the time of the play is available) rather than having everything show as midnight.

Use thetvdb as fallback for series

themoviedb is great because it supports series and have images in higher resolution, but thetvdb seems to have a much larger database. I suggest using it as a fallback, or perhaps even as the first choice since there is no use for a high resolution image anyway.

History sync not working

Hi,

I just downloaded your extension and tried to sync my Netflix history, however, it doesn't seem to be working. When I launch history sync, the developer console log is full of these 504 errors:

screenshot 2017-03-16 15 17 58

Doesn't mark as viewed

After successfully scrobbling an episode/movie to trakt.tv for the full length of the video, the episode/movie doesn't get marked as "viewed". I have to manually mark the episoded I watched.

Issue when manually adding item from trakt

In history sync, there seems to be a problem when entering a manually trakt-URL. The button is defaulted to off (or at least seems to be), but clicking the switch triggers an animation for "close". After one more click the button is on, as expected.

Feature request: Chromecast support

Chromecasts only work partially at the moment. When starting an episode with the normal player and then switching to Chromecast mode, it continues scrobbling (the icon is red). However, when switching episodes (while still in Chromecast mode) it behaves like you stop the episode.

History Sync not working

Trying to use the netflix history sync feature to get my netflix history into trakt, but it's just throwing errors and doing nothing... for this screenshot i only select 1 movie which had been automatically detected so i turned on 1 movie and clicked sync

http://i.imgur.com/MeaGeIn.png

Error 401 on GET https://api-v2launch.trakt.tv/users/me

Nothing is happening when I try to login to trakt.tv apart from the little red circle going around. Console gives the error message mentioned in the title.
Not sure if it's related to the plugin, my browser, or trakt ?
Any pointers welcome...

using Chrome Canary build 50.0.2642.0 (Official Build) canary (64-bit)
traktflix 1.0.5.5

thanks

Window to sign in via google too tall on first run

After installing I was logging into trakt with my google account, I went into the circles to uncheck to not allow the extension to see my circles. The window is too tall and it doesn't seem like you can scale the window. Is this a problem with the extension or google chrome?

windows 10, 1920x1080 with 150% scaling.

[Rollbar]: TypeError: Cannot read property 'call' of undefined

Every time I build use uglify (building for production), the script is obfuscated and doesn't work with rollbar. (I've experienced no other problems.)

The stacktrace is:
content.js:2 [Rollbar]: TypeError: Cannot read property 'call' of undefined
at a.t (content.js:1)
at a.configure (content.js:1)
at Object.c.init (content.js:1)
at Object.n.traktflix\app\scripts\src\rollbar.js../settings (content.js:1)
at o (content.js:1)
at content.js:1
at Object.n.traktflix\app\scripts\src\content\content-controller.js.../chrome-storage.js (content.js:1)
at o (content.js:1)
at content.js:1
at Object.n.traktflix\app\scripts\src\content\content.js.../rollbar.js (content.js:1)

Not sure if it is related, but I've noticed that much of the packages are outdated and very old. Even the node version is ancient.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.