diff options
author | mkaay <mkaay@mkaay.de> | 2010-11-05 16:45:06 +0100 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2010-11-05 16:45:06 +0100 |
commit | 1d74a9dcb91d16929a65a24d81ec441874ce4976 (patch) | |
tree | dba60b1a47ec4bf3a61e863f9102ec5b57296568 | |
parent | small fixes: progess view in gui,xdcc,shareonline (diff) | |
download | pyload-1d74a9dcb91d16929a65a24d81ec441874ce4976.tar.xz |
sj fix
-rw-r--r-- | module/PluginThread.py | 11 | ||||
-rw-r--r-- | module/ThreadManager.py | 27 | ||||
-rw-r--r-- | module/plugins/Crypter.py | 3 | ||||
-rw-r--r-- | module/plugins/crypter/SerienjunkiesOrg.py | 13 |
4 files changed, 49 insertions, 5 deletions
diff --git a/module/PluginThread.py b/module/PluginThread.py index 20cb10a5b..f12639719 100644 --- a/module/PluginThread.py +++ b/module/PluginThread.py @@ -308,7 +308,12 @@ class DecrypterThread(PluginThread): pyfile = self.active retry = False - + + if not self.active.plugin.multiDL: + while self.m.isOccupiedCrypter(self.active.pluginname): + sleep(0.5) + self.m.addOccupiedCrypter(self.active.pluginname) + try: self.m.log.info(_("Decrypting starts: %s") % self.active.name) self.active.plugin.preprocessing(self) @@ -343,6 +348,8 @@ class DecrypterThread(PluginThread): self.m.log.info(_("Retrying %s") % self.active.name) retry = True + if not self.active.plugin.multiDL: + self.m.removeOccupiedCrypter(pyfile.pluginname) return self.run() except Exception, e: @@ -360,6 +367,8 @@ class DecrypterThread(PluginThread): finally: if not retry: + if not self.active.plugin.multiDL: + self.m.removeOccupiedCrypter(pyfile.pluginname) self.active.release() self.active = False self.m.core.files.save() diff --git a/module/ThreadManager.py b/module/ThreadManager.py index eba23f28c..d17281e9d 100644 --- a/module/ThreadManager.py +++ b/module/ThreadManager.py @@ -25,6 +25,7 @@ from threading import Event from time import sleep from traceback import print_exc from random import choice +from threading import Lock import pycurl import PluginThread @@ -56,8 +57,30 @@ class ThreadManager: for i in range(0, self.core.config.get("general", "max_downloads")): self.createThread() - - + self.occupiedCrypter = [] + self.occupiedCrypterLock = Lock() + + #---------------------------------------------------------------------- + def addOccupiedCrypter(self, name): + self.occupiedCrypterLock.acquire() + if not name in self.occupiedCrypter: + self.occupiedCrypter.append(name) + print True + self.occupiedCrypterLock.release() + + def removeOccupiedCrypter(self, name): + self.occupiedCrypterLock.acquire() + if name in self.occupiedCrypter: + print True + self.occupiedCrypter.remove(name) + self.occupiedCrypterLock.release() + + def isOccupiedCrypter(self, name): + self.occupiedCrypterLock.acquire() + ret = name in self.occupiedCrypter + self.occupiedCrypterLock.release() + return ret + #---------------------------------------------------------------------- def createThread(self): """create a download thread""" diff --git a/module/plugins/Crypter.py b/module/plugins/Crypter.py index ef8d0cfd0..123c26eec 100644 --- a/module/plugins/Crypter.py +++ b/module/plugins/Crypter.py @@ -36,6 +36,9 @@ class Crypter(Plugin): """ Put all packages here. It's a list of tuples like: ( name, [list of links], folder ) """ self.packages = [] + + self.multiDL = True + self.setup() #---------------------------------------------------------------------- def preprocessing(self, thread): diff --git a/module/plugins/crypter/SerienjunkiesOrg.py b/module/plugins/crypter/SerienjunkiesOrg.py index b12ca49c8..709bc7630 100644 --- a/module/plugins/crypter/SerienjunkiesOrg.py +++ b/module/plugins/crypter/SerienjunkiesOrg.py @@ -10,8 +10,8 @@ class SerienjunkiesOrg(Crypter): __name__ = "SerienjunkiesOrg" __type__ = "container" __pattern__ = r"http://.*?serienjunkies.org/.*?" - __version__ = "0.2" - __config__ = [ ("preferredHoster", "str", "preferred hoster" , "RapidshareCom,UploadedTo,NetloadIn,FilefactoryCom") ] + __version__ = "0.3" + __config__ = [ ("preferredHoster", "str", "preferred hoster" , "RapidshareCom,UploadedTo,NetloadIn,FilefactoryCom,FreakshareNet,FilebaseTo,MegauploadCom,HotfileCom,DepositfilesCom,EasyshareCom,KickloadCom") ] __description__ = """serienjunkies.org Container Plugin""" __author_name__ = ("mkaay") __author_mail__ = ("mkaay@mkaay.de") @@ -23,9 +23,18 @@ class SerienjunkiesOrg(Crypter): "ut": "UploadedTo", "ul": "UploadedTo", "nl": "NetloadIn", + "fs": "FreakshareNet", + "fb": "FilebaseTo", + "mu": "MegauploadCom", + "hf": "HotfileCom", + "df": "DepositfilesCom", + "es": "EasyshareCom", + "kl": "KickloadCom", } self.hosterMapReverse = dict((v,k) for k, v in self.hosterMap.iteritems()) + self.multiDL = False + def getSJSrc(self, url): src = self.req.load(str(url)) if not src.find("Enter Serienjunkies") == -1: |