Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Country initialization throws error. Used to work fine before #49

Open
Yatish84 opened this issue Oct 20, 2020 · 1 comment
Open

Country initialization throws error. Used to work fine before #49

Yatish84 opened this issue Oct 20, 2020 · 1 comment

Comments

@Yatish84
Copy link

Hi,

The below no longer works for me. It throws an error.

Can someone help me here?

just_watch = JustWatch(country='id')

  File "D:\Netflix\2020-10-20\Indonesia\JW_ID_1900_2012.py", line 6, in <module>
    just_watch = JustWatch(country='id')

  File "C:\Users\john\Anaconda3\lib\site-packages\justwatch\justwatchapi.py", line 18, in __init__
    self.locale = self.set_locale()

  File "C:\Users\john\Anaconda3\lib\site-packages\justwatch\justwatchapi.py", line 45, in set_locale
    if result['iso_3166_2'] == self.country or \

TypeError: string indices must be integers
@oleg131
Copy link

oleg131 commented Oct 29, 2020

Seems that the header is no longer accepted, so the api response is not what expected.

As a workaround, set a different header manually, e.g.

import justwatch
justwatch.justwatchapi.HEADER = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants