question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

country 'LV', Latvia, returns no results on any shows

See original GitHub issue
just_watch = JustWatch(country='LV')
results = just_watch.search_for_item(query=<ANY_MOVIE>)

returns no results. Which is strange since Locale.parse('und_{}'.format('LV')).language returns ‘lv’, which is the correct language code, as far as I know. What else could be going wrong? Thanks a lot!

Does this mirror #26? Why would it work with, e.g. de_DE for Germany, but not lv_LV for Latvia? I tried to apply the fix in #26, but no change!

Edit: Same issue for ‘SV’, Sweden

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
draogncommented, Apr 7, 2019

I’ve stumbled upon where to get the correct locale - apis.justwatch.com/content/locales/state

import requests
r = requests.Session()
HEADER = {'User-Agent':'JustWatch Python client (github.com/dawoudt/JustWatchAPI)'}
api_url = 'https://apis.justwatch.com/content/locales/state'
rr = r.get(api_url, headers=HEADER)
results = rr.json()
print(results[0].keys())
print([(i['exposed_url_part'], i['full_locale']) for i in results])

gives

dict_keys(['exposed_url_part', 'is_standard_locale', 'full_locale', 'i18n_state', 'iso_3166_2', 'country', 'currency', 'currency_name', 'country_names'])

[('us', 'en_US'), ('de', 'de_DE'), ('br', 'pt_BR'), ('au', 'en_AU'), ('nz', 'en_NZ'), ('ca', 'en_CA'), ('uk', 'en_GB'), ('za', 'en_ZA'), ('ie', 'en_IE'), ('nl', 'en_NL'), ('lt', 'en_LT'), ('se', 'en_SE'), ('th', 'en_TH'), ('pt', 'pt_PT'), ('hu', 'hu_HU'), ('bg', 'bg_BG'), ('no', 'en_NO'), ('ru', 'ru_RU'), ('ee', 'en_EE'), ('lv', 'en_LV'), ('in', 'en_IN'), ('ch', 'de_CH'), ('at', 'de_AT'), ('my', 'en_MY'), ('id', 'en_ID'), ('ph', 'en_PH'), ('ve', 'es_VE'), ('hk', 'en_HK'), ('tw', 'en_TW'), ('sg', 'en_SG'), ('vn', 'vi_VN'), ('pl', 'pl_PL'), ('fi', 'fi_FI'), ('dk', 'en_DK'), ('ro', 'ro_RO'), ('co', 'es_CO'), ('es', 'es_ES'), ('tw-zh', 'zh_TW'), ('fr', 'fr_FR'), ('kr', 'ko_KR'), ('it', 'it_IT'), ('mx', 'es_MX'), ('jp', 'ja_JP')]

So an initial search against this for lv will give back ‘en_LV’ from ‘full_locale’

Probably just need to update the init to try to get this data and fall back on the current derivation if not found.

0reactions
juliangaalcommented, May 11, 2019

Looks great, thanks a lot. I’ll test it asap

Read more comments on GitHub >

github_iconTop Results From Across the Web

Latvia in the Eurovision Song Contest 2022
17 songs were selected to compete in the national final, which consisted of two shows: a semi-final and a final. In the semi-final...
Read more >
Latvian VAT rates and VAT compliance
Learn about Latvian VAT rates and VAT compliance. Get detailed VAT guidelines and rules for Latvia. VAT returns, VAT rates and more.
Read more >
Latviabeerfest | Riga, Latvia
After a two-year break, the largest beer festival in Eastern Europe, LatviaBeerfest, returns for the 10th time to be held in Vermane Garden ......
Read more >
Latvia
Latvia continues to lose workers through migration and more than 40% of all emigrants between 2009 and. 2016 were high-skilled. This contributes to...
Read more >
Information for travellers to Latvia on the provisions ...
Beginning 1 April 2022, travellers entering Latvia will no longer need to present an interoperable vaccination or recovery certificate, or proof of a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found