RickDB / PlexAniSync

Sync Plex anime library to AniList
GNU General Public License v3.0
288 stars 44 forks source link

Incorrect character encoding used for the new yaml custom map file #53

Closed MrDemocracy closed 3 years ago

MrDemocracy commented 3 years ago

After the updates to custom_mappings, some series with special characters in the title doesn't get mapped correctly anymore. For example × (not x) is now turned into × when the custom map file gets imported.

Another thing: would it be hard to add movie/OVA support to the new custom mappings implementation?

reconman commented 3 years ago
  1. Which character encoding do you use for the yaml file?
  2. Which operating system?
  3. OVAs and movies are almost impossible to map. You would have to invest more time into adjusting the mapping than into updating the anilist entry yourself.
MrDemocracy commented 3 years ago

It looks like it's utf-8 I'm using Windows 10 with Python 3.8.3 Ok, guess it'll have to be patient and wait for anidb cross-referencing to be added then. But I wouldn't personally mind having to manually map all my movies since I don't have many in my library.

reconman commented 3 years ago

Was able to reproduce the bug. Windows 1252 encoding is used by default on Windows machines.

Fixed with 86bf54f7f785235431a06daf9b31e6c32f1c5784 in v1.3.8

MrDemocracy commented 3 years ago

Thanks 😄 Can confirm it's working now 👍

MrDemocracy commented 3 years ago

It seems like this issue might have returned:

Uncaught exception: Traceback (most recent call last):
    File "plexpy\logger.py", line 405, in new_run
    File "threading.py", line 870, in run
    File "plexpy\notifiers.py", line 2922, in run_script
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd7 in position 4891: invalid continuation byte

The 0xd7 byte is the × character. However, it does looks like episodes are being synced like they're supposed to, but it's still giving that uncaught exception in the Tautulli logs. I'm on version 1.3.13 judging by what it says it in PlexAniSync.py.

reconman commented 3 years ago

Check the encoding of your file again. It's not UTF-8.

MrDemocracy commented 3 years ago

It is utf-8 according to some encoding detection website I found. I just tried saving the custom_mappings.yaml file again as utf-8 with notepad, but I still get the same exception when I try play an episode on plex.

reconman commented 3 years ago

Seems like Tautulli can't handle the character, here's the file: https://github.com/Tautulli/Tautulli/blob/master/plexpy/logger.py

MrDemocracy commented 3 years ago

Oh, guess I'll try opening an issue there then. Thank you for looking into it :)