jakewaldron / PlexEmail

This script aggregates all new TV, movie and music releases for the past configured time then optionally writes to your web directory and sends out an email.
206 stars 32 forks source link

Special Apostrophes from Mac OS X servers break code #25

Closed justinrhodes closed 8 years ago

justinrhodes commented 8 years ago

When someone has a server called "John's iMac" after setting up Plex on an OS X Machine, that special apostrophe for the default name is breaking the XML import for getting users emails.

The apostrophe is unicode character \u2019.

Is there anyway to add some removal tool before importing and parsing the XML? The only workaround I have had right now is removing those user's servers from my list....or asking them to change the name of their server.

jakewaldron commented 8 years ago

This should be fixed as of v0.7.1. Are you seeing this issue in the current version?

justinrhodes commented 8 years ago

I'm running this in a docker. (https://hub.docker.com/r/linuxserver/plexemail/)

What is the best way to check version number?

jakewaldron commented 8 years ago

I'm not familiar with how dockers work, so I'm not sure how to verify the version you are running. However if you can attach the plexEmail.py file I can take a look to see if it has the fix in it.

justinrhodes commented 8 years ago

plexemail.txt

jakewaldron commented 8 years ago

Looks like it is updated with the latest script file. I took a closer look and it looks like the fix in v0.7.1 had been removed in a later release. I just checked in a new version that has the fix back in. The docker doc says that it should update on restart of the docker. Could you try updating and running the latest?

Otherwise, if that doesn't work, you can fix it by replacing line 298 in that file (parsed = XML(response.text)) with:

parsed = XML(response.text.encode('ascii', 'ignore'))

justinrhodes commented 8 years ago

Pulling the latest version on a docker restart grabbed the correct version. Sorry for the confusion, I had no idea it was already patched ;)