yea, I had forgotten to update all the files last time I updated the code. Get a fresh copy and try again please :)
I downloaded a fresh copy of the master ZIP file, installed and re-tested. I still get the same Terminating Plex Media Tagger message once I have selected any video from the 0.Movies list the tool interogates. I took a quick look at the Python source code and note that you are using the logger facilitiy in the code for debugging. I checked my /var/log/system.log but couldn't see any messages from the tool. Do I need to enable something for the logging to work? I am on OS X 10.7.2 with Python 2.6 (system) and 2.7.1 (installed in /usr/bin) - both versions result in the same error.
So the logging you see references to is actually what is printing out to the console, just in different color :)
To turn on debug "logging" you would add "-vv" to your command.
Now, as to why it didn't run, I had added the files to my local repository but not pushed the changes. In other words, I just wasted your time by having you redownload as you really just downloaded the same thing again. So once more (fingers crossed this time), download the code and try again. This time I even double checked by getting a fresh copy myself from github to make sure that I had gotten all the changes up there :)
Oh OK -vv good to know.
Also, re-downloaed and 3rd time lucky, its now working. Many thanks.
awesome! sorry about all the issues, but I am glad to hear it’s working now.
Let me know if you run into any other issues, or if you think of any features that could/should be added 
Made some minor updates to the script:
[list]
[]If the comment tag data (contains rating, play count, etc) has been updated by iTunes and the play count is higher (especially relevant for items that have gone through view count 0 to 1 (ie. watched)), it is transferred over when tag data is re-written.
[]If the prefer season artwork flag is supplied, but no season artwork is available, it will fallback to the show artwork.
[/list]
I am a newbie (especially in Python)but I have an invalid error syntax message when executing (or just checking) plexmediatagger.py --subtitles. The error message is pointing at the last line of the code below
#ask user what sections should be processed
section_element_choice = raw_input(“Section to process $”)
if section_element_choice != ‘’:
try:
section_element_choice = int(section_element_choice)
except ValueError, e:
I have downloaded the last version of the PlexMediaTagger project and I am using Python IDLE 3.2.2 on win7
Ignore my previous message I can execute the module fine with Python 2.7
cool, glad it works 
Heya! I’m curious as to how exactly I need to use this command. I open up my Terminal in 10.7.3, I type “python plexmediatagger.py --tag” and everything goes swimmingly. I get to a menu item where I can select a specific episode of a show (of which there is both an .mkv and an .mp4 file in the Plex episode folder. At this point, the command doesn’t seem to recognize that there is an .mp4 file to be tagged and gives me an error message saying that it cannot tag an .mkv file. But the .mp4 file is in the same folder! Any ideas? Am I doing this incorrectly?
Thanks for your help!
Hey,
No, you are doing everything correctly. It’s just that the script at the moment is a bit simple in that respect, so it only looks at the first file (which in your example is an mkv), and never even looks at the second one. I personally have none of those, therefore not something I have prepared the tool for. I see how hard that would be to do and let you know here if I get it working. If you want it to work right away, the easiest way would be to move the mkv file somewhere else, and then have plex do a rescan of that section, then empty the trash (this will clear away the reference to the mkv file) and then the tool should work fine, because then there will only be a single file for that media item. Then later on you could move the mkv back.
Or, you can just wait for me to fix the script. I’ll probably get it fixed within a few days!
Hi,
When I run this tool in batch mode, after ~20 operations it outputs this error and terminates:
Traceback (most recent call last):<br />
File "/usr/local/PlexMediaTagger/plexmediatagger.py", line 212, in <module><br />
sys.exit(main())<br />
File "/usr/local/PlexMediaTagger/plexmediatagger.py", line 172, in main<br />
section_processor.process_section(section_element)<br />
File "/usr/local/PlexMediaTagger/SectionProcessor.py", line 34, in process_section<br />
self.process_movie_section_element(section_element)<br />
File "/usr/local/PlexMediaTagger/SectionProcessor.py", line 126, in process_movie_section_element<br />
threading.Thread(None, self.process_video(full_movie_item)).start()<br />
File "/usr/local/PlexMediaTagger/SectionProcessor.py", line 183, in process_video<br />
video_item_processor.process()<br />
File "/usr/local/PlexMediaTagger/VideoItemProcessor.py", line 311, in process<br />
self.optimize(part_item)<br />
File "/usr/local/PlexMediaTagger/VideoItemProcessor.py", line 208, in optimize<br />
success = self.execute_command(filepath, optimize_cmd, action_description)<br />
File "/usr/local/PlexMediaTagger/VideoItemProcessor.py", line 119, in execute_command<br />
result = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, preexec_fn = self.preexec).communicate()[0]<br />
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__<br />
errread, errwrite)<br />
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child<br />
raise child_exception<br />
OSError: [Errno 1] Operation not permitted<br />
Thanks!
ArmanUV, could you try adding “-vv” to the command that you run and show me the output? Would also be helpful to see what the full command you are running is/was.
brooklynfall, I have made some changes to the code so it should be able to handle cases both where you have multiple versions of the movie (like you’re case with the mp4 and mkv), as well as the one where you have the “file - cd1.avi” and “file - cd2.avi”.
Give it a run for its money and let me know if you have any problems!
Just updated the code again. Added the ‘–tag-update’ option which allows you to optionally update previously tagged files.
Also added ‘–batch-mediatype=[movie/show]’ and ‘–batch-breadcrumb=breadcrumb’ which allow you to perform batch operations without having it process every file in every section (see examples in the help output of the app to see how to use these batch options).
Another update.
Added ‘add to itunes’ function that will add a media item to your itunes library (if not already present) using applescript, and then add in the additional metadata that cannot be embedded in the file itself afterwards (saves you having to use the ‘Recover Tag Data from Comment’ applescript that is also in the github repo).
sounds awesome. I dont actually use itunes or anything like that but i can fully appreciate the convienience/coolness of it.
yea, most of the recent features have been added because I was finding that I would add a new movie, I would want to get it tagged, then added to iTunes. So now I can use the batch mode with the batch breadcrumb and add to itunes to tag that single file without having to “interactively” navigate the plex sections, and then afterwards find the file in finder and add it to iTunes, then restore the metadata using the applescript.
Thanks for the support 
I get an error when I try to extract the subtitle for season 2 of Battlestar Galactica:
<br />
processing 1/20 episodes : Battlestar Galactica (2003) (2003) - S02E01 - Scattered ------------------------------------------------------------------------<br />
processing 1/2 media_items<br />
processing 1/1 part_items<br />
attempting to export subtitles...<br />
found 1 subtitle(s)<br />
Traceback (most recent call last):<br />
File "./plexmediatagger.py", line 260, in <module><br />
sys.exit(main())<br />
File "./plexmediatagger.py", line 221, in main<br />
section_processor.process_section(section_element)<br />
File "/Users/plex/Downloads/ccjensen-PlexMediaTagger-13e86a2/SectionProcessor.py", line 43, in process_section<br />
self.process_show_section_element(section_element)<br />
File "/Users/plex/Downloads/ccjensen-PlexMediaTagger-13e86a2/SectionProcessor.py", line 166, in process_show_section_element<br />
self.process_season_section_element(show_item)<br />
File "/Users/plex/Downloads/ccjensen-PlexMediaTagger-13e86a2/SectionProcessor.py", line 180, in process_season_section_element<br />
self.process_episode_section_element(season_item)<br />
File "/Users/plex/Downloads/ccjensen-PlexMediaTagger-13e86a2/SectionProcessor.py", line 198, in process_episode_section_element<br />
threading.Thread(None, self.process_video(full_episode_item)).start()<br />
File "/Users/plex/Downloads/ccjensen-PlexMediaTagger-13e86a2/SectionProcessor.py", line 207, in process_video<br />
video_item_processor.process()<br />
File "/Users/plex/Downloads/ccjensen-PlexMediaTagger-13e86a2/VideoItemProcessor.py", line 383, in process<br />
self.export_resources(part_item)<br />
File "/Users/plex/Downloads/ccjensen-PlexMediaTagger-13e86a2/VideoItemProcessor.py", line 270, in export_resources<br />
if len(glob.glob(glob_str)) > 0:<br />
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/glob.py", line 16, in glob<br />
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/glob.py", line 30, in iglob<br />
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/glob.py", line 61, in glob1<br />
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/fnmatch.py", line 47, in filter<br />
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/re.py", line 188, in compile<br />
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/re.py", line 243, in _compile<br />
sre_constants.error: bad character range<br />
It worked fine for season 1, and for many other series. So I assume it has to do with one or two of the episodes in Season 2. When I check the folder I can see that there is a subtitle file next to every episode already. I do not know if they where there before, or if the script did finish it even though I got the above error.
The files are named with some special chars, so maybe that is causing this. One episode that I think has the most possibility to be causing issues is this one: battlestar_galactica.s02e19-e20.Lay_Down_Your_Burdens[hr-hdtv-x264].mkv
Hmm, I got another error halfway through season 2 of Better off Ted:
<br />
processing 4/11 episodes : Better Off Ted (2009) - S02E04 - It's Nothing Business, It's Just Personal -----------------------------------------------------<br />
processing 1/1 media_items<br />
processing 1/1 part_items<br />
attempting to export subtitles...<br />
found 2 subtitle(s)<br />
downloading Better.Off.Ted.S02E04.Its.Nothing.Business.Its.Just.Personal.720p.WEB-DL.DD5.1.h.264.eng.srt<br />
downloading 0bbf3ee4963bb5847adb15c9e51460b8bee0cd46<br />
Traceback (most recent call last):<br />
File "./plexmediatagger.py", line 260, in <module><br />
sys.exit(main())<br />
File "./plexmediatagger.py", line 221, in main<br />
section_processor.process_section(section_element)<br />
File "/Users/plex/Downloads/ccjensen-PlexMediaTagger-13e86a2/SectionProcessor.py", line 43, in process_section<br />
self.process_show_section_element(section_element)<br />
File "/Users/plex/Downloads/ccjensen-PlexMediaTagger-13e86a2/SectionProcessor.py", line 166, in process_show_section_element<br />
self.process_season_section_element(show_item)<br />
File "/Users/plex/Downloads/ccjensen-PlexMediaTagger-13e86a2/SectionProcessor.py", line 180, in process_season_section_element<br />
self.process_episode_section_element(season_item)<br />
File "/Users/plex/Downloads/ccjensen-PlexMediaTagger-13e86a2/SectionProcessor.py", line 198, in process_episode_section_element<br />
threading.Thread(None, self.process_video(full_episode_item)).start()<br />
File "/Users/plex/Downloads/ccjensen-PlexMediaTagger-13e86a2/SectionProcessor.py", line 207, in process_video<br />
video_item_processor.process()<br />
File "/Users/plex/Downloads/ccjensen-PlexMediaTagger-13e86a2/VideoItemProcessor.py", line 383, in process<br />
self.export_resources(part_item)<br />
File "/Users/plex/Downloads/ccjensen-PlexMediaTagger-13e86a2/VideoItemProcessor.py", line 284, in export_resources<br />
success = subtitle.export_to_path(subtitle_full_path)<br />
File "/Users/plex/Downloads/ccjensen-PlexMediaTagger-13e86a2/Items/StreamItem.py", line 47, in export_to_path<br />
return request_handler.download_stream(path, self.key)<br />
File "/Users/plex/Downloads/ccjensen-PlexMediaTagger-13e86a2/PmsRequestHandler.py", line 100, in download_stream<br />
with open(destination_path, "wb") as local_file:<br />
IOError: [Errno 2] No such file or directory: u'/Volumes/Media/TV/Better off Ted/Season 2/Better.Off.Ted.S02E04.Its.Nothing.Business.Its.Just.Personal.720p.WEB-DL.DD5.1.h.264.eng.net/en/ppodnapisi/download/i/670166/k/0bbf3ee4963bb5847adb15c9e51460b8bee0cd46'<br />
<br />
The last line in that error seems to indicate that a bundle is missing, or am I reading it wrong?