summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar spoob <spoob@gmx.de> 2010-03-30 21:33:17 +0200
committerGravatar spoob <spoob@gmx.de> 2010-03-30 21:33:17 +0200
commita0e87b841327426aba3d511f17a28d83aa177d7e (patch)
tree12de6bd23eae194d729562a2bb506f870f8a3fda
parentclosed #69 (diff)
downloadpyload-a0e87b841327426aba3d511f17a28d83aa177d7e.tar.xz
freespace for windows
-rw-r--r--module/plugins/hoster/HotfileCom.py7
-rw-r--r--module/plugins/hoster/MegauploadCom.py1
-rwxr-xr-xpyLoadCore.py21
3 files changed, 23 insertions, 6 deletions
diff --git a/module/plugins/hoster/HotfileCom.py b/module/plugins/hoster/HotfileCom.py
index 748571840..aef761da7 100644
--- a/module/plugins/hoster/HotfileCom.py
+++ b/module/plugins/hoster/HotfileCom.py
@@ -24,10 +24,15 @@ class HotfileCom(Plugin):
self.multi_dl = False
self.htmlwithlink = None
self.url = None
+ self.read_config()
+ if self.config['premium']:
+ self.multi_dl = True
+ self.req.canContinue = True
+ else:
+ self.multi_dl = False
def prepare(self, thread):
pyfile = self.parent
-
self.want_reconnect = False
self.download_html()
diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py
index 3eb21a591..c282aa735 100644
--- a/module/plugins/hoster/MegauploadCom.py
+++ b/module/plugins/hoster/MegauploadCom.py
@@ -44,6 +44,7 @@ class MegauploadCom(Plugin):
megavar = re.search('name="megavar" value="(.*)">', self.html[0]).group(1)
self.html[1] = self.req.load(url, post={"captcha": captcha, "captchacode": captchacode, "megavar": megavar}, cookies=True)
if re.search(r"Waiting time before each download begins", self.html[1]) != None:
+ print "got it"
break
self.time_plus_wait = time() + 45
diff --git a/pyLoadCore.py b/pyLoadCore.py
index 206363f57..e2682c990 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -32,6 +32,7 @@ import logging
import logging.handlers
from operator import attrgetter
from os import chdir
+from os import name as platform
from os import execv
from os import makedirs
from os import remove
@@ -260,10 +261,14 @@ class Core(object):
self.file_list.continueAborted()
except:
pass
-
- self.logger.info(_("Free space: %sMB") % self.freeSpace())
- self.thread_list.pause = False
+ freeSpace = self.freeSpace()
+ if freeSpace > 10000:
+ self.logger.info(_("Free space: %sGB") % (freeSpace / 1000))
+ else:
+ self.logger.info(_("Free space: %sMB") % self.freeSpace())
+
+ self.thread_list.pause = False
while True:
sleep(2)
@@ -480,8 +485,14 @@ class Core(object):
return join(self.path, * args)
def freeSpace(self):
- s = statvfs(self.make_path(self.config['general']['download_folder']))
- return s.f_bsize * s.f_bavail / 1024 / 1024 #megabyte
+ folder = self.make_path(self.config['general']['download_folder'])
+ if platform == 'nt':
+ free_bytes = ctypes.c_ulonglong(0)
+ __import__("ctypes").windll.kernel32.GetDiskFreeSpaceExW(ctypes.c_wchar_p(folder), None, None, ctypes.pointer(free_bytes))
+ return free_bytes.value / 1024 / 1024 #megabyte
+ else:
+ s = statvfs(folder)
+ return s.f_bsize * s.f_bavail / 1024 / 1024 #megabyte
####################################
########## XMLRPC Methods ##########