Skip to content

Commit 0323a97

Browse files
committed
fix: handle unauthorized access for private Trakt accounts during import
1 parent d9ba9a5 commit 0323a97

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/integrations/imports/trakt.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ def _get_paginated_data(self, endpoint, item_type="items"):
237237
"User slug can be found in your Trakt profile URL."
238238
)
239239
raise MediaImportError(msg) from error
240+
241+
if error.response.status_code == requests.codes.unauthorized:
242+
msg = "This account is set to private, use OAuth import instead."
243+
raise MediaImportError(msg) from error
240244
raise
241245

242246
if not page_data:

0 commit comments

Comments
 (0)