RileyXX / TMDB-Trakt-Syncer

A python script that syncs user watchlist and ratings for Movies, TV Shows and Episodes both ways between Trakt and TMDB.
MIT License
31 stars 1 forks source link

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

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/TMDBTraktSyncer/TMDBTraktSyncer.py", line 21, in main trakt_watchlist, trakt_ratings, watched_content = traktData.getTraktData() ^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/TMDBTraktSyncer/traktData.py", line 17, in getTraktData json_data = json.loads(response.text) ^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'text'

Environment

MacOS 14 Sonoma

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\TMDBTraktSyncer.

Appreciate your patience while I work on a fix.

RileyXX commented 1 year ago

Fixed now in v1.6.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 TMDBTraktSyncer --upgrade