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

Displaying errors, then aborts at the same episode every time

pterisaur 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

While syncing, PTS displays many warnings, then shows a few errors and aborts when it gets to the same episode. This happens every time, unless I tell it to ignore the library containing the episode.

Error trace / logs

The log file is empty, likely do to it aborting... but here's what is displayed in Terminal when I run plextraktsync sync:

There are many warnings like this:

WARNING  <Episode:339422:American-Experience-s33e09>: Skipping <PlexGuid:local://339422> because provider local has no external Id 

And this is where it has the final errors and aborts:

WARNING  <Episode:430490:Hillsong:-A-Megachur-s01e04>: Skipping <PlexGuid:local://430490> because provider local has no external Id                       
WARNING  Missing argument: title or season is required for plextraktsync.plex.PlexLibraryItem._get_episodes(), retrying after 1 seconds (try: 1/5)        
WARNING  Missing argument: title or season is required for plextraktsync.plex.PlexLibraryItem._get_episodes(), retrying after 2 seconds (try: 2/5)        
WARNING  Missing argument: title or season is required for plextraktsync.plex.PlexLibraryItem._get_episodes(), retrying after 3 seconds (try: 3/5)        
WARNING  Missing argument: title or season is required for plextraktsync.plex.PlexLibraryItem._get_episodes(), retrying after 4 seconds (try: 4/5)        
WARNING  Missing argument: title or season is required for plextraktsync.plex.PlexLibraryItem._get_episodes(), retrying after 5 seconds (try: 5/5)    
ERROR    Error: Missing argument: title or season is required                                                                                             
ERROR    API didn't respond properly, script will abort now. Please try again later.                                                                      
ERROR    Last call: plextraktsync.plex.PlexLibraryItem._get_episodes((), {})

Expected behavior

Expected to skip episodes missing from Trakt, then continue running... not error and abort.

Steps to reproduce the behavior

  1. Run plextraktsync sync
  2. Wait until it's syncing the episode that causes it to abort
  3. Watch it abort

Inspect of problematic items

Inspecting 430490: <local:430490:Episode:430490:Hillsong:-A-Megachur-s01e04>
Library: Docuseries & Reality
URL: https://app.plex.tv/desktop/#!/server/07c3b0207280454ebf1b078276a94e75588392d3/details?key=/library/metadata/430490
Title: Hillsong: The Newest Revelations 
Media.Duration: 00:43:10
Media.Type: 'episode'
Media.Guid: 'local://430490'
Audio: 'stereo', 'English (AAC Stereo)'
Video: 'h264'
Subtitles:
  Subtitle 1: (Svenska) None (codec: srt, selected: False, transient: None)
  Subtitle 2: (norsk bokmål) None (codec: srt, selected: False, transient: None)
  Subtitle 3: (Dansk) None (codec: srt, selected: False, transient: None)
  Subtitle 4: (Suomi) None (codec: srt, selected: False, transient: None)
Parts:
  Part 1: /Volumes/Media/Docuseries/Hillsong - A Megachurch Exposed (2022)/Hillsong - A Megachurch Exposed - S01E04 - Hillsong - The Newest Revelations [WEBDL-1080p] [8bit]  
[AAC-2.0] B2B.mkv
Guids:
  Guid: <PlexGuid:local://430490>, Id: 430490, Provider: 'local'
Metadata: {'collected_at': '2022-12-31:T19:35:02.000Z', 'media_type': 'digital', 'resolution': 'hd_1080p', 'audio': 'aac', 'audio_channels': '2.0'}
[2023-01-07 16:25:10] WARNING  <Episode:430490:Hillsong:-A-Megachur-s01e04>: Skipping <PlexGuid:local://430490> because provider local has no external Id                       
Trakt: No match found

Workarounds

No idea how to fix this, aside from skipping the library altogether (which isn't ideal).

Install method

pipx

Config file contents

cache:
  path: /Users/gecko/Library/Caches/PlexTraktSync/trakt_cache
excluded-libraries:
- Clips
- Fitness
- Music
- Music Videos
- Wrestling
config:
  dotenv_override: true
plex:
  timeout: 90
logging:
  append: false
  console_time: true
  debug: true
  filename: plextraktsync.log
  filter: null
sync:
  plex_to_trakt:
    collection: true
    ratings: true
    watched_status: true
    watchlist: true
  trakt_to_plex:
    liked_lists: false
    ratings: true
    watched_status: true
    watchlist: false
    watchlist_as_playlist: false
watch:
  add_collection: false
  remove_collection: false
  scrobble_threshold: 80
  username_filter: true
xbmc-providers:
  movies: imdb
  shows: tvdb

Version

0.25.3

Python Version

3.10.7

Operating System and Version

macOS-13.1

I don't think the problem is with id 430490, but rather the next one which is not displayed.

you can verify this with:

plextraktsync sync --id=430490

and I'm, sure, it will pass.

you can enable debug logging and then maybe find next id after 430490 that is really causing the trouble.

unclear what you ran. show command and output. also, it may be you have wrong log location, plextraktsync info shows log location.

The error in the bug report body is from PlexApi Show.season() called without parameters:

But the error is from PTS _get_episodes():

I don't see how these two connect. something very odd is happening.

you could try modify source code and run sync and then the error trace would be more useful

--- a/plextraktsync/plex/PlexLibraryItem.py
+++ b/plextraktsync/plex/PlexLibraryItem.py
@@ -257,7 +258,11 @@ def episodes(self):

     @retry()
     def _get_episodes(self):
-        return self.item.episodes()
+        try:
+            return self.item.episodes()
+        except Exception as e:
+            print(f"episode from show {type(self.item)}: {self.item}")
+            raise e

     @cached_property
     def season_number(self):
(END)

Ok, well it looks like the error causing it to abort is no longer happening — whatever it was, it resolved itself.

The only issue I'm still seeing is the "Skipping PlexGuid:local://_____ because provider local has no external Id." What causes episodes to be "local?"

Guid "local://" means that it has no match. try "FIx Match" for the Show.

You can do plextraktsync inspect ID to find the item from plex web.

It takes some time for Plex to change local:// to something else, verify with plextraktsync inspect again and see if guid changed.

ps: inspect can also take URL of plex web not just id, may be useful to do inspect of item from plex web.