jansmolders86 / mediacenterjs

A HTML/CSS/Javascript (NodeJS) based Media center
http://mediacenterjs.com
1.29k stars 243 forks source link

Invalid Authentication #116

Closed LiamKarlMitchell closed 10 years ago

LiamKarlMitchell commented 10 years ago

I keep getting this over and over when I goto loop up data for movies.

E:\Documents\GitHub\mediacenterjs\node_modules\moviedb\lib\moviedb.js:41
    else throw new Error('Invalid authentication');
               ^
Error: Invalid authentication
    at E:\Documents\GitHub\mediacenterjs\node_modules\moviedb\lib\moviedb.js:41:16
    at Request.callback (E:\Documents\GitHub\mediacenterjs\node_modules\moviedb\node_modules\superag
ent\lib\node\index.js:730:3)
    at Request.<anonymous> (E:\Documents\GitHub\mediacenterjs\node_modules\moviedb\node_modules\supe
ragent\lib\node\index.js:135:10)
    at Request.EventEmitter.emit (events.js:95:17)
    at IncomingMessage.<anonymous> (E:\Documents\GitHub\mediacenterjs\node_modules\moviedb\node_modu
les\superagent\lib\node\index.js:886:12)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:919:16
    at process._tickCallback (node.js:419:13)

Metadata fetching for movie complete...
Loading movie data... true
Child process exited for:  movie
Metadata fetcher error:  { [Error: Command failed:
E:\Documents\GitHub\mediacenterjs\node_modules\moviedb\lib\moviedb.js:41
    else throw new Error('Invalid authentication');
               ^
Error: Invalid authentication
    at E:\Documents\GitHub\mediacenterjs\node_modules\moviedb\lib\moviedb.js:41:16
    at Request.callback (E:\Documents\GitHub\mediacenterjs\node_modules\moviedb\node_modules\superag
ent\lib\node\index.js:730:3)
    at Request.<anonymous> (E:\Documents\GitHub\mediacenterjs\node_modules\moviedb\node_modules\supe
ragent\lib\node\index.js:135:10)
    at Request.EventEmitter.emit (events.js:95:17)
    at IncomingMessage.<anonymous> (E:\Documents\GitHub\mediacenterjs\node_modules\moviedb\node_modu
les\superagent\lib\node\index.js:886:12)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:919:16
    at process._tickCallback (node.js:419:13)
] killed: false, code: 8, signal: null }
Getting data...
Fetching movie data...
Meta gathering started: Movies
jansmolders86 commented 10 years ago

Thank for letting me know. There's a little bug in the code making the movie scraper go in a loop. The API from the moviedb only allows a certain amount of requests. So naturally, the buffer filled up pretty quick. I'm almost done rewriting the movie scraper all together to overcome this issue.

Ill leave this issue open untill it is fixed! Thanks again!

LiamKarlMitchell commented 10 years ago

Oh yip is there a certain amount per minute or something?.

It could probably scrape data from IMDB as well?

jansmolders86 commented 10 years ago

Yeah, based on there API documentation it's:

http://docs.themoviedb.apiary.io/ Request Rate Limiting We do enforce a small amount of rate limiting. Please be aware that should you exceed these limits, you will receive a 503 error.

30 requests every 10 seconds per IP Maximum 20 simultaneous connections per IP

So I use a wrapper to try to "work" with that limitation but sometimes, especially when it is looping, things break. I fixed the loop bug by the way, if you pull a latest version, the scraper should work as intended. Also, sadly IMDB does not have a (free) API. That is why I use the best next thing, which is ThemovieDB http://www.themoviedb.org/ . (Which is essentially IMDB but with a great feature rich API).

I'm thinking about adding the option to let you choose your scraper (like XBMC does) but I'm hesitant due to some tests I've done. The accuracy of themoviedb is as of yet unbeatable :)

Please check if the looping is gone so this issue can be closed! Thanks again for your enthusiasm and time!

Jan

LiamKarlMitchell commented 10 years ago

Ah thanks very informative, I will check it out right away :).

I am curious if we can buy a better license for themoviedb to get better access for this software :).

I will be interested in seeing your work around for these limits, maybe you could have the limits configurable in an advanced section of the config area? Incase they were to change in the future it would be a matter of tweaking it.

I need to implement something similar for email in my own server. When using gmail it freaks out if i send more than 50? emails too fast.

On Tue, Jun 17, 2014 at 6:19 PM, Jan Smolders notifications@github.com wrote:

Yeah, based on there API documentation it's:

Request Rate Limiting We do enforce a small amount of rate limiting. Please be aware that should you exceed these limits, you will receive a 503 error.

30 requests every 10 seconds per IP Maximum 20 simultaneous connections per IP

So I use a wrapper to try to "work" with that limitation but sometimes, especially when it is looping, things break. I fixed the loop bug by the way, if you pull a latest version, the scraper should work as intended. Also, sadly IMDB does not have a (free) API. That is why I use the best next thing, which is ThemovieDB http://www.themoviedb.org/ . (Which is essentially IMDB but with a great feature rich API).

I'm thinking about adding the option to let you choose your scraper (like XBMC does) but I'm hesitant due to some tests I've done. The accuracy of themoviedb is as of yet unbeatable :)

Please check if the looping is gone so this issue can be closed! Thanks again for your enthusiasm and time!

Jan

— Reply to this email directly or view it on GitHub https://github.com/jansmolders86/mediacenterjs/issues/116#issuecomment-46271198 .

LiamKarlMitchell commented 10 years ago

Just updated and reloaded data, went to movies screen and this happens. The page locks up too becoming unresponsive :(.


   1. TypeError: Cannot read property 'removeListener' of undefined at
   remote (http://10.1.1.10:3000/movies/js/remote.js:43:7
   <http://10.1.1.10:3000/movies/js/remote.js>) at
   http://10.1.1.10:3000/movies/js/app.js:76:39
   <http://10.1.1.10:3000/movies/js/app.js> at z (
   http://10.1.1.10:3000/core/js/plugins/angular/angular.min.js:91:280
   <http://10.1.1.10:3000/core/js/plugins/angular/angular.min.js>) at
   http://10.1.1.10:3000/core/js/plugins/angular/angular.min.js:92:417
   <http://10.1.1.10:3000/core/js/plugins/angular/angular.min.js> at
   g.$eval (
   http://10.1.1.10:3000/core/js/plugins/angular/angular.min.js:100:328
   <http://10.1.1.10:3000/core/js/plugins/angular/angular.min.js>) at
   g.$digest (
   http://10.1.1.10:3000/core/js/plugins/angular/angular.min.js:98:210
   <http://10.1.1.10:3000/core/js/plugins/angular/angular.min.js>) at
   g.$apply (
   http://10.1.1.10:3000/core/js/plugins/angular/angular.min.js:101:157
   <http://10.1.1.10:3000/core/js/plugins/angular/angular.min.js>) at g (
   http://10.1.1.10:3000/core/js/plugins/angular/angular.min.js:67:175
   <http://10.1.1.10:3000/core/js/plugins/angular/angular.min.js>) at Q (
   http://10.1.1.10:3000/core/js/plugins/angular/angular.min.js:71:64
   <http://10.1.1.10:3000/core/js/plugins/angular/angular.min.js>) at
   XMLHttpRequest.t.onreadystatechange (
   http://10.1.1.10:3000/core/js/plugins/angular/angular.min.js:72:27
   <http://10.1.1.10:3000/core/js/plugins/angular/angular.min.js>)
   angular.js:9101

   1. GET http://image.tmdb.org/t/p/w342null 400 (Bad Request)
   jquery-1.8.2.min.js:2
   2. ````
   3. So thats odd.

   Might try to debug it more later but for now I must sleep :).

   Cheers,

On Tue, Jun 17, 2014 at 7:03 PM, Liam Mitchell <liamkarlmitchell@gmail.com>
wrote:

> Ah thanks very informative, I will check it out right away :).
>
> I am curious if we can buy a better license for themoviedb to get better
> access for this software :).
>
> I will be interested in seeing your work around for these limits, maybe
> you could have the limits configurable in an advanced section of the config
> area? Incase they were to change in the future it would be a matter of
> tweaking it.
>
> I need to implement something similar for email in my own server. When
> using gmail it freaks out if i send more than 50? emails too fast.
>
>
> On Tue, Jun 17, 2014 at 6:19 PM, Jan Smolders <notifications@github.com>
> wrote:
>
>> Yeah, based on there API documentation it's:
>>
>> Request Rate Limiting
>> We do enforce a small amount of rate limiting.
>> Please be aware that should you exceed these limits, you will receive a
>> 503 error.
>>
>> 30 requests every 10 seconds per IP
>> Maximum 20 simultaneous connections per IP
>>
>> So I use a wrapper to try to "work" with that limitation but sometimes,
>> especially when it is looping, things break. I fixed the loop bug by the
>> way, if you pull a latest version, the scraper should work as intended.
>> Also, sadly IMDB does not have a (free) API. That is why I use the best
>> next thing, which is ThemovieDB http://www.themoviedb.org/ . (Which is
>> essentially IMDB but with a great feature rich API).
>>
>> I'm thinking about adding the option to let you choose your scraper (like
>> XBMC does) but I'm hesitant due to some tests I've done. The accuracy of
>> themoviedb is as of yet unbeatable :)
>>
>> Please check if the looping is gone so this issue can be closed!
>> Thanks again for your enthusiasm and time!
>>
>> Jan
>>
>> —
>> Reply to this email directly or view it on GitHub
>> <https://github.com/jansmolders86/mediacenterjs/issues/116#issuecomment-46271198>
>> .
>>
>
>
jansmolders86 commented 10 years ago

For when you are awake :), want do the server logs tell you? Looks to me you got an error on the server side preventing the page from loading properly.

Have a good night!

LiamKarlMitchell commented 10 years ago

This has been fixed with recent commits.

soyuka commented 9 years ago

Hi,

Is this related ?


/home/soyuka/mediacenterjs/node_modules/moviedb/lib/moviedb.js:41
    else throw res.error;
                  ^
Error: cannot GET /3/authentication/token/new?api_key=7983694ec277523c31ff1212e35e5fa3 (429)
    at Response.toError (/home/soyuka/mediacenterjs/node_modules/moviedb/node_modules/superagent/lib/node/response.js:106:13)
    at Response.setStatusProperties (/home/soyuka/mediacenterjs/node_modules/moviedb/node_modules/superagent/lib/node/response.js:193:12)
    at new Response (/home/soyuka/mediacenterjs/node_modules/moviedb/node_modules/superagent/lib/node/response.js:42:8)
    at IncomingMessage.<anonymous> (/home/soyuka/mediacenterjs/node_modules/moviedb/node_modules/superagent/lib/node/index.js:935:22)
    at IncomingMessage.emit (events.js:117:20)
    at _stream_readable.js:944:16
    at process._tickDomainCallback (node.js:486:13)