RileyXX / IMDB-Trakt-Syncer

A python script that syncs user watchlist, ratings and reviews for Movies, TV Shows and Episodes both ways between Trakt and IMDB.
MIT License
90 stars 2 forks source link

'NoneType' object has no attribute 'text' #68

Closed CabbageMcHead closed 1 year ago

CabbageMcHead commented 1 year ago

Is there already an issue for your problem?

Bug Description

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/IMDBTraktSyncer/IMDBTraktSyncer.py", line 122, in main trakt_watchlist, trakt_ratings, trakt_reviews, watched_content = traktData.getTraktData() ^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/IMDBTraktSyncer/traktData.py", line 18, in getTraktData json_data = json.loads(response.text) ^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'text'

Environment

MacOs Sonoma 14

Screenshots

No response

RileyXX commented 1 year ago

Hi thanks for reporting this. This is due to a bug in the script with the Trakt authorization. The Trakt auth token expires after 3 months but the script is not handling this correctly. I'm working on a fix now so will release a patch soon.

In the meantime, to fix this manually you can modify the credentials.txt and remove the trakt_access_token field "trakt_access_token": "abcdlongstring3098uhiouh4i165uh23uihujhiouhjuhioh",. This will force the script to reauthenticate with Trakt and it should work fine after that.

The credentials.txt file will be in your Python packages folder C:\Users\YOUR_USERNAME\AppData\Local\Programs\Python\Python311\Lib\site-packages\IMDBTraktSyncer.

Appreciate your patience while I work on a fix.

RileyXX commented 1 year ago

Fixed now in v1.8.0. Let me know if this works for you. If not I can take another look.

You can upgrade using the following:

python -m pip install IMDBTraktSyncer --upgrade