node-imdb-api icon indicating copy to clipboard operation
node-imdb-api copied to clipboard

Does it works with film title written in other languages?

Open roccomuso opened this issue 7 years ago • 11 comments

Would it be difficult to implement some kind of i18n? It seems to be working just with movies given his english title.

roccomuso avatar Oct 23 '16 16:10 roccomuso

Unfortunately, this isn't available in the upstream API that I'm using.

worr avatar Nov 15 '16 06:11 worr

@roccomuso you can translate it before to use the api, in the most of cases you can get the right english title

sunsgs avatar Jan 16 '17 14:01 sunsgs

@sunsgs Most of the time translations are completly different, just because they tend to change meanings avoiding literal translation, it wouldn't work.

roccomuso avatar Jan 17 '17 09:01 roccomuso

The Movie DB has an 'AlternativeTitles' endpoint which you could potentially use for i18n.

https://github.com/impronunciable/moviedb/blob/v0.2.0/lib/endpoints.json#L34

Once you have the correct imdb id you can use this package to get the metadata.

daviestar avatar Jan 24 '17 11:01 daviestar

Hi,

It is possible by changing the headers during the execution of "request" eg to force english language : request({headers: {'Accept-Language': 'en-US'}, uri: 'http://www.imdb.com/title/' + id + '/'}, function (error, response, body)

damru avatar May 18 '17 20:05 damru

@damru let me better understand. If you provide the Accept-Language header, the IMDB engine will search the record in a different language? Is this confirmed?

roccomuso avatar May 19 '17 10:05 roccomuso

@roccomuso exactly. Basically, IMDB provides the information depending on your location. So if you are in France for example, it will provides the French title (which can be the same as the original, it is not a simple translation). And changing the headers fakes this location, so you can retrieve information in the language you want.

damru avatar May 19 '17 12:05 damru

Definetly a wanted feature.

roccomuso avatar May 19 '17 14:05 roccomuso

Cool, thanks for the input. I'll explore this as soon as I get time.

worr avatar May 19 '17 17:05 worr

@worr Any update on this topic?

svzi avatar Aug 10 '18 15:08 svzi

hi, any news about accept-language request header?

fatshotty avatar Aug 19 '19 20:08 fatshotty