Closed areqq closed 11 months ago
Thanks. The previous code didn't fail for me with Turkish IPs; I don't fully understand how local titles are determined. Anyway, I've made the change and added a test for "Burn Notice".
Did you port localized title
? Is there currently a way to return it?
I don't like the idea of having a field which can have different values based on where it's called from. So I don't intend to support a localized title field for now. I think it's better to get it from the movie aka's once that is implemented.
It seems IMDb defaults to your country for locale data if your Accept-Language header is not set to English. If you're in Turkey and the header is set to any other language other than English, it will always show you a Turkish title along with other localized data (poster image, PG rating, etc.). I tested it on both Chrome and Firefox (I also used a proxy in another country), so I'm not sure how the original project is fetching localized title
. But it works for every language that I tried.
That's helpful, thanks. I see that cinemagoer sets the Accept-Language header to "en-us,en;q=0.5"
.
Oh, so IMDb only likes BCP 47 language codes. When changing the language in browser settings (which changes the Accept-Language header, too), you have to specifically select a language with a country, not just a language, or else you're going to end up with a two-digit (ISO 639) language code. Changing the intl.accept_languages
flag manually in Firefox also works, but a four-digit code needs to be the first entry.
Setting the header to a two-digit language code of a random language will default to your language (this is based on IP?). English (en) is the exception.
There is similarly a problem with release dates. For example, the release date for the Doctor Who episode https://www.imdb.com/title/tt0562992/ can be reported as 2005-03-26 (original/UK) or 2006-03-17 (US).
title should be 'Burn Notice', website probably recognizes my IP as Polish and translates the title ;/ however, there is an originalTitleText in the json - please return it.