PlexTraktSync is broken for Plex 2FA users
ericswpark opened this issue · comments
Confirmation
- I have read the README.md on the project homepage
- I have checked if identical issue already exists
- I have tried downgrading to find version that can be used as a workaround
The problem
Trying to run PTS for the first time and I'm getting a 401 unauthorized error when signing in.
Error trace / logs
> plextraktsync sync
INFO PlexTraktSync [0.27.4]
Please enter your Plex username or e-mail (ericswpark): ericswpark
If you have 2 Factor Authentication enabled on Plex you can append the code
to your password below (eg. passwordCODE)
Please enter your Plex password:
Log in to Plex failed: '(401) unauthorized;
https://plex.tv/api/v2/users/signin <?xml version="1.0" encoding="UTF-8"?>
<errors> <error code="1029" message="Please enter the verification code"
status="401"/> </errors> ', Try again.
Expected behavior
Logging in to Plex works
Steps to reproduce the behavior
- Run
plextraktsync sync
- Type in username
- Type in password with TOTP code
Inspect of problematic items
No response
Workarounds
No response
Install method
pipx
Config file contents
# Config File: /Users/ericswpark/Library/Application Support/PlexTraktSync/config.yml
cache:
path: /Users/ericswpark/Library/Caches/PlexTraktSync/trakt_cache
excluded-libraries:
- Private
- Family Holidays
config:
dotenv_override: true
plex:
timeout: 30
logging:
append: true
console_time: false
debug: false
filename: plextraktsync.log
filter_loggers: null
filter: null
sync:
plex_to_trakt:
collection: true
clear_collected: false
ratings: true
watched_status: true
watchlist: true
trakt_to_plex:
liked_lists: true
ratings: true
watched_status: true
watchlist: true
watchlist_as_playlist: false
rating_priority: plex
watch:
add_collection: false
remove_collection: false
scrobble_threshold: 80
username_filter: true
media_progressbar: true
xbmc-providers:
movies: imdb
shows: tvdb
Version
PlexTraktSync 0.27.4
Python Version
3.11.5
Operating System and Version
macOS 13.5.2
@twolaw the linked discussion goes nowhere and the API endpoint has changed to v2. Considering that my Plex clients authenticate to Plex's servers fine, I feel like this is on PTS's side.
PlexTraktSync/plextraktsync/commands/plex_login.py
Lines 66 to 72 in af6ce74
We attempt to log in here with the password and 2FA code concatenated. However, the plexapi
library that PTS depends on expects a separated code
argument:
In this commit, the API changed from concatenating the two to sending the 2FA code separately:
This commit was added July 27, and shipped with 4.15.0 of the library, which PTS updated to with the automated Dependabot PR:
So PTS has been broken for users using 2FA ever since tag 0.27.1, which was released 2 weeks ago.