JustWatchAPI icon indicating copy to clipboard operation
JustWatchAPI copied to clipboard

JustWatch Class can not be instantiated raises typeError

Open ashgazer opened this issue 5 years ago • 8 comments

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

ashgazer avatar Sep 07 '20 20:09 ashgazer

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

venkibale avatar Sep 09 '20 13:09 venkibale

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 `

drexeljoe avatar Sep 11 '20 15:09 drexeljoe

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

venkibale avatar Sep 11 '20 15:09 venkibale

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

dreondre avatar Sep 11 '20 15:09 dreondre

Ohh, could be. I didn't find any good alternative as well.

On Fri, Sep 11, 2020, 9:17 PM dreondre [email protected] wrote:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dawoudt/JustWatchAPI/issues/47#issuecomment-691172816, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIFUXF3ZNR5C6S4VBGR4MOLSFJBAZANCNFSM4Q632EVA .

venkibale avatar Sep 11 '20 16:09 venkibale

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

chkuendig avatar Sep 11 '20 23:09 chkuendig

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

rking32 avatar Sep 17 '20 05:09 rking32

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

https://github.com/dawoudt/JustWatchAPI/pull/48

ashgazer avatar Sep 26 '20 11:09 ashgazer