caronc / nzb-notify

Push Notifications to a large number of supported services for NZBGet and SABnzbd (based on Apprise)
GNU General Public License v3.0
129 stars 15 forks source link

[SABnzbd] ModuleNotFoundError Using discord:// destination in SABnzbd #68

Open ceyounger opened 4 years ago

ceyounger commented 4 years ago

:beetle: Describe the bug Updated to the latest Notify.py and sabnzbd-notify.py scripts and getting error thrown in SABnzbd and from CLI when testing.

:bulb: Screenshots and Logs

# python sabnzbd-notify.py complete 'Hello' 'World' discord://XXXXXXX@XXXXXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXXXXXX
Traceback (most recent call last):
  File "/config/scripts/Notify.py", line 174, in <module>
    from nzbget import SCRIPT_MODE
ModuleNotFoundError: No module named 'nzbget' 

:computer: Your System Details:

:crystal_ball: Additional context SABnzbd was throwing errors with the old script as I deleted a Discord Webhook. Took the opportunity to update the script and discovered this error. I'm no coder, but it looks like the check for if we are talking to NZBGet or SABnzbd is happening after module import. But, again, I'm talking out my a$$ here.

ceyounger commented 4 years ago

running pip install pynzbget inside the container solves this issue.

Docker images need to be updated.

Closing this issue as it's not a problem with the script.

IIIdefconIII commented 1 year ago

Related: https://github.com/hotio/sabnzbd/issues/17

Error on both linuxserver and hotio: notify;py: Script gaf code 127 en resultaat 'env: ‘python\r’: No such file or directory env: use -[v]S to pass options in shebang lines '

Error on hotio only: sabnzb-nodtify: Script gaf code 1 en resultaat 'Traceback (most recent call last): File "/config/scripts/Notify.py", line 174, in from nzbget import SCRIPT_MODE ModuleNotFoundError: No module named 'nzbget' '

caronc commented 1 year ago

I can tell you that it is not a bug with this script which hasn't seen an update in years. Likely the Docker container yours using has been recently rebuilt and there is an issue with the python libraries within it.

I do know that env isn't used as much anymore. One thing i could do is update the first line of the script to be #!/usr/bin/python3 which may resolve your issue (but the container you use would have to be rebuilt again).

Not sure if there are still Python 2 users, this would definitely break for them if I did this.

IIIdefconIII commented 1 year ago

@caronc Thanks for the fast reply, i also made a post on hotios page. He might fix it meanwhile. ill report back once i get a update on this, when i wanne test it should i also uncomment #? so change the first line from:

!/usr/bin/env python

to !/usr/bin/env python3 ?

caronc commented 1 year ago

Change it to #!/usr/bin/python3 (no env reference)

IIIdefconIII commented 1 year ago

Change it to #!/usr/bin/python3 (no env reference)

I changed it to #!/usr/bin/python3 im now getting another error: Script gaf code -1 en resultaat 'None' Translated: Script gave code -1 and result 'None' Still using the official image

IIIdefconIII commented 1 year ago

just use notifiarr for this, no scripts neeedit

caronc commented 1 year ago

The problem isn't with the script; you proved this by changing the header of it before I did and it didn't help. There is an issue with the container your pulling down (or some change that has been applied to it afterwards).

I'm not quite sure what you mean by saying "use notifiarr for this", but if another tool solves your issue, that's actually great news! 🚀