Taxel / PlexTraktSync

A python script that syncs the movies, shows and ratings between trakt and Plex (without needing a PlexPass or Trakt VIP subscription)
MIT License
1.5k stars 100 forks source link

PlexTraktSync doesn't track any TV show anymore #1617

Closed timothe closed 9 months ago

timothe commented 9 months ago

Confirmation

The problem

PTS almost never tracks my episodes anymore. I have 2 libraries: Movies and TV shows.

TV Library setup: Screenshot 2023-10-24 at 16 39 05

Log info for various shows:

Test #1: Daryl Dixon 2023-10-07 01:04:04,401 ERROR[PlexTraktSync]:<Episode:2482:The-Walking-Dead:-Da-s01e01>: Unable to parse a valid provider from guid <PlexGuid:com.plexapp.agents.hama://tvdb-427464/1/1?lang=en> Test #2: Family Guy 2023-10-19 11:11:58,776 ERROR[PlexTraktSync]:<Episode:2573:Family-Guy-s22e02>: Unable to parse a valid provider from guid <PlexGuid:com.plexapp.agents.hama://tvdb-75978/22/2?lang=en> Test #3: One Piece 2023-10-19 18:22:58,793 ERROR[PlexTraktSync]:<Episode:2594:One-Piece-s16e258>: Unable to parse a valid provider from guid <PlexGuid:com.plexapp.agents.hama://tvdb-81797/16/258?lang=en> Test #4: Solar Opposites 2023-09-01 18:58:41,041 ERROR[PlexTraktSync]:<Episode:2377:Solar-Opposites-s04e09>: Unable to parse a valid provider from guid <PlexGuid:com.plexapp.agents.hama://tvdb-375892/4/9?lang=en>

Movies are tracked fine.

I used to use HAMA but tried to switch for it to work correctly with PTS. The container is checked every week for updates. The last update was 4 days ago.

However I see it's struggling to track all my shows now.

What am I missing? How can I fix it?

Error trace / logs

No response

Expected behavior

Tracking all TV episodes (manga + shows) flawlessly

Steps to reproduce the behavior

  1. Start taxel's PlexTraktSync docker image with command watch
  2. Watch an episode of the TV library with Plex

Inspect of problematic items

No response

Workarounds

No response

Install method

docker-compose

Config file contents

cache:
  path: $PTS_CACHE_DIR/trakt_cache

excluded-libraries:

config:
  dotenv_override: true

plex:
  timeout: 30

logging:
  append: false
  # 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: true
    # Clear collected state of items not present in Plex
    clear_collected: false
    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: false

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

latest

Python Version

embedded

Operating System and Version

DSM 7

simonc56 commented 9 months ago

After switching from HAMA to Plex Series agent, you should update you full library metadatas. By default , the agent switch is effective only for newly added episodes.

glensc commented 9 months ago

hama agent not supported, this has been requested multiple times:

glensc commented 9 months ago

I think if you do "Fix Match" for the show, it will update agent to the newly configured agent.

timothe commented 9 months ago

Ideally, HAMA would be supported indeed. In the meantime, I'm refreshing the library metadata and will keep you posted. Can you confirm the best agent for Trakt support? Is the original agent the right choice?

simonc56 commented 9 months ago

Read Good Practices it's explained.

timothe commented 9 months ago

I read it hence my config however I'm not sure where I should set "TMDB as source"

simonc56 commented 9 months ago

For example, if you use a media manager like Medusa you can choose your source provider (tmdb, tvdb, tvmaze,...). If you use Sonarr, you have no choice, it's tvdb as source. But it works quite good too.

Amateur-God commented 9 months ago

Can confirm using the plex agent results in failure to sync because provider local has no external Id, however if i switch the agent to be TVDB or TMDB, rescan my library and then run the sync, it syncs fine

simonc56 commented 9 months ago

Can confirm using the plex agent results in failure to sync because provider local has no external Id

If you have Plex matching issues, first check that you follow good practices and Plex standard for file naming. Then give details so we can help you.

Amateur-God commented 9 months ago

Can confirm using the plex agent results in failure to sync because provider local has no external Id

If you have Plex matching issues, first check that you follow good practices and Plex standard for file naming. Then give details so we can help you.

i use sonarr for naming and follow trash guides for the renaming.

it works fine when i use TVDB or TMDB as the metadata agent in plex, the only time i have an issue is when i use the plex agent

timothe commented 9 months ago

Ok I refreshed all metadata, did all the tips your shared. Here's the results so far: Test 2: Family Guy Tracking as expected ☑️ Test 3: One Piece [2KWARNING&nbsp;&nbsp;&lt;Episode:1917:One-Piece-s19e339&gt;:&nbsp;Skipping&nbsp;&lt;PlexGuid:local://1917&gt; Test 5: Rick & Morty Tracking as expected ☑️

(not sure why logs for me are sometimes putting a lot of [2K and in some sort of ciphered output, if you have a hint on how to fix that, I take it too)

I'm not surprised One Piece is not tracked as it was named and organised following the HAMA convention: One Piece [tvdb4-81797]/Arc 19 - Thriller Bark/One.Piece.E337-E338.720p.mkv etc

Am I right to think so? Is there a workaround?

simonc56 commented 9 months ago

If you name and organize your files according to tvdb order, it should be recognized by Plex. Just check that your Plex show settings is set to tvdb order. If Plex doesn't recognize some files, you can fix match manually.

timothe commented 9 months ago

For lulz I switched to ASS, which re-created my One Piece thumbnails (it disappeared when I switched earlier) But then I get the dreaded: WARNING <Episode:1917:One-Piece-s19e339>: Skipping guid <PlexGuid:com.plexapp.agents.thetvdb://81797/19/339?lang=en> not found on Trakt. I'm not surprised as I'm not following TVDB's naming scheme. I think I will skip anime's tracking till PTS supports HAMA. Thanks for your help!