worr / node-imdb-api

A non-scraping, functional node.js interface to imdb (mirror of gitlab.com/worr/node-imdb-api)
https://gitlab.com/worr/node-imdb-api
339 stars 50 forks source link

Support games from imdb #81

Closed bigschatz closed 4 years ago

bigschatz commented 4 years ago

Hi!

Thank you for creating this great module. I have been using it quite often, however there are some search query results for titles that do not return any data.

I am using imdb.search method from the node package

Example search queries that DON'T return data: "The Goonies" "Gremlins" "Harry Potter"

These however DO work: "Star Wars" "Potter" (for Harry Potter search) "Rocky"

Thank you

bigschatz commented 4 years ago

I should add that doing an imdb.get({ title }) type search of The Goonies (tt0089218) returns the correct data for that title.

worr commented 4 years ago

I can't seem to repro this. I wrote a small script with your examples to repro:

imdb = require("./lib/imdb");

async function main() {
    for (const movie of ["The Goonies", "Harry Potter", "Gremlins"]) {
        const res = await imdb.search({name: movie}, {apiKey: "xxx"});
        for (const result of res.results) {
            console.log(result.name);
        }
        console.log(res.totalresults);
    }
}

main();

Prints:

The Goonies
The Goonies II
The Making of 'The Goonies'
The Making of a Cult Classic: The Unauthorized Story of 'The Goonies'
The Goonies
Cyndi Lauper: The Goonies 'R' Good Enough
The Goonies
A Tribute to the Goonies
8
Harry Potter and the Deathly Hallows: Part 2
Harry Potter and the Sorcerer's Stone
Harry Potter and the Chamber of Secrets
Harry Potter and the Prisoner of Azkaban
Harry Potter and the Goblet of Fire
Harry Potter and the Order of the Phoenix
Harry Potter and the Deathly Hallows: Part 1
Harry Potter and the Half-Blood Prince
Harry Potter and the Chamber of Secrets
Harry Potter and the Forbidden Journey
93
Gremlins
Gremlins 2: The New Batch
Spirits of the Air, Gremlins of the Clouds
Gremlins: Recall
Gremlins 2: The New Batch
Gremlins
Gremlins: Stripe Versus Gizmo
The Wiggles: Whoo Hoo! Wiggly Gremlins!
Gremlins: Unleashed!
Gremlins in the Basement
16

Naturally this only fetches the first page, but it does seem to yield results. Can you try the test program with your key?

bigschatz commented 4 years ago

This is the problem:

ImdbError {
  message: "type: 'game' is not valid",
  name: 'imdb api error'
}

When I search for a tt number that is of type 'game', my Promise.all fails. Are games not searchable on the OMDb??

worr commented 4 years ago

Fixed in 4.3.0, sorry about the delay.