pymedusa / Medusa

Automatic Video Library Manager for TV Shows. It watches for new episodes of your favorite shows, and when they are posted it does its magic.
https://pymedusa.com
GNU General Public License v3.0
1.76k stars 274 forks source link

Trakt.tv API endpoint needs to be updated (api-v2launch.trakt.tv) #11618

Open XxUnkn0wnxX opened 7 months ago

XxUnkn0wnxX commented 7 months ago

Describe the bug trakt.tv changed their API end point as stated here: https://twitter.com/traktapi/status/1753116197229670524 trakt syncing, notification, add recommended shows no longer function

Screenshots

Screen Shot 2024-02-02 at 1 23 45 pm Screen Shot 2024-02-02 at 1 23 37 pm Screen Shot 2024-02-02 at 1 23 24 pm

Medusa (please complete the following information):

Debug logs (at least 50 lines):

``` 2024-02-02 13:18:16 ERROR Thread_0 :: [bf956fc] Exception generated: 'MedusaApp' object has no attribute 'TRAKT_DEVICE_CODE' Traceback (most recent call last): File "/Users/ovidijus/Apps/Medusa/medusa/server/web/core/base.py", line 252, in async_call result = function(**kwargs) ^^^^^^^^^^^^^^^^^^ File "/Users/ovidijus/Apps/Medusa/medusa/server/web/home/handler.py", line 367, in checkTrakTokenOauth if not app.TRAKT_DEVICE_CODE.get('requested'): ^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'MedusaApp' object has no attribute 'TRAKT_DEVICE_CODE' ``` ``` 2024-02-02 13:26:41 WARNING POSTPROCESSQUEUE-POST-PROCESS :: [bf956fc] Unable to update Trakt: ConnectionError(MaxRetryError("HTTPSConnectionPool(host='api-v2launch.trakt.tv', port=443): Max retries exceeded with url: /sync/collection (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))")) Traceback (most recent call last): File "/Users/ovidijus/Apps/Medusa/ext/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ovidijus/Apps/Medusa/ext/urllib3/util/connection.py", line 72, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/socket.py", line 962, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ socket.gaierror: [Errno 8] nodename nor servname provided, or not known During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/ovidijus/Apps/Medusa/ext/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "/Users/ovidijus/Apps/Medusa/ext/urllib3/connectionpool.py", line 404, in _make_request self._validate_conn(conn) File "/Users/ovidijus/Apps/Medusa/ext/urllib3/connectionpool.py", line 1058, in _validate_conn conn.connect() File "/Users/ovidijus/Apps/Medusa/ext/urllib3/connection.py", line 363, in connect self.sock = conn = self._new_conn() ^^^^^^^^^^^^^^^^ File "/Users/ovidijus/Apps/Medusa/ext/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known ``` [pyMedusa Logs.zip](https://github.com/pymedusa/Medusa/files/14133383/pyMedusa.Logs.zip)

Additional context the new API endpoint is: https://api.trakt.tv

XxUnkn0wnxX commented 7 months ago

@medariox please change on Medusa/ext/trakt/core.py, on line 31: BASE_URL = 'api-v2launch.trakt.tv' to BASE_URL = 'https://api.trakt.tv/'

I have tested this & it works fine, auth etc.. @farni from discord suggested this.