diff options
Diffstat (limited to 'module')
-rw-r--r-- | module/DownloadThread.py | 11 | ||||
-rw-r--r-- | module/ThreadManager.py | 3 | ||||
-rw-r--r-- | module/plugins/Hoster.py | 32 | ||||
-rw-r--r-- | module/plugins/container/DLC_26.pyc | bin | 7757 -> 7757 bytes | |||
-rw-r--r-- | module/plugins/hoster/ShareonlineBiz.py | 3 |
5 files changed, 45 insertions, 4 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 Binary files differindex 840d043a7..5c8c98088 100644 --- a/module/plugins/container/DLC_26.pyc +++ b/module/plugins/container/DLC_26.pyc 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 |