From f8adcdf5a83f53e0d77af063973d1436976abd6f Mon Sep 17 00:00:00 2001
From: mkaay <mkaay@mkaay.de>
Date: Thu, 12 Nov 2009 20:40:03 +0100
Subject: shareonline.biz premium

---
 module/plugins/ShareonlineBiz.py | 33 +++++++++++++++++++++++----------
 1 file changed, 23 insertions(+), 10 deletions(-)

(limited to 'module/plugins/ShareonlineBiz.py')

diff --git a/module/plugins/ShareonlineBiz.py b/module/plugins/ShareonlineBiz.py
index 946c0f97d..cb7030e87 100644
--- a/module/plugins/ShareonlineBiz.py
+++ b/module/plugins/ShareonlineBiz.py
@@ -26,23 +26,36 @@ class ShareonlineBiz(Plugin):
         self.html = [None, None]
         self.want_reconnect = False
         self.init_ocr()
-        self.multi_dl = False
+        if self.config['premium']:
+            self.multi_dl = True
+        else:
+            self.multi_dl = False
 
     def download_html(self):
+        if self.config['premium']:
+            post_vars = {"act": "login",
+                         "location": "service.php",
+                         "dieseid": "",
+                         "user": self.config['username'],
+                         "pass": self.config['password'],
+                         "login":"Log+me+in",
+                         "folder_autologin":"1"}
+            self.req.load("http://www.share-online.biz/login.php", cookies=True, post=post_vars)
         url = self.parent.url
         self.html[0] = self.req.load(url, cookies=True)
         
-        captcha_image = tempfile.NamedTemporaryFile(suffix=".jpg").name
+        if not self.config['premium']:
+            captcha_image = tempfile.NamedTemporaryFile(suffix=".jpg").name
 
-        for i in range(5):
-            self.req.download("http://www.share-online.biz/captcha.php", captcha_image, cookies=True)
-            captcha = self.ocr.get_captcha(captcha_image)
-            self.html[1] = self.req.load(url, post={"captchacode": captcha}, cookies=True)
-            if re.search(r"Der Download ist Ihnen zu langsam?", self.html[1]) != None:
-                self.time_plus_wait = time() + 15
-                break
+            for i in range(5):
+                self.req.download("http://www.share-online.biz/captcha.php", captcha_image, cookies=True)
+                captcha = self.ocr.get_captcha(captcha_image)
+                self.html[1] = self.req.load(url, post={"captchacode": captcha}, cookies=True)
+                if re.search(r"Der Download ist Ihnen zu langsam?", self.html[1]) != None:
+                    self.time_plus_wait = time() + 15
+                    break
 
-        os.remove(captcha_image)
+            os.remove(captcha_image)
 
     def get_file_url(self):
         """ returns the absolute downloadable filepath
-- 
cgit v1.2.3