ccjensen / PlexMediaTagger

Uses the metadata held in the PlexMediaServer to tag media files
148 stars 17 forks source link

Problem with german special characters #20

Open Tigrecito opened 4 years ago

Tigrecito commented 4 years ago

hi,

in the current version there is a bug, when title/filename has a german special character (e.g. "ü") I checked with an older version (version 0.7) and it works like it should! (edit: I run the mediatagger from macos high sierra)

here is the error:

processing 3/1071 movies : 3 Türken und ein Baby (2015) -------------------------------------------------------------------------- processing 1/1 media_items processing 1/1 part_items tagging... 'Tags added and optimized': '/Volumes/media/Media Plex/Filme/3 Türken und ein Baby (2015) - 1080p.mp4' Traceback (most recent call last): File "/Users/admin/Downloads/PlexMediaTagger/plexmediatagger.py", line 297, in sys.exit(main()) File "/Users/admin/Downloads/PlexMediaTagger/plexmediatagger.py", line 254, in main section_processor.process_section(section_element) File "/Users/admin/Downloads/PlexMediaTagger/SectionProcessor.py", line 38, in process_section self.process_movie_section_element(section_element) File "/Users/admin/Downloads/PlexMediaTagger/SectionProcessor.py", line 150, in process_movie_section_element threading.Thread(None, self.process_video(full_movie_item)).start() File "/Users/admin/Downloads/PlexMediaTagger/SectionProcessor.py", line 205, in process_video video_item_processor.process() File "/Users/admin/Downloads/PlexMediaTagger/VideoItemProcessor.py", line 411, in process self.tag(part_item) File "/Users/admin/Downloads/PlexMediaTagger/VideoItemProcessor.py", line 219, in tag shutil.move(tmp_filepath, filepath) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 325, in move copy2(src, real_dst) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 153, in copy2 copyfile(src, dst) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 96, in copyfile with open(src, 'rb') as fsrc: IOError: [Errno 2] No such file or directory: u'/Volumes/media/Media Plex/Filme/3 T\xfcrken und ein Baby (2015) - 1080p.mp4_tmp'

ccjensen commented 4 years ago

Pull requests are most welcome if you feel so inclined. Otherwise could you reproduce again but add “-vvv” to the invocation so we get verbose logs?

Tigrecito commented 4 years ago

hi,

here the output with -vvv:

processing 3/1071 movies : 3 Türken und ein Baby (2015) -------------------------------------------------------------------------- processing 1/1 media_items processing 1/1 part_items original path /Volumes/media/Media Plex/Filme/3 Türken und ein Baby (2015) - 1080p.mp4 modified path /Volumes/media/Media Plex/Filme/3 Türken und ein Baby (2015) - 1080p.mp4 File untagged original path /Volumes/media/Media Plex/Filme/3 Türken und ein Baby (2015) - 1080p.mp4 modified path /Volumes/media/Media Plex/Filme/3 Türken und ein Baby (2015) - 1080p.mp4 tagging... Downloading artwork... 'Tags added and optimized' arguments: ['/Users/admin/Downloads/PlexMediaTagger/SublerCLI', '-optimize', '-metadata', u'{Comments:I_T_U_N_E_S::::R_59::::PC_0::::D_1580944182}{Cover Art:/tmp/3 T\xfcrken und ein Baby (2015)}{Media Kind:9}{Name:3 T\xfcrken und ein Baby}{Artist:Sinan Akku\u015f}{Genre:Comedy}{Release Date:2015-01-22}{Description:Drei Jungs, ein Baby und jede Menge Stress}{Long Description:Die drei Br\xfcder Celal, Sami und Mesut leben mit \xfcber Drei\xdfig noch immer zusammen in der Frankfurter Wohnung ihrer Eltern, k\xf6nnten jedoch unterschiedlicher kaum sein: W\xe4hrend Frauenheld Celal immer noch versucht, \xfcber die Trennung von seiner Ex-Freundin Anna hinwegzukommen, hat der cholerische Sami \xfcberhaupt kein Gl\xfcck in der Liebe und versaut sich jedes Date mit seinen unkontrollierten Wutattacken. Indes wartet der j\xfcngste Bruder, Mesut, immer noch auf seinen erhofften Durchbruch als Musiker. Zu allem \xdcberfluss l\xe4uft auch ihr geerbtes Brautmodengesch\xe4ft richtig mies und steht kurz vor der Schlie\xdfung. Als sie sich dann auch noch um Annas Baby k\xfcmmern sollen, weil diese nach einem Unfall im Krankenhaus liegt, st\xfcrzt das Leben der Br\xfcder v\xf6llig ins Chaos \u2013 doch dann stellen sie fest, dass so ein Baby auch ein Segen sein kann, denn das kleine M\xe4dchen bringt einigen frischen Wind in ihr Leben\u2026}{Rating:de/12}{Cast:Kostja Ullmann, Alexander Beyer, Frederick Lau, Anna B\xf6ger, Julia Thurnau, Christoph Maria Herbst, Axel Stein, Jytte-Merle B\xf6hrnsen, Jacob Matschenz, Joyce Ilg, Eko Fresh, Prashant Prabhakar, Kida Khodr Ramadan, Dieter Rupp, Rainer Ewerrien, Bodo Bach, Stefan Lampadius, Sami Nasser, Mario Michael Rosko, Sabrina Kl\xfcber, Kayla Rybicka, Emrah Erdogru, Tim Grothe, H\xfclya Duyar, Sabine Wackernagel, Eva Marianne Kraiss, Nicole Vosahlo, Mina Akkus, Anton Weber, Stojan Petrov, Marco Wohlwend, Pia Sarpei, Joanna Bielinski, Peter Fadl, Celine Schmitt, Louise Schmitt, Stefanie Antonia Wermeling, Simon Desue, Kerstin Thielemann, Dagmar von Kurmin, Hans Sarpei, Margit Lieverz, J\xf6rg Sch\xe4fer, Sinan Akku\u015f, Celo, Abdi, Stephan Becker, Sharon Adams, Thania Rodriguez, Frank W. Rima}{Director:Sinan Akku\u015f}{Screenwriters:Sinan Akku\u015f}{Studio:Egoli Tossell Film}{HD Video:1}', '-source', u'/Volumes/media/Media Plex/Filme/3 T\xfcrken und ein Baby (2015) - 1080p.mp4', '-destination', u'/Volumes/media/Media Plex/Filme/3 T\xfcrken und ein Baby (2015) - 1080p.mp4_tmp'] 'Tags added and optimized': '/Volumes/media/Media Plex/Filme/3 Türken und ein Baby (2015) - 1080p.mp4' Replacing old file with tagged one... Traceback (most recent call last): File "/Users/admin/Downloads/PlexMediaTagger/plexmediatagger.py", line 297, in sys.exit(main()) File "/Users/admin/Downloads/PlexMediaTagger/plexmediatagger.py", line 254, in main section_processor.process_section(section_element) File "/Users/admin/Downloads/PlexMediaTagger/SectionProcessor.py", line 38, in process_section self.process_movie_section_element(section_element) File "/Users/admin/Downloads/PlexMediaTagger/SectionProcessor.py", line 150, in process_movie_section_element threading.Thread(None, self.process_video(full_movie_item)).start() File "/Users/admin/Downloads/PlexMediaTagger/SectionProcessor.py", line 205, in process_video video_item_processor.process() File "/Users/admin/Downloads/PlexMediaTagger/VideoItemProcessor.py", line 411, in process self.tag(part_item) File "/Users/admin/Downloads/PlexMediaTagger/VideoItemProcessor.py", line 219, in tag shutil.move(tmp_filepath, filepath) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 325, in move copy2(src, real_dst) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 153, in copy2 copyfile(src, dst) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 96, in copyfile with open(src, 'rb') as fsrc: IOError: [Errno 2] No such file or directory: u'/Volumes/media/Media Plex/Filme/3 T\xfcrken und ein Baby (2015) - 1080p.mp4_tmp'

Tigrecito commented 4 years ago

is this enough information for you ?

again with an older version it already works (v0.7) ... only with the current version it doesn´t! Unfortunately I am not able to change your code !

thanks, tig

Tigrecito commented 4 years ago

update: it looks like it works but -d (dry run) doesn´t work .. when I remove the -d switch it works !

Tigrecito commented 4 years ago

Another question: there are 2 temp files written .. first mp4_tmp and afterwards .sublertemp this takes pretty long because the files are on a nas drive .. is there a possibility to only write one temp file? is the second file maybe because of -o (optimize) switch?

thanks ...

ccjensen commented 4 years ago

interesting that it works when doing a non-dry run. Hopefully that'll point me to where it is broken.

As for the temp files, those are an artifact of the underlying tool that I am using to embed the metadata and is something I can't really control so much. It's unfortunate that it does this two pass, but not something I can avoid unfortunately.