Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Commit

Permalink
#452, #453: proper URL encoding in example pp-scripts
Browse files Browse the repository at this point in the history
Updated scripts to accept special characters in nzbget password and username.
  • Loading branch information
BernCarney authored and hugbug committed Oct 5, 2017
1 parent 4fa3706 commit a975025
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions scripts/EMail.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@
import sys
import datetime
import smtplib
from urllib2 import quote

from email.mime.text import MIMEText
try:
from xmlrpclib import ServerProxy # python 2
Expand Down Expand Up @@ -167,8 +169,8 @@

if host == '0.0.0.0': host = '127.0.0.1'

# Build an URL for XML-RPC requests
rpcUrl = 'http://%s:%s@%s:%s/xmlrpc' % (username, password, host, port);
# Build a URL for XML-RPC requests
rpcUrl = 'http://%s:%s@%s:%s/xmlrpc' % (quote(username), quote(password), host, port);

# Create remote server object
server = ServerProxy(rpcUrl)
Expand Down
6 changes: 4 additions & 2 deletions scripts/Logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
import os
import sys
import datetime
from urllib2 import quote # python 2/3

try:
from xmlrpclib import ServerProxy # python 2
except ImportError:
Expand Down Expand Up @@ -70,8 +72,8 @@

if host == '0.0.0.0': host = '127.0.0.1'

# Build an URL for XML-RPC requests
rpcUrl = 'http://%s:%s@%s:%s/xmlrpc' % (username, password, host, port);
# Build a URL for XML-RPC requests
rpcUrl = 'http://%s:%s@%s:%s/xmlrpc' % (quote(username), quote(password), host, port);

# Create remote server object
server = ServerProxy(rpcUrl)
Expand Down

0 comments on commit a975025

Please sign in to comment.