Closed armand-abasllari closed 1 year ago
Hi, thanks for the detailed information! This is likely to be an issue with rate limiting, other status unavailable errors with Trakt api or incorrect api credentials. This is not the first request in the code so in your case it is most likely due to rate limiting or other status unavailable errors.
I have implemented a new patch that should fix this problem. You can see the details of this patch here.
To update simple run the following in command line:
python -m pip install TMDBTraktSyncer --upgrade
Alternatively, you can download the latest release from the releases page.
Let me know if this fixes your issues. If not, you can post any other relevant errors here and I will try my best to help troubleshoot. Thanks!
Hey,
i tried again and now i get the following error:
Traceback (most recent call last): File "c:\Users\username\Desktop\Python Projects\TMDB-Trakt-Syncer-main\TMDBTraktSyncer\TMDBTraktSyncer.py", line 26, in main trakt_ratings = traktRatings.getTraktRatings(trakt_client_id, trakt_access_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\username\Desktop\Python Projects\TMDB-Trakt-Syncer-main\TMDBTraktSyncer\traktRatings.py", line 16, in getTraktRatings json_data = json.loads(response.text) ^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'text'
Hi there sorry for the confusion, v1.0.8 and v1.0.9 had some bugs. I posted a new patch that should have fixed them. Can you verify that you're running on the latest version v1.1.1? You can upgrade using the following:
python -m pip install TMDBTraktSyncer --upgrade
The latest version v1.1.1 should print more detailed information about the api request that is failing which can help me troubleshoot. If you are still having issues with this error, I'm specifically looking for a message containing one of the following:
200: "Success",
201: "Success - new resource created (POST)",
204: "Success - no content to return (DELETE)",
400: "Bad Request - request couldn't be parsed",
401: "Unauthorized - OAuth must be provided",
403: "Forbidden - invalid API key or unapproved app",
404: "Not Found - method exists, but no record found",
405: "Method Not Found - method doesn't exist",
409: "Conflict - resource already created",
412: "Precondition Failed - use application/json content type",
420: "Account Limit Exceeded - list count, item count, etc",
422: "Unprocessable Entity - validation errors",
423: "Locked User Account - have the user contact support",
426: "VIP Only - user must upgrade to VIP",
429: "Rate Limit Exceeded",
500: "Server Error - please open a support ticket",
502: "Service Unavailable - server overloaded (try again in 30s)",
503: "Service Unavailable - server overloaded (try again in 30s)",
504: "Service Unavailable - server overloaded (try again in 30s)",
520: "Service Unavailable - Cloudflare error",
521: "Service Unavailable - Cloudflare error",
522: "Service Unavailable - Cloudflare error"
This time i got :
"Request failed with status code 404: Not Found - method exists, but no record found"
"Request failed with status code 404: Not Found - method exists, but no record found"
Thanks that helped narrow down the issue. I think I was able to determine the cause of this error. It's because for some Trakt users their username is different from the url slug for their username (e.g. Username-564161626). This was causing the wrong api request to be made hence the 404 error. This should be fixed now in the latest patch v1.1.6.
Let me know if this fix works for you.
To update to v1.1.6 run the following in command line:
python -m pip install TMDBTraktSyncer --upgrade
I confirm that after the latest patch now it worked perfectly.
Glad it worked thanks for the update!
Is there already an issue for your problem?
Bug Description
--- ERROR --- An error occurred while running the script. Please submit the error to GitHub with the following information:
Traceback (most recent call last): File "c:\Users\username\Desktop\Python Projects\TMDB-Trakt-Syncer-main\TMDBTraktSyncer\TMDBTraktSyncer.py", line 25, in main trakt_ratings = traktRatings.getTraktRatings(trakt_client_id, trakt_access_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\username\Desktop\Python Projects\TMDB-Trakt-Syncer-main\TMDBTraktSyncer\traktRatings.py", line 19, in getTraktRatings json_data = json.loads(response.text) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1008.0_x64qbz5n2kfra8p0\Lib\json\init.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1008.0_x64qbz5n2kfra8p0\Lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1008.0_x64__qbz5n2kfra8p0\Lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Environment
Windows 11
Screenshots
No response