summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/DownloadThread.py11
-rw-r--r--module/ThreadManager.py3
-rw-r--r--module/plugins/Hoster.py32
-rw-r--r--module/plugins/container/DLC_26.pycbin7757 -> 7757 bytes
-rw-r--r--module/plugins/hoster/ShareonlineBiz.py3
-rwxr-xr-xpyLoadCore.py2
6 files changed, 46 insertions, 5 deletions
diff --git a/module/DownloadThread.py b/module/DownloadThread.py
index 95ed88da0..2178bd21e 100644
--- a/module/DownloadThread.py
+++ b/module/DownloadThread.py
@@ -121,16 +121,21 @@ class DownloadThread(Thread):
def handleNewInterface(self, pyfile):
status = pyfile.status
plugin = pyfile.plugin
- status.type = "starting"
- self.parent.parent.pullManager.addEvent(UpdateEvent("file", pyfile.id, "queue"))
if plugin.__type__ == "container" or plugin.__type__ == "crypter":
status.type = "decrypting"
+ else: #hoster
+ status.type = "starting"
self.parent.parent.pullManager.addEvent(UpdateEvent("file", pyfile.id, "queue"))
if plugin.__type__ == "container":
plugin.decrypt(pyfile.url)
-
+ else:
+ plugin.preparePlugin(self)
+
+ plugin.prepareDownload()
+
+ plugin.startDownload()
status.type = "finished"
def download(self, pyfile):
diff --git a/module/ThreadManager.py b/module/ThreadManager.py
index 1c5a89a5c..4e2beaf49 100644
--- a/module/ThreadManager.py
+++ b/module/ThreadManager.py
@@ -114,6 +114,8 @@ class ThreadManager(Thread):
else:
self.parent.logger.info(_("%i new packages from %s") % (len(packages), pyfile.status.filename))
for name, links in packages:
+ if not name:
+ name = pyfile.status.filename
pid = self.list.packager.addNewPackage(name)
for link in links:
newFile = self.list.collector.addLink(link)
@@ -124,6 +126,7 @@ class ThreadManager(Thread):
self.parent.logger.info(_("%i links in %s") % (len(links), name))
else:
pass
+ self.list.packager.removeFileFromPackage(pyfile.id, pyfile.package.data["id"])
def jobFinished(self, pyfile):
"""manage completing download"""
diff --git a/module/plugins/Hoster.py b/module/plugins/Hoster.py
index 0ed528924..75f925587 100644
--- a/module/plugins/Hoster.py
+++ b/module/plugins/Hoster.py
@@ -27,3 +27,35 @@ class Hoster(Plugin):
__description__ = """Base hoster plugin"""
__author_name__ = ("mkaay")
__author_mail__ = ("mkaay@mkaay.de")
+
+ def preparePlugin(self, thread):
+ self.thread = thread
+ self.usePremium = False
+
+ def getFileName(self):
+ try:
+ return re.findall("([^\/=]+)", self.pyfile.url)[-1]
+ except:
+ return self.pyfile.url[:20]
+
+ def isOnline(self):
+ return True
+
+ def multiDownload(self):
+ return True
+
+ def prepareDownload(self):
+ pass
+
+ def startDownload(self):
+ self.req.download(self.pyfile.url, self.pyfile.folder)
+
+ def verifyDownload(self):
+ return True
+
+ def wait(self, until=None, reconnect=False):
+ self.pyfile.status.want_reconnect = reconnect
+ self.pyfile.status.waituntil = until
+ if not until:
+ self.pyfile.status.waituntil = 0
+
diff --git a/module/plugins/container/DLC_26.pyc b/module/plugins/container/DLC_26.pyc
index 840d043a7..5c8c98088 100644
--- a/module/plugins/container/DLC_26.pyc
+++ b/module/plugins/container/DLC_26.pyc
Binary files differ
diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py
index 13d240bb4..f7ef3d4f1 100644
--- a/module/plugins/hoster/ShareonlineBiz.py
+++ b/module/plugins/hoster/ShareonlineBiz.py
@@ -99,7 +99,8 @@ class ShareonlineBiz(Hoster):
sleep(3)
self.html[1] = self.load(url, post={"captchacode": captcha}, cookies=True)
if re.search(r"no slots available", self.html[1]):
- self.time_plus_wait = time() + 60
+ self.time_plus_wait = time() + 120
+ self.logger.debug("%s: no free slots, waiting 120 seconds" % (self.__name__))
return False
if re.search(r"Der Download ist Ihnen zu langsam", self.html[1]):
self.time_plus_wait = time() + 15
diff --git a/pyLoadCore.py b/pyLoadCore.py
index 906f59cae..3b7cbd60c 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -693,7 +693,7 @@ class ServerMethods():
def upload_container(self, filename, type, content):
th = NamedTemporaryFile(mode="w", suffix="." + type, delete=False)
- th.write(content)
+ th.write(str(content))
path = th.name
th.close()
pid = self.core.file_list.packager.addNewPackage(filename)