Skip to content

Commit

Permalink
Merge pull request #3 from nzbgetcom/feature/manifest
Browse files Browse the repository at this point in the history
- migration from a file header config definition to a manifest.json-based configuration
- works with NZBGet v23 and above
- no longer works with NZBGet v22 and below
  • Loading branch information
dnzbk authored Jan 11, 2024
2 parents 6e8e82e + 9cec01d commit 858f190
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 73 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ jobs:
release:
uses: nzbgetcom/nzbget-extensions/.github/workflows/extension-release.yml@main
with:
release-file-list: EMail.py
release-file-list: main.py manifest.json
release-file-name: email
release-dir: email
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
> **Note:** This script is compatible with NZBGet v23 and above.
For older versions of NZBGet please use [v1.0](https://github.com/nzbgetcom/Extension-EMail/releases/tag/v1.0) release.

# EMail
EMail [script](https://nzbget.com/documentation/post-processing-scripts/) for [NZBGet](https://nzbget.com).

This script sends E-Mail notification when the job is done.

Author: Andrey Prygunkov <hugbug@users.sourceforge.net>

> **Note:** This script is compatible with python 3.8.x and above.
> **Note:** This script requires Python to be installed on your system.
72 changes: 1 addition & 71 deletions EMail.py → main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
#
# E-Mail post-processing script for NZBGet
#
Expand All @@ -15,78 +14,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#


##############################################################################
### NZBGET POST-PROCESSING SCRIPT ###

# Send E-Mail notification.
#
# This script sends E-Mail notification when the job is done.
#
# NOTE: This script requires Python to be installed on your system.

##############################################################################
### OPTIONS ###

# When to send the message (Always, OnFailure).
#SendMail=Always

# Email address you want this email to be sent from.
#From="NZBGet" <myaccount@gmail.com>

# Email address you want this email to be sent to.
#
# Multiple addresses can be separated with comma.
#To=myaccount@gmail.com

# SMTP server host.
#Server=smtp.gmail.com

# SMTP server port (1-65535).
#Port=25

# Secure communication using TLS/SSL (yes, no, force).
# no - plain text communication (insecure);
# yes - switch to secure session using StartTLS command;
# force - start secure session on encrypted socket.
#Encryption=yes

# SMTP server user name, if required.
#Username=myaccount

# SMTP server password, if required.
#Password=mypass

# To check connection parameters click the button.
#ConnectionTest@Send Test E-Mail

# Append statistics to the message (yes, no).
#Statistics=yes

# Append list of files to the message (yes, no).
#
# Add the list of downloaded files (the content of destination directory).
#FileList=yes

# Append broken-log to the message (yes, no).
#
# Add the content of file _brokenlog.txt. This file contains the list of damaged
# files and the result of par-check/repair. For successful downloads the broken-log
# is usually deleted by cleanup-script and therefore is not sent.
#BrokenLog=yes

# Append nzb log to the message (Always, Never, OnFailure).
#
# Add the download and post-processing log of active job.
#NzbLog=OnFailure

### NZBGET POST-PROCESSING SCRIPT ###
##############################################################################


import os
import sys
import datetime
Expand Down
131 changes: 131 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
{
"main": "main.py",
"name": "EMail",
"homepage": "",
"kind": "POST-PROCESSING",
"displayName": "EMail",
"version": "2.0.0",
"author": "Andrey Prygunkov",
"license": "GNU",
"about": "Send E-Mail notification.",
"queueEvents": "",
"requirements": [
"This script requires Python to be installed on your system."
],
"description": ["This script sends E-Mail notification when the job is done."],
"options": [
{
"name": "SendMail",
"displayName": "SendMail",
"value": "Always",
"description": ["When to send the message."],
"select": ["Always", "OnFailure"]
},
{
"name": "From",
"displayName": "From",
"value": "\"NZBGet\" <myaccount@gmail.com>",
"description": ["Email address you want this email to be sent from."],
"select": []
},
{
"name": "To",
"displayName": "To",
"value": "myaccount@gmail.com",
"description": [
"Email address you want this email to be sent to.",
"",
"Multiple addresses can be separated with comma."
],
"select": []
},
{
"name": "Server",
"displayName": "Server",
"value": "smtp.gmail.com",
"description": ["SMTP server host."],
"select": []
},
{
"name": "Port",
"displayName": "Port",
"value": 25,
"description": ["SMTP server port (1-65535)"],
"select": [1, 65535]
},
{
"name": "Encryption",
"displayName": "Encryption",
"value": "yes",
"description": [
"Secure communication using TLS/SSL.",
"",
"no - plain text communication (insecure);",
"yes - switch to secure session using StartTLS command;",
"force - start secure session on encrypted socket."
],
"select": ["no", "yes", "force"]
},
{
"name": "Username",
"displayName": "Username",
"value": "yes",
"description": ["SMTP server user name, if required."],
"select": []
},
{
"name": "Password",
"displayName": "Password",
"value": "mypass",
"description": ["SMTP server password, if required."],
"select": []
},
{
"name": "Statistics",
"displayName": "Statistics",
"value": "yes",
"description": ["Append statistics to the message."],
"select": ["yes", "no"]
},
{
"name": "FileList",
"displayName": "FileList",
"value": "yes",
"description": [
"Append list of files to the message.",
"",
"Add the list of downloaded files (the content of destination directory).."
],
"select": ["yes", "no"]
},
{
"name": "BrokenLog",
"displayName": "BrokenLog",
"value": "yes",
"description": [
"Append broken-log to the message.",
"",
"Add the content of file _brokenlog.txt. This file contains the list of damaged",
"files and the result of par-check/repair. For successful downloads the broken-log",
"is usually deleted by cleanup-script and therefore is not sent."
],
"select": ["yes", "no"]
},
{
"name": "NzbLog",
"displayName": "NzbLog",
"value": "OnFailure",
"description": ["Append nzb log to the message.Add the download and post-processing log of active job.."],
"select": ["Always", "Never", "OnFailure"]
}
],
"commands": [
{
"name": "ConnectionTest",
"action": "Send Test E-Mail",
"displayName": "ConnectionTest",
"description": ["To check connection parameters click the button."]
}
],
"taskTime": ""
}

0 comments on commit 858f190

Please sign in to comment.