PlexEmail - Email Recently Added Media

v0.5.2 Released

 

New Features

  • The images and titles are now hyperlinks to the Plex Web page.
  • If there is a real duration, we will use that instead of the duration from the metadata agents.

New relevant field in the config file: filter_include_plex_web_link (defaults to True)

Okay, just tried this out, but the links in the email unfortunately don't work. I correctly connects to my server on plex.tv, but every title or episode I click leads me to a "not found" page. Specifically, "You must be lost. This page doesn't exist". Any ideas why?

v0.5.2 Released

 

New Features

  • The images and titles are now hyperlinks to the Plex Web page.
  • If there is a real duration, we will use that instead of the duration from the metadata agents.

New relevant field in the config file: filter_include_plex_web_link (defaults to True)

...There's also a "plexemail.zip" file in the scripts folder of the archive, which contains a (different?) copy of plexemail.py...

Okay, just tried this out, but the links in the email unfortunately don't work. I correctly connects to my server on plex.tv, but every title or episode I click leads me to a "not found" page. Specifically, "You must be lost. This page doesn't exist". Any ideas why?

Hmm.  Could you send me the link it tries to open to see if there is something wrong with the creation of it?  Mine looks like this:

http://plex.tv/web/app#!/server/6ecf4de03b64234a0419811c939d043632f384b5/details/%2Flibrary%2Fmetadata%2F22323

...There's also a "plexemail.zip" file in the scripts folder of the archive, which contains a (different?) copy of plexemail.py...

Oops, that was probably from me zipping up a copy to troubleshoot an issue.

Hmm.  Could you send me the link it tries to open to see if there is something wrong with the creation of it?  Mine looks like this:

http://plex.tv/web/app#!/server/6ecf4de03b64234a0419811c939d043632f384b5/details/%2Flibrary%2Fmetadata%2F22323

Yeah, same. I get the same results if I click your link and mine.

http://plex.tv/web/app#!/server/005d4c53f58fd25e011b5ca402357f14ec55971e/details//library/metadata/173733

It is generating valid links for me

Eadwyn's link gets me 'Media server not found' naturally as I don't have access to it. But tycho's link does give me the "you must be lost" page.

I'm not sure what exactly is happening, could you try something?  First what browser are you using?  Secondly, try the following:

Try replacing the "/" with "%2F" after details/

i.e.: http://plex.tv/web/app#!/server/005d4c53f58fd25e011b5ca402357f14ec55971e/details/%2Flibrary%2Fmetadata%2F173733

It won't work if they are actual "/" instead of "%2F" even though they mean the same thing after being decoded.

It is generating valid links for me

Glad to hear it's working for some people!

I'm not sure what exactly is happening, could you try something?  First what browser are you using?  Secondly, try the following:

Try replacing the "/" with "%2F" after details/

i.e.: http://plex.tv/web/app#!/server/005d4c53f58fd25e011b5ca402357f14ec55971e/details/%2Flibrary%2Fmetadata%2F173733

It won't work if they are actual "/" instead of "%2F" even though they mean the same thing after being decoded.

This is what I get when I click your original link, my generated link, and your new updated link:

Capture.PNG

This is what I get when I click your original link, my generated link, and your new updated link:

Ok and does the URL in the address bar have the %2F strings in it?  I'm trying to determine if there is an issue with the URL or something else.  Could you also manually navigate to a movie/show and give me the link?  Maybe I need to handle a different case.

Ok and does the URL in the address bar have the %2F strings in it?  I'm trying to determine if there is an issue with the URL or something else.  Could you also manually navigate to a movie/show and give me the link?  Maybe I need to handle a different case.

If I replace the "/" with "%2F", I get the same result. Here are 2 links as they appear on my Firefox address bar for comparison. The first, the email-generated link:

http://plex.tv/web/app#!/server/005d4c53f58fd25e011b5ca402357f14ec55971e/details//library/metadata/173733

This second one is the correct link, navigated to by clicking the home icon for the server, then finding the movie while on plex.tv:

http://plex.tv/web/app#!/server/005d4c53f58fd25e011b5ca402357f14ec55971e/details/%2Flibrary%2Fmetadata%2F173733

It looks like all the backward slashes after "details/" need to be %2F.

Edit: the posted link does not accurately show the correct text string. Here's a screenshot:

Capture2.PNG

If I replace the "/" with "%2F", I get the same result. Here are 2 links as they appear on my Firefox address bar for comparison. The first, the email-generated link:

http://plex.tv/web/app#!/server/005d4c53f58fd25e011b5ca402357f14ec55971e/details//library/metadata/173733

This second one is the correct link, navigated to by clicking the home icon for the server, then finding the movie while on plex.tv:

http://plex.tv/web/app#!/server/005d4c53f58fd25e011b5ca402357f14ec55971e/details/%2Flibrary%2Fmetadata%2F173733

It looks like all the backward slashes after "details/" need to be %2F.

Yeah, they are when the email is sent/web page is created.  Let me download firefox and see if I can reproduce it.  My guess is either the email service or firefox is converting them to the slashes.

EDIT: Yep, it looks like Firefox is converting them.  I'll see what I can do to force Firefox not to do that.

Yeah, they are when the email is sent/web page is created.  Let me download firefox and see if I can reproduce it.  My guess is either the email service or firefox is converting them to the slashes.

EDIT: Yep, it looks like Firefox is converting them.  I'll see what I can do to force Firefox not to do that.

I don't know if it's necessarily a Firefox problem - when I hover over the link in the actual email in Thunderbird, it shows all slashes, and no %2F.

I don't know if it's necessarily a Firefox problem - when I hover over the link in the actual email in Thunderbird, it shows all slashes, and no %2F.

It's a Mozilla problem then :)

This link will probably not work:

http://plex.tv/web/app#!/server/005d4c53f58fd25e011b5ca402357f14ec55971e/details/%2Flibrary%2Fmetadata%2F173733

This one probably will:

http://plex.tv/web/app#!/server/005d4c53f58fd25e011b5ca402357f14ec55971e/details/%252Flibrary%252Fmetadata%252F173733

Right now I can get it working on Firefox and broken on most other browsers or get it working on most browsers but not Firefox.  I'll need to do some more research to see if there is anything I can do to get it working on both.

It's a Mozilla problem then :)

This link will probably not work:

http://plex.tv/web/app#!/server/005d4c53f58fd25e011b5ca402357f14ec55971e/details/%2Flibrary%2Fmetadata%2F173733

This one probably will:

http://plex.tv/web/app#!/server/005d4c53f58fd25e011b5ca402357f14ec55971e/details/%252Flibrary%252Fmetadata%252F173733

Right now I can get it working on Firefox and broken on most other browsers or get it working on most browsers but not Firefox.  I'll need to do some more research to see if there is anything I can do to get it working on both.

You're right about those links. No worry about the Firefox Mozilla issues. It's working except for one feature that you added today, off a request you got today. That's admirable by any metric.

You're right about those links. No worry about the Firefox Mozilla issues. It's working except for one feature that you added today, off a request you got today. That's admirable by any metric.

Still would like to get it working universally :)

Looks like this has been a bug with Mozilla since 2002: https://bugzilla.mozilla.org/show_bug.cgi?id=135309 and https://bugzilla.mozilla.org/show_bug.cgi?id=483304

However since it is low impact and would mess up a lot of other things by fixing they have decided not to fix it.  I'm thinking it is impossible for me to have one link work in all browsers.  The best thing I can come up with right now is provide a link for Mozilla and one for non-Mozilla (but that is insanely clunky).

Still would like to get it working universally :)

Looks like this has been a bug with Mozilla since 2002: https://bugzilla.mozilla.org/show_bug.cgi?id=135309 and https://bugzilla.mozilla.org/show_bug.cgi?id=483304

However since it is low impact and would mess up a lot of other things by fixing they have decided not to fix it.  I'm thinking it is impossible for me to have one link work in all browsers since Plex.  The best thing I can come up with right now is provide a link for Mozilla and one for non-Mozilla (but that is insanely clunky).

I guess it's time to switch to Chrome. Good work on your end, either way - Firefox has some weird issues, and this is one that impacts such a small percentage of people it's not worth trying to resolve...

Still would like to get it working universally :)

Looks like this has been a bug with Mozilla since 2002: https://bugzilla.mozilla.org/show_bug.cgi?id=135309 and https://bugzilla.mozilla.org/show_bug.cgi?id=483304

However since it is low impact and would mess up a lot of other things by fixing they have decided not to fix it.  I'm thinking it is impossible for me to have one link work in all browsers.  The best thing I can come up with right now is provide a link for Mozilla and one for non-Mozilla (but that is insanely clunky).

Maybe there's a plug-in for firefox that addresses this? An add-on of some sort? I don't know what terminology to search for...

Still would like to get it working universally :)

Looks like this has been a bug with Mozilla since 2002: https://bugzilla.mozilla.org/show_bug.cgi?id=135309 and https://bugzilla.mozilla.org/show_bug.cgi?id=483304

However since it is low impact and would mess up a lot of other things by fixing they have decided not to fix it.  I'm thinking it is impossible for me to have one link work in all browsers.  The best thing I can come up with right now is provide a link for Mozilla and one for non-Mozilla (but that is insanely clunky).

Some preliminary searching (all of this reads like klingon to me):

http://www.codingforums.com/javascript-programming/134034-how-prevent-firefox-auto-unescaping-pages-hash.html

http://stackoverflow.com/questions/5797656/is-there-a-way-to-get-firefox-to-not-automatically-url-decode-values-assigned-to

It's not anything I have control over (since I can only send html in emails), although I might be able to put in a fix for the web page portion.  I think it would be possible for an extension to do the correct conversion, but I couldn't find anything already created.  The other option is to get Plex to handle decoded URLs (but that's not very likely :)).

I'm not sure if I'm doing something wrong or if it's stuck or if there's been an error and it hasn't shown yet.

When I run the script, it was saying...

Web page created successfully

Failed to send email

so I edited the email settings (I'm using gmail)

and now it only says "web page created successfully" it doesn't complete or show an error. I also don't get the email and can't try the script again without closing command prompt and relaunching..

Using Windows 8.1 and PlexEmail 5.2

*****Update*****

It finally came back as failed

Is there something wrong with my email settings?

##Email
email_enabled = True
email_individually = False
# ['email1@gmail.com', 'email2@hotmail.com']
email_to = ['email@gmail.com']
email_from = 'email@gmail.com'
email_from_name = 'SKYNET'
email_smtp_address = 'smtp.gmail.com'
email_smtp_port = 465
email_username = 'email@gmail.com'
email_password = 'password'
# Only valid if web_enabled = True and upload_use_cloudinary = False
email_use_web_images = True
email_skip_if_no_additions = False