Code Monkey home page Code Monkey logo

moviedb's Introduction

MovieDB

Build Status NPM version Dependency Status npm

Deprecation notice: This package is no longer maintained. Please use the moviedb-promise package.

node.js library that makes the interaction with themoviedb.org V3 API easy.

Installation

npm install moviedb --save

Usage

Require MovieDB and provide your themoviedb.org API KEY

const MovieDB = require('moviedb')('your api key');

Use the api methods as you want, for example:

mdb.searchMovie({ query: 'Alien' }, (err, res) => {
  console.log(res);
});

or

mdb.movieInfo({ id: 666}, (err, res) => {
  console.log(res);
});

now you can also make chain calls

mdb
  .searchMovie({ query: 'Zoolander' }, (err, res) => {
    console.log(res);
  })
  .movieInfo({ id: 123 }, (err, res) => {
    console.log(res);
  });

Available methods

All themoviedb.org API v3 methods included. Endpoint methods are included on a wiki page

moviedb's People

Contributors

alvaro-octal avatar amilajack avatar angelstoone avatar angelxmoreno avatar athieriot avatar btmills avatar dan-silverback avatar dehlen avatar dekatron avatar fbernardo avatar geoffreyplitt avatar gmertk avatar grantholle avatar impronunciable avatar joevanwanzeele avatar mandrake73 avatar oeuillot avatar plemarquand avatar ruudburger avatar samuraicode avatar wsyms 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

moviedb's Issues

TV changes?

I see movieChanges, but where are tvChanges?

Connection problems

Hi,
trying to connect with

var authConfig = require('./config/auth');

const tmdb = require('moviedb')(authConfig.tmdb.clientID, 'de');
tmdb.searchMovie({query:  'Alien'}, function(err, result) {
    if(err)
            throw (err);
    console.log(result);
});

I get a
"Error: getaddrinfo ENOTFOUND deauthentication deauthentication:80".

Any idea what the problem can be?

Thanks a lot.

Missing API call "/search/multi"

Currently using the great module for my movie application, which scans the whole movie directory.
Would be great to add the /search/multi functionality to the module,
CookingRobot

Experiencing duplicated requests per query.

Getting error "status_code":25, although never asking 40 requests.
text: '{"status_code":25,"status_message":"Your request count (43) is over the allowed limit of 40."}\n',
My suspicion is that every query creating double requests, resulting in "over the allowed limit" requests.
When i am requesting 22 single queries it shows 4 errors (generating actually 44 requests).
Indicating my Thesis is probably true.

Ecmascript 6 Support

Hello.
How do use the module for ECMAScript 6?
example:

import _ from './moviedb'

Language settings don't work

Hello
I did so as mentioned here: #46

mdb.searchMovie({ query: 'Alien', language: 'hu' }, function(err, res){
    console.log(res);
});

But I get english version to all movies instead in hungarian. For example this movie: Kingsman: Az aranykör but I get to this also in english all details. What is the problem?

TypeError: this.requestToken is not a function

Getting the following error when calling miscPopularMovies:

TypeError: this.requestToken is not a function
      at MovieDB.(anonymous function) (node_modules\moviedb\lib\moviedb.js:93:14)

movieInfo and discoverMovie are working fine

Missing function in npm release (movieReleaseDates)

Hi,

Seems like "mdb.movieReleaseDates" is not present in the release that is available on npm, I get the following error when i try to use it.

[TypeError: mdb.movieReleaseDates is not a function]

Any chance to get a new version published to npm, seems to be implemented (or started) here on github?

Getting images

The api only returns the file_path for each image, and to get the actual resource you have to craft a new request specified in the /3/configuration endpoint.

So to get an image from a file_path (plus apikey):

http://image.tmdb.org/t/p/{size}/{file_path}

I would try to implement it and make a pull request, but i'm new to node and i don't quite understand yet how the enpoints file works.

2 low severity vulnerabilities

I got this after installing the package

# npm audit report

superagent  <3.7.0
Large gzip Denial of Service in superagent - https://github.com/advisories/GHSA-8225-6cvr-8pqp
No fix available
node_modules/superagent
  moviedb  *
  Depends on vulnerable versions of superagent
  node_modules/moviedb

2 low severity vulnerabilities

Some issues need review, and may require choosing
a different dependency.

when the request fails, the callback is called with 'true'

Hi, when the request fail you are calling fn(res.error, null), is for instance the status code is 404 then res.error is just true.

My suggestion will be to change to something like this:

if(res.body && res.body.status_message){
  fn(new Error(res.body.status_message), null);
}else{
  fn(res.error, null);
}

for instance an status_message return by the moviedb is:

Invalid id - The pre-requisite id is invalid or not found

how to get data for page 2 or more

when ever i call
mdb.miscUpcomingMovies(function (err, result) { })
the result always shows only resluts from page one , how to get results from later pages ?
Thanks

Find Person, beginning at Movie

Given a list of movies, I'm trying to find which persons constitute a crew and a cast.

Currently, I'm fetching movies by genre. Then fetching credits for each movieId. This gives me cast and crew for each movie. However, I can't seem to find a way to get person from credit. Is this possible?

Setting language

Hi,

I was taking a look at the code trying to figure out how could I change the API language (it consist on pass a language parameter with every request), could you add it?.

node that, this works fine.

mdb.searchMovie({ query: 'Alien', language: 'es' }, function(err, res){
    console.log(res);
});

but maybe something like this, would be a bit more clean.

var mdb = require('moviedb')(key, lang)

thanks in advance.

[Future Request] Include genre names, not only IDs

Currently we only get genre IDs. The matching names could be found from a request and cheerio scrape on https://www.themoviedb.org/genre/${ID} then the selector $('.keyword.new h2 a').text(). Including a key for names would be much appreciated.

Ignore..

Changes TV missing

"ChangedTv" : { "resource": "tv/changes", "method": "get" }

thought all Changes were missing at first, as there was no Changes section that followed in your endpoints.json structure, but now see it in the misc section

sessions don't work.

endpoints.json has authentication.sessionId, but the session method tries to use authentication.session

Update Supported Methods List

Please add all supported methods of this library to the list in the README file.
For example the method searchTv() is supported but not listed.

Best Regards,
David

requestToken

Hi,

I'm wondering why requestToken is called before a request? It doesn't seem to be used and when many requests are start it doubles the call count to TMDB which is a problem due to their rate limiting?

I commented the code out and could run my queries without a problem.

Thanks
Andre

superagent is old

the version we have is 0.21.0. the Latest version is 1.6.1 which is about 9 versions ahead. There have been several bug fixes and performance enhancements in the releases between the two. Problem is that these updates have breaking changes including changes to their API. I can work on this if we agree that the update is good.

Adding cache

I would like to add caching to the module. I believe this would be simple and still allow for backwards compatibility. My process would be as follows:

  1. replace request with requestify
  2. expose the requestify configuration to the instantiation of the module. It would look like this:
var requestifyConfig = {};
var MovieDB = require('moviedb')('your api key', requestifyConfig);

For backwards compatibility everything will work the same as previous versions but if the requestifyConfig object is passed, the lib will cache all calls.

Please let me know if you like this for the module so I can get started.

503 error

I just got this error when trying to request tons of things at once. Probably not a good idea on my part but still, throwing an error might not be the best response ;-)

/Users/Flo/Desktop/shows/server/node_modules/moviedb/lib/moviedb.js:41
else throw res.error;
^
Error: cannot GET /3/authentication/token/new?api_key=XXXXXXXXXXXXXXXXXXXXXX (503)
at Response.toError (/Users/Flo/Desktop/shows/server/node_modules/moviedb/node_modules/superagent/lib/node/response.js:106:13)
at Response.setStatusProperties (/Users/Flo/Desktop/shows/server/node_modules/moviedb/node_modules/superagent/lib/node/response.js:193:12)
at new Response (/Users/Flo/Desktop/shows/server/node_modules/moviedb/node_modules/superagent/lib/node/response.js:42:8)
at IncomingMessage. (/Users/Flo/Desktop/shows/server/node_modules/moviedb/node_modules/superagent/lib/node/index.js:935:22)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:943:16
at process._tickCallback (node.js:419:13)

Support for append_to_response param

Some methods in the TMDb API have the append_to_response param that allows requesting additional information.

For example: /movie/id requests the movie's info and /movie/id?append_to_response=videos requests both the movie's info and its videos in the same request, avoiding making two separate requests for this.

It would be nice if this library would be able to support this too.

Promise version?

Love this library, but I was just wondering if there have been any thoughts about moving to promises for this?

Is this project still alive?

It seems like even small maintenance, like accepting PRs for security updates, has been on ice for years now. Are you still maintaining this repo? I think it would be a shame to let it die and/or splinter into a million forks, especially since the only other Node.js wrapper linked in the API docs is even more dead.

If you're no longer interested in maintaining this project, I would gladly offer to do so for you, here and on npm.

Watchlist endpoints have changed

According to the docs, the endpoints for TV (currently not available as a method) and Movie watchlists should be /account/{account_id}/watchlist/movies and /account/{account_id}/watchlist/tv.

Also, the endpoint to update watchlists has changed to /account/{account_id}/watchlist.

genreList is not a function

When I run this code:

    mdb.genreList((err, res) => {
      console.log(res);
    });

I get "genreList is not a function." The other examples use a query, ie:

mdb.searchMovie({ query: 'Alien' }, (err, res) => {
  console.log(res);
});

Of course, genreList doesn't need a query, so not sure if I'm doing it wrong or if it's a bug.

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.