diff options
Diffstat (limited to 'module/plugins/hooks/ClickAndLoad.py')
-rw-r--r-- | module/plugins/hooks/ClickAndLoad.py | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index 0ca492cb7..97e5cd57d 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -27,31 +27,32 @@ class ClickAndLoad(Hook): __name__ = "ClickAndLoad" __version__ = "0.2" __description__ = """Gives abillity to use jd's click and load. depends on webinterface""" - __config__ = [ ("activated", "bool", "Activated" , "True"), - ("extern", "bool", "Allow external link adding", "False") ] + __config__ = [("activated", "bool", "Activated", "True"), + ("extern", "bool", "Allow external link adding", "False")] __author_name__ = ("RaNaN", "mkaay") __author_mail__ = ("RaNaN@pyload.de", "mkaay@mkaay.de") - + def coreReady(self): - self.port = int(self.core.config['webinterface']['port']) + self.port = int(self.core.config['webinterface']['port']) if self.core.config['webinterface']['activated']: try: - if self.getConfig("extern"): - ip = "0.0.0.0" - else: - ip = "127.0.0.1" - + if self.getConfig("extern"): + ip = "0.0.0.0" + else: + ip = "127.0.0.1" + thread.start_new_thread(proxy, (self, ip, self.port, 9666)) except: self.log.error("ClickAndLoad port already in use.") def proxy(self, *settings): - thread.start_new_thread(server, (self,)+settings) + thread.start_new_thread(server, (self,) + settings) lock = thread.allocate_lock() lock.acquire() lock.acquire() + def server(self, *settings): try: dock_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) @@ -72,9 +73,10 @@ def server(self, *settings): if errno == 98: self.core.log.warning(_("Click'N'Load: Port 9666 already in use")) return - thread.start_new_thread(server, (self,)+settings) + thread.start_new_thread(server, (self,) + settings) except: - thread.start_new_thread(server, (self,)+settings) + thread.start_new_thread(server, (self,) + settings) + def forward(source, destination): string = ' ' |