cinemagoer / cinemagoerng

A redesign of Cinemagoer (experimental).
GNU General Public License v2.0
6 stars 1 forks source link

originalTitleText #1

Closed areqq closed 11 months ago

areqq commented 11 months ago
m = web.get_title(810788)
print(m)
TVSeries(imdb_id=810788, title='Tożsamość szpiega', year=2007, rating=Decimal('8.0'), n_votes=77890, genres=['Action', 'Crime', 'Drama', 'Mystery', 'Thriller'], plot={'en-US': 'A spy recently disavowed by the U.S. government uses his special ops training to help others in trouble.'}, taglines=[], end_year=2013, runtime=44)

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.

uyar commented 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".

Susexe commented 6 months ago

Did you port localized title? Is there currently a way to return it?

uyar commented 6 months ago

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.

Susexe commented 5 months ago

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.

uyar commented 5 months ago

That's helpful, thanks. I see that cinemagoer sets the Accept-Language header to "en-us,en;q=0.5".

Susexe commented 5 months ago

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.

uyar commented 5 months ago

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).