Taxel / PlexTraktSync

A python script that syncs the movies, shows and ratings between trakt and Plex (without needing a PlexPass or Trakt VIP subscription)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: 'NoneType' object has no attribute 'is_discover' during a 2 way sync

ekarious 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 launch a 2-way sync resulted in the error: 'NoneType' object has no attribute 'is_discover'.
Plex and Trakt are authentified and linked with success after following the README.md file.

Then used the command plextraktsync sync --sync=watchlist.
Plex watchlist sync was done with success but as Trakt watchlist sync was starting the error above hit.

Error trace / logs

2023-04-19 21:12:43,773 INFO[PlexTraktSync]:PlexTraktSync [0.26.1]
2023-04-19 21:12:43,875 WARNING[PlexTraktSync]:Partial walk, disabling liked lists updating. Liked lists won't update because it needs full library sync.
2023-04-19 21:12:43,876 WARNING[PlexTraktSync]:Running partial library sync. Liked lists won't update because it needs full library sync.
2023-04-19 21:12:48,517 ERROR[PlexTraktSync]:'NoneType' object has no attribute 'is_discover'
Traceback (most recent call last):
  File "C:\Users\Yann\.local\pipx\venvs\plextraktsync\lib\site-packages\plextraktsync\cli.py", line 25, in wrap
    cmd(*args, **kwargs)
  File "C:\Users\Yann\.local\pipx\venvs\plextraktsync\lib\site-packages\plextraktsync\commands\sync.py", line 68, in sync
    runner.sync(walker=w, dry_run=config.dry_run)
  File "C:\Users\Yann\.local\pipx\venvs\plextraktsync\lib\site-packages\plextraktsync\sync.py", line 107, in sync
    self.sync_watchlist(walker, dry_run=dry_run)
  File "C:\Users\Yann\.local\pipx\venvs\plextraktsync\lib\site-packages\plextraktsync\sync.py", line 221, in sync_watchlist
    self.watchlist_sync_item(m, dry_run)
  File "C:\Users\Yann\.local\pipx\venvs\plextraktsync\lib\site-packages\plextraktsync\sync.py", line 178, in watchlist_sync_item
    logger.info(f"Skipping {m.title_link} from Trakt watchlist because not found in Plex Discover", extra={"markup": True})
  File "C:\Users\Yann\.local\pipx\venvs\plextraktsync\lib\site-packages\plextraktsync\media.py", line 54, in title_link
    link = self.plex_api.media_url(self.plex)
  File "C:\Users\Yann\.local\pipx\venvs\plextraktsync\lib\site-packages\plextraktsync\plex\PlexApi.py", line 88, in media_url
    base_url = self.plex_discover_base_url if m.is_discover or discover else self.plex_base_url("server")
AttributeError: 'NoneType' object has no attribute 'is_discover'

Expected behavior

Get trakt and plex to sync their watchlist

Steps to reproduce the behavior

  1. Install with pipx (i am on windows 10) with python 3.10
  2. Use plextraktsync login so the cli can access to plex and trakt
  3. Use plextraktsync sync --sync=watchlist
  4. See the error coming when trying to sync Trakt list.

Inspect of problematic items

No response

Workarounds

No response

Install method

pipx

Config file contents

cache:
  path: $PTS_CACHE_DIR/trakt_cache

excluded-libraries:
  - Private
  - Family Holidays

config:
  dotenv_override: true

plex:
  timeout: 30

logging:
  append: true
  # Whether to show timestamps in console messages
  console_time: false
  debug: false
  filename: plextraktsync.log
  # Additional logger names to apply filtering
  filter_loggers:
#    - plexapi
#    - requests_cache.backends
#    - requests_cache.backends.base
#    - requests_cache.backends.sqlite
#    - requests_cache.policy.actions
#    - requests_cache.session
#    - trakt.core
#    - urllib3.connectionpool
  filter:
#    # Filter out all messages with level WARNING
#    - level: WARNING
#    # Filter out message with level WARNING and containing a text
#    - level: WARNING
#      message: "not found on Trakt"
#    - message: "because provider local has no external Id"
#    - message: "because provider none has no external Id"
#    - message: "Retry using search for specific Plex Episode"
#    # Filter out messages by requests_cache
#    - name: requests_cache.backends
#    - name: requests_cache.backends.base
#    - name: requests_cache.backends.sqlite
#    - name: requests_cache.policy.actions
#    - name: requests_cache.session

# settings for 'sync' command (default)
sync:
  plex_to_trakt:
    collection: false
    # Clear collected state of items not present in Plex
    clear_collected: true
    ratings: true
    watched_status: true
    # If plex_to_trakt watchlist=false and trakt_to_plex watchlist=true
    # the Plex watchlist will be overwritten by Trakt watchlist
    watchlist: true
  trakt_to_plex:
    liked_lists: true
    # If two-way rating sync, Plex rating takes precedence over Trakt rating
    ratings: true
    watched_status: true
    # If trakt_to_plex watchlist=false and plex_to_trakt watchlist=true
    # the Trakt watchlist will be overwritten by Plex watchlist
    watchlist: true
    # If you prefer to fetch trakt watchlist as a playlist instead of
    # plex watchlist, toggle this to true (is read only if watchlist=true)
    watchlist_as_playlist: false

# settings for 'watch' command
watch:
  add_collection: false
  remove_collection: false
  # what video watched percentage (0 to 100) triggers the watched status
  scrobble_threshold: 80
  # true to scrobble only what's watched by you, false for all your PMS users
  username_filter: true
  # Show the progress bar of played media in terminal
  media_progressbar: true

xbmc-providers:
  movies: imdb
  shows: tvdb

##### Advanced settings below this line, don't edit unless you know what you're doing #####
#http_cache:
  # https://requests-cache.readthedocs.io/en/main/user_guide/expiration.html#url-patterns
  # https://requests-cache.readthedocs.io/en/main/user_guide/expiration.html#expiration-values
  #
  # The value is seconds to cache.
  # Or one of the following special values:
  # - DO_NOT_CACHE: Skip both reading from and writing to the cache
  # - EXPIRE_IMMEDIATELY: Consider the response already expired, but potentially usable
  # - NEVER_EXPIRE: Store responses indefinitely
  #
  # The value can be also suffixed with a time unit:
  # - 5m, 1h, 3d
  # See full documentation at:
  # - https://github.com/wroberts/pytimeparse#pytimeparse-time-expression-parser
  #
  # NOTE: If there is more than one match, the first match will be used in the order they are defined
#  policy:
#    "*.trakt.tv/users/me": 1d
#    "*.trakt.tv/users/likes/lists": DO_NOT_CACHE

# vim:ts=2:sw=2:et

Version

0.26.1

Python Version

3.10.1

Operating System and Version

Windows 10

You can downgrade to version 0.26.0 untill this bug is fixed.

Issue appeared with #1448

Downgrading to 0.26 works fine. Thanks !

Test the fix: #1463

Still got the error in 0.26.2
Only when processing Trakt watchlist into Plex.

It's not merged. I asked to test that specific pull request.

Oh sorry for that.
Tried to install as stated in Doc: plextraktsync self-update --pr 1463
But the self-update command does not exists it seems. I will try later with a github clone instead.

There is already issue about that, but the reporter has disappeared failing to provide details:

@Kitefr if it wasn't clear enough: add your details there to fix missing self-update

I will. Thanks