From 9f044df800d8ccca73178a523b18fead36e5befc Mon Sep 17 00:00:00 2001 From: RaNaN Date: Mon, 17 Aug 2009 15:49:48 +0200 Subject: new config options, webinterface test --- config | 8 ++++- module/remote/RequestHandler.py | 2 +- module/web/WebServer.py | 13 ++++++-- module/web/templates/default.tpl | 71 ++++++++++++++-------------------------- pyLoadCli.py | 2 +- 5 files changed, 43 insertions(+), 53 deletions(-) diff --git a/config b/config index 7ec9ab547..4752a459b 100644 --- a/config +++ b/config @@ -1,6 +1,12 @@ [remote] port = 7272 -remotepassword = pwhere +password = pwhere + +[webinterface] +activated = True +port = 8080 +username = User +password = webpw [log] file_log = True diff --git a/module/remote/RequestHandler.py b/module/remote/RequestHandler.py index 415a8bba7..a879d2297 100644 --- a/module/remote/RequestHandler.py +++ b/module/remote/RequestHandler.py @@ -21,7 +21,7 @@ from RequestObject import RequestObject class RequestHandler: def __init__(self, core): self.core = core - key = hashlib.sha256(core.config['remotepassword']) + key = hashlib.sha256(core.config['remote']['password']) self.bf = Blowfish.new(key.hexdigest(), Blowfish.MODE_ECB) def proceed(self, data): diff --git a/module/web/WebServer.py b/module/web/WebServer.py index d2bf9b3a8..ad0d03512 100644 --- a/module/web/WebServer.py +++ b/module/web/WebServer.py @@ -39,9 +39,16 @@ core = None PATH = "./module/web/" +@route('/', method= 'POST') +def home(): + #print request.GET + print request.POST + + return template('default', page='home', links=core.get_downloads()) + @route('/') -def hello_world(): - return template('default', string=str(core.get_downloads())) +def login(): + return template('default', page='login') @route('/favicon.ico') def favicon(): @@ -67,4 +74,4 @@ class WebServer(threading.Thread): bottle.TEMPLATE_PATH.append('./module/web/templates/%s.tpl') def run(self): - run(host='localhost', port=8080) \ No newline at end of file + run(host='localhost', port=int(self.core.config['webinterface']['port'])) \ No newline at end of file diff --git a/module/web/templates/default.tpl b/module/web/templates/default.tpl index a375df20d..70671028e 100644 --- a/module/web/templates/default.tpl +++ b/module/web/templates/default.tpl @@ -8,19 +8,11 @@
-
- - - -
- - - User:RaNaN (ranan) + User:User @@ -31,19 +23,15 @@
@@ -51,47 +39,36 @@
-

pyLoad — download manager for 1 click hoster

+

pyLoad — Webinterface

-

+%if page == "login": - -

+
+
+
+
Login +
+
+ + +
+
+
+
-

-pyLoad is a free and open source downloader for 1-click-hosting sites like rapidshare.com or uploaded.to. -

+%else: +

Downloads:

-

-Link-Crypt services like lix.in as well as the Link-Container Files RSDF, CCF and DLC are also supported. -

+% for link in links:

-pyLoad is currently under heavy development. It aims to be fully automated in as many ways as possible, so you don't have to sit in front of your computer waiting for a download ticket. It will be good for long-time unattended downloading of files from sharehosters. +{{str(link)}}

-
- -

Features

-
-
    -
  • written entirely in Python
    -
  • -
  • gets links from Link-Crypt services
    -
  • -
  • can open RSDF, CCF and DLC containers
    -
  • -
  • User interfaces: CLI and wxWidgets (currently in development)
    -
  • -
  • Open Source and Free Software (GPL v3 or later)
    -
  • -
- -
- -
+%end +%end