DobyTang / LazyLibrarian

This project isn't finished yet. Goal is to create a SickBeard, CouchPotato, Headphones-like application for ebooks. Headphones is used as a base, so there are still a lot of references to it.
732 stars 71 forks source link

Custom Notifications #1579

Closed WillowMist closed 6 years ago

WillowMist commented 6 years ago

Have the parameters that get sent out to custom notification scripts changed recently? I have a script that used to watch for DownloadID, but it's no longer picking that up from LazyLibrarian.

philborman commented 6 years ago

Yes there was a bug introduced a few days ago as part of getting the scripts to run under windows. Fixed a few hours ago, I think, an upgrade to latest should solve it. If not, let me know...

WillowMist commented 6 years ago

Unfortunately not. I am updated to the newest philborman release, and I'm getting an "unterminated quoted string" error from the script.

I added some logging to custom_notify.py, and see that ' '.join(params) is creating a string of params that looks like this (this is taken from the middle):

BookPub Hazelden Publishing & Educational Services BookDesc Cynicism and black humor underscore

WillowMist commented 6 years ago

NZBDate, BookPub, NZBDate, BookDesc, and NZBtitle can all have spaces in them and appear to break the parameters list.

philborman commented 6 years ago

Ok I will revert the changes until we can fix it properly. The original problem is windows not recognizing the scripts as executable so we currently run the scripts via the shell, which doesn't like spaces in parameters. Fun.

WillowMist commented 6 years ago

Just a thought... Windows based Sonarr and Radarr set environment variables before they call custom scripts. That might be a way around the problem.

philborman commented 6 years ago

Should be fixed now, but I had to add a special case for python scripts on windows. You can write the external scripts in any language you like for linux, but windows doesn't natively recognise python scripts as executable. I will have a look at Sonarr to see what they do, but it's not written in python so might not help.