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

JustWatch Class can not be instantiated raises typeError #47

Open
ashgazer opened this issue Sep 7, 2020 · 8 comments
Open

JustWatch Class can not be instantiated raises typeError #47

ashgazer opened this issue Sep 7, 2020 · 8 comments

Comments

@ashgazer
Copy link
Contributor

ashgazer commented Sep 7, 2020

This has something to do with when trying to set the country
Traceback (most recent call last): File "<stdin>", line 1, in <module> , in __init__ self.locale = self.set_locale() , in set_locale if result['iso_3166_2'] == self.country or \ TypeError: string indices must be integers

@venkibale
Copy link

Facing similar issue, any help would be appreciated! @ashgazer any resolution on this?

@drexeljoe
Copy link

Same experience here. First noticed on Sep 9. The behavior is the same whether a country value is provided or not.

`>>> just_watch = JustWatch()

Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.7/site-packages/justwatch/justwatchapi.py", line 18, in init
self.locale = self.set_locale()
File "/usr/local/lib/python3.7/site-packages/justwatch/justwatchapi.py", line 45, in set_locale
if result['iso_3166_2'] == self.country or
TypeError: string indices must be integers
`

`>>> just_watch = JustWatch(country='US')

Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.7/site-packages/justwatch/justwatchapi.py", line 18, in init
self.locale = self.set_locale()
File "/usr/local/lib/python3.7/site-packages/justwatch/justwatchapi.py", line 45, in set_locale
if result['iso_3166_2'] == self.country or
TypeError: string indices must be integers
`

@venkibale
Copy link

Justwatch site is still functioning, is it like public use is restricted now?

@dreondre
Copy link

Justwatch site is still functioning, is it like public use is restricted now?

It's entirely possible. When I first found this repository, JW didn't have this page and now they do.
https://www.justwatch.com/ca/JustWatch-Streaming-API

@venkibale
Copy link

venkibale commented Sep 11, 2020 via email

@chkuendig
Copy link

chkuendig commented Sep 11, 2020

Looks like an change from their side.

curl "https://apis.justwatch.com/content/locales/state" or opening the url in the browser works just fine
curl "https://apis.justwatch.com/content/locales/state" --user-agent 'JustWatch Python client (github.com/dawoudt/JustWatchAPI)' only returns a empty object

FYI:
curl "https://apis.justwatch.com/content/locales/state" --user-agent 'JustWatch client (github.com/dawoudt/JustWatchAPI)' works so this might not have been targeted at this lib on purpose

@rking32
Copy link

rking32 commented Sep 17, 2020

thanks for @chkuendig's idea
using that i made a temp solution. but its not best.

from justwatch import JustWatch, justwatchapi

justwatchapi.__dict__['HEADER'] = {
    'User-Agent': 'JustWatch client (github.com/dawoudt/JustWatchAPI)'}

just_watch = JustWatch()

sandy1709 added a commit to TgCatUB/catuserbot that referenced this issue Sep 22, 2020
https: //github.com/dawoudt/JustWatchAPI/issues/47
Co-Authored-By: rking32 <[email protected]>
@ashgazer
Copy link
Contributor Author

@venkibale @rking32 I created a pull request for changing the user agent. Hopefully this gets merged soon.

#48

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

6 participants