-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plexmediatagger.py command fails : traceback - KeyError: 'size' #23
Comments
Haven't used the tool in a while, but I'll take a look. Maybe something change in the json |
hmmm, this does not reproduce with my set up, though I am running logging.debug( "foobar part_element %s" % self.part_element.attrib ) to make it be: <…>
self.duration = self.part_element.get('duration', "")
logging.debug( "foobar part_element %s" % self.part_element.attrib )
self.size = self.part_element.attrib['size']
<…> and then re-run |
Thank you for the follow up. I applied the logging syntax you requested. I also scaled back the media library to a single file instead of the full library of content (~700 films) and the command does actually seem to run & complete with just a single title. If I add back in the full film library though, the routine starts crashing again. 1 Film in library output: Full media library processing output: truncating the list of files that are read in from the plex media library foobar part_element {'audioProfile': 'lc', 'file': '/Users/chris/chris1/media/movies/iTunes/iTunes Media/PLEX-PROCESSING/Le Mans (1971).mp4', 'container': 'mp4', 'has64bitOffsets': '0', 'optimizedForStreaming': '0', 'duration': '6518436', 'key': '/library/parts/6314/1478608836/file.mp4', 'videoProfile': 'main', 'id': '6314', 'size': '638856706'} With the logging enabled, I do see that the routine is halting only partway through the list of media files and is tracebacking upon reading in a title "Léon - The Professional (1994)" (note the accent character on the 'e'). These files were all auto-named based on the data pulled in from TheMovieDB (via the FileBot renaming utility), so that's the syntax I've been respecting since it seems to be best aligned with what plex/jellyfin actually reference in their metadata lookups. Not sure if this character set is perhaps the issue of the size of the list of files. |
it's weird. it's like the result returned from the plex back end is not quite valid. So this entry looks fine:
but this one has less metadata about the item (specifically the
could you try moving that file aside, deleting the entry from plex, updating the library to make sure it is gone, then run the script making sure everything works, and then re-add the file and see if things start failing? If that doesn't fix it, then you must be right and it's something to do with the accented letter |
Sorry for the belated reply - it may take me a day or two to have a chance to circle back to this, but I will definitely try what you mention and respond as soon as I can. I really appreciate the assistance in getting to the bottom of this. |
Just pulled the most recent zip onto a mac system running 10.12.6 (due to compatibility issues with recording hardware it must remain on this rev of OSX). I have plex media server running locally on this host and the plexmediatagger.py connects just fine it seems, but the command fails immediately once it finds the media library and starts processing.
PlexMediaTagger-master chris$ python -V
Python 2.7.10
PlexMediaTagger-master chris$ ./plexmediatagger.py -tfbvv
FORCE MODE ENABLED. THIS WILL BYPASS ANY 'HAS THIS BEEN DONE BEFORE' CHECKS
======================================================================================= Plex Media Tagger Started ========================================================================================
Connecting to PMS at localhost:32400
Get contents: http://localhost:32400/library/sections
Processing sections
Processing section 1/1 : 'Movies' ========================================================================================================================================================================
Get contents: http://localhost:32400/library/sections/1/all
Traceback (most recent call last):
File "./plexmediatagger.py", line 297, in
sys.exit(main())
File "./plexmediatagger.py", line 254, in main
section_processor.process_section(section_element)
File "/Users/chris/Downloads/PlexMediaTagger-master/SectionProcessor.py", line 38, in process_section
self.process_movie_section_element(section_element)
File "/Users/chris/Downloads/PlexMediaTagger-master/SectionProcessor.py", line 141, in process_movie_section_element
selected_movie_items = self.get_selection_for_media_container_element(movies_media_container_element)
File "/Users/chris/Downloads/PlexMediaTagger-master/SectionProcessor.py", line 67, in get_selection_for_media_container_element
list_of_items = [MovieItem(self.opts, item) for item in media_container_element.getchildren()]
File "/Users/chris/Downloads/PlexMediaTagger-master/Items/MovieItem.py", line 17, in init
self.media_items = [MediaItem(self.opts, self, media_element) for media_element in self.video.findall("Media")]
File "/Users/chris/Downloads/PlexMediaTagger-master/Items/MediaItem.py", line 23, in init
self.part_items = [PartItem(self.opts, self, part_element) for part_element in self.media_element.findall("Part")]
File "/Users/chris/Downloads/PlexMediaTagger-master/Items/PartItem.py", line 24, in init
self.size = self.part_element.attrib['size']
KeyError: 'size'
The text was updated successfully, but these errors were encountered: