summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-09-01 11:45:19 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-09-01 11:45:19 +0200
commit5eb9ef7b53ac398478791e75df92269f8e3b3963 (patch)
tree078731ae0d7714b5e661c13045e5618a56355caf /module
parentfix last commit (diff)
downloadpyload-5eb9ef7b53ac398478791e75df92269f8e3b3963.tar.xz
closed #385
Diffstat (limited to 'module')
-rw-r--r--module/common/json.py12
-rw-r--r--module/config/default.conf2
-rw-r--r--module/plugins/hoster/FileserveCom.py1
-rw-r--r--module/plugins/hoster/MegauploadCom.py5
4 files changed, 17 insertions, 3 deletions
diff --git a/module/common/json.py b/module/common/json.py
new file mode 100644
index 000000000..e9ed003a0
--- /dev/null
+++ b/module/common/json.py
@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+
+# abstraction layer for json operations
+
+try: # since python 2.7
+ from json import loads as json_loads
+ from json import dumps as json_dumps
+except ImportError:
+ from module.lib.simplejson import loads as json_loads
+ from module.lib.simplejson import dumps as json_dumps \ No newline at end of file
diff --git a/module/config/default.conf b/module/config/default.conf
index 71d8c7023..eef8f6347 100644
--- a/module/config/default.conf
+++ b/module/config/default.conf
@@ -19,6 +19,8 @@ log - "Log":
bool file_log : "File Log" = True
folder log_folder : "Folder" = Logs
int log_count : "Count" = 5
+ int log_size : "Size in kb" = 100
+ bool log_rotate : "Log Rotate" = True
general - "General":
en;de;fr;it;es;sv;ru;pl;cs;pt_BR language : "Language" = en
folder download_folder : "Download Folder" = Downloads
diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py
index 53a970226..1ee19b00c 100644
--- a/module/plugins/hoster/FileserveCom.py
+++ b/module/plugins/hoster/FileserveCom.py
@@ -2,7 +2,6 @@
from __future__ import with_statement
import re
-from base64 import standard_b64encode
from module.plugins.Hoster import Hoster
from module.plugins.ReCaptcha import ReCaptcha
diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py
index a5dc0b72e..4854dcef7 100644
--- a/module/plugins/hoster/MegauploadCom.py
+++ b/module/plugins/hoster/MegauploadCom.py
@@ -143,8 +143,9 @@ class MegauploadCom(Hoster):
for i in range(10):
page = self.load("http://www.megaupload.com/?c=premium&l=1", decode=True)
+ # MU thinks dl is already running
if "Please finish this download before starting another one." in page and i != 9:
- sleep(1)
+ sleep(2)
elif i != 9:
try:
wait = re.search(r"Please wait (\d+) minutes", page).group(1)
@@ -152,7 +153,7 @@ class MegauploadCom(Hoster):
except :
pass
else:
- wait = 1
+ wait = 2 # lowest limit seems to be 2 minutes
self.log.info(_("Megaupload: waiting %d minutes") % int(wait))
self.setWait(int(wait)*60, True)