summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/plugins/hoster/NetloadIn.py2
-rwxr-xr-xpyLoadCli.py120
-rw-r--r--systemCheck.py13
3 files changed, 97 insertions, 38 deletions
diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py
index 67753a7b7..278e9ce87 100644
--- a/module/plugins/hoster/NetloadIn.py
+++ b/module/plugins/hoster/NetloadIn.py
@@ -101,7 +101,7 @@ class NetloadIn(Plugin):
sleep(5)
self.html[2] = self.req.load("http://netload.in/index.php?id=10", post={"file_id": file_id, "captcha_check": captcha}, cookies=True)
- if re.search(r"(We will prepare your download..|We had a request with the IP)", self.html[2]) != None:
+ if re.search(r"(We will prepare your download..|We had a reqeust with the IP)", self.html[2]) != None:
return True
raise Exception("Captcha not decrypted")
diff --git a/pyLoadCli.py b/pyLoadCli.py
index 1d7a05155..69f7b22ab 100755
--- a/pyLoadCli.py
+++ b/pyLoadCli.py
@@ -17,13 +17,16 @@
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
###
+from getopt import GetoptError
+from getopt import getopt
+import gettext
import os
import os.path
-import gettext
from os.path import abspath
from os.path import dirname
from os.path import join
import sys
+from sys import exit
import threading
import time
from time import sleep
@@ -430,6 +433,29 @@ def mag(string):
def white(string):
return "\033[1;37m" + string + "\033[0m"
+def print_help():
+ print ""
+ print "pyloadCli Copyright (c) 2008-2010 the pyLoad Team"
+ print ""
+ print "Usage: [python] pyLoadCli.py [options] [server url]"
+ print ""
+ print "<server url>"
+ print "The server url has this format: http://username:passwort@adress:port"
+ print ""
+ print "<Options>"
+ print " -l, --local", " " * 6, "Use the local settings in config file"
+ print " -u, --username=<username>"
+ print " " * 20, "Specify username"
+ print ""
+ print " -a, --address=<adress>"
+ print " " * 20, "Specify adress (default=127.0.0.1)"
+ print ""
+ print " -p, --port", " " * 7, "Specify port (default=7272)"
+ print " -s, --ssl", " " * 8, "Enable ssl (default=off)"
+ print " -h, --help", " " * 7, "Display this help screen"
+ print ""
+
+
if __name__ == "__main__":
xmlconfig = XMLConfigParser(join(abspath(dirname(__file__)), "module", "config", "core.xml"))
@@ -438,40 +464,70 @@ if __name__ == "__main__":
translation = gettext.translation("pyLoadCli", join(abspath(dirname(__file__)), "locale"), languages=[config['general']['language']])
translation.install(unicode=(True if sys.stdout.encoding.lower().startswith("utf") else False))
+ server_url = ""
+ username = ""
+ password = ""
+ addr = ""
+ port = ""
+ ssl = None
+
if len(sys.argv) > 1:
-
- shortOptions = 'l'
- longOptions = ['local']
- opts, extraparams = __import__("getopt").getopt(sys.argv[1:], shortOptions, longOptions)
- for option, params in opts:
- if option in ("-l", "--local"):
-
- ssl = ""
- if config['ssl']['activated']:
- ssl = "s"
-
- server_url = "http%s://%s:%s@%s:%s/" % (
- ssl,
- config['remote']['username'],
- config['remote']['password'],
- config['remote']['listenaddr'],
- config['remote']['port']
- )
+
+ addr = "127.0.0.1"
+ port = "7272"
+ ssl = ""
+
+ shortOptions = 'lu:a:p:s:h'
+ longOptions = ['local', "username=", "adress=", "port=", "ssl=", "help"]
+
+ try:
+ opts, extraparams = getopt(sys.argv[1:], shortOptions, longOptions)
+ for option, params in opts:
+ if option in ("-l", "--local"):
+
+ if config['ssl']['activated']:
+ ssl = "s"
+
+ username = config['remote']['username']
+ password = config['remote']['password']
+ addr = config['remote']['listenaddr']
+ port = config['remote']['port']
+ if option in ("-u", "--username"):
+ username = params
+ if option in ("-a", "--adress"):
+ addr = params
+ if option in ("-p", "--port"):
+ port = params
+ if option in ("-s", "--ssl"):
+ if params.lower() == "true":
+ ssl = "s"
+ if option in ("-h", "--help"):
+ print_help()
+ exit()
+ except GetoptError:
+ print 'Unknown Argument(s) "%s"' % " ".join(sys.argv[1:])
+ print_help()
+ exit()
+
if len(extraparams) == 1:
server_url = sys.argv[1]
- else:
- username = raw_input(_("Username: "))
- address = raw_input(_("Adress: "))
- ssl = raw_input(_("Use SSL? ([y]/n): "))
- if ssl == "y" or ssl == "":
- ssl = "s"
- else:
- ssl = ""
- port = raw_input(_("Port: "))
- from getpass import getpass
- password = getpass(_("Password: "))
-
- server_url = "http%s://%s:%s@%s:%s/" % (ssl, username, password, address, port)
+
+ if not server_url:
+ if not username: username = raw_input(_("Username: "))
+ if not addr: addr = raw_input(_("Adress: "))
+ if ssl == None:
+ ssl = raw_input(_("Use SSL? ([y]/n): "))
+ if ssl == "y" or ssl == "":
+ ssl = "s"
+ else:
+ ssl = ""
+ if not port: port = raw_input(_("Port: "))
+ if not password:
+ from getpass import getpass
+ password = getpass(_("Password: "))
+
+ server_url = "http%s://%s:%s@%s:%s/" % (ssl, username, password, addr, port)
+
#print server_url
cli = pyLoadCli(server_url)
diff --git a/systemCheck.py b/systemCheck.py
index 60daaa514..7f78ec896 100644
--- a/systemCheck.py
+++ b/systemCheck.py
@@ -153,16 +153,19 @@ def main():
web_err.append("Please run: python %s syncdb" % join(dirname(__file__), "module", "web", "manage.py"))
try:
- p = subprocess.call(["lighttpd", "-v"], stdout=pipe, stderr=pipe)
+ import flup
except:
- web_info.append("Install lighttpd if you want an highperformance webserver.")
+ web_info.append("Install Flup to use FastCGI or optional webservers.")
try:
- import flup
+ p = subprocess.call(["lighttpd", "-v"], stdout=pipe, stderr=pipe)
except:
- web_info.append("Install Flup to use FastCGI and lighttpd.")
-
+ web_info.append("Install lighttpd as optional webserver.")
+ try:
+ p = subprocess.call(["nginx", "-v"], stdout=pipe, stderr=pipe)
+ except:
+ web_info.append("Install nginx as optional webserver.")
if web_err:
print "The system check has detected some errors:"