From 876673902e5ea8d5336e144cad18d23fda613e94 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Tue, 19 Jul 2011 00:36:50 +0200 Subject: cleanup --- module/plugins/Container.py | 11 +++-------- module/plugins/Crypter.py | 17 +++++++++-------- module/plugins/hoster/RealdebridCom.py | 5 ++--- 3 files changed, 14 insertions(+), 19 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/Container.py b/module/plugins/Container.py index 8d195b4a3..c233d3710 100644 --- a/module/plugins/Container.py +++ b/module/plugins/Container.py @@ -32,9 +32,7 @@ class Container(Crypter): __author_name__ = ("mkaay") __author_mail__ = ("mkaay@mkaay.de") - - - #---------------------------------------------------------------------- + def preprocessing(self, thread): """prepare""" @@ -48,13 +46,12 @@ class Container(Crypter): self.createPackages() - - #---------------------------------------------------------------------- + def loadToDisk(self): """loads container to disk if its stored remotely and overwrite url, or check existent on several places at disk""" - if self.pyfile.url.startswith("http://"): + if self.pyfile.url.startswith("http"): self.pyfile.name = re.findall("([^\/=]+)", self.pyfile.url)[-1] content = self.load(self.pyfile.url) self.pyfile.url = join(self.config["general"]["download_folder"], self.pyfile.name) @@ -71,8 +68,6 @@ class Container(Crypter): self.fail(_("File not exists.")) - - #---------------------------------------------------------------------- def deleteTmp(self): if self.pyfile.name.startswith("tmp_"): remove(self.pyfile.url) diff --git a/module/plugins/Crypter.py b/module/plugins/Crypter.py index 9c56eb91b..d1549fe80 100644 --- a/module/plugins/Crypter.py +++ b/module/plugins/Crypter.py @@ -19,8 +19,6 @@ from module.plugins.Plugin import Plugin -from os.path import join, exists, basename - class Crypter(Plugin): __name__ = "Crypter" __version__ = "0.1" @@ -33,15 +31,16 @@ class Crypter(Plugin): def __init__(self, pyfile): Plugin.__init__(self, pyfile) - """ Put all packages here. It's a list of tuples like: - ( name, [list of links], folder ) """ + #: Put all packages here. It's a list of tuples like: ( name, [list of links], folder ) self.packages = [] + + #: List of urls, pyLoad will generate packagenames + self.urls = [] self.multiDL = True self.limitDL = 0 - self.setup() - #---------------------------------------------------------------------- + def preprocessing(self, thread): """prepare""" self.setup() @@ -54,8 +53,7 @@ class Crypter(Plugin): def decrypt(self, pyfile): raise NotImplementedError - - #---------------------------------------------------------------------- + def createPackages(self): """ create new packages from self.packages """ for pack in self.packages: @@ -68,4 +66,7 @@ class Crypter(Plugin): if self.pyfile.package().password: self.core.api.setPackageData(pid, {"password": self.pyfile.package().password}) + + if self.urls: + self.core.api.generateAndAddPackages(self.urls) diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index 2d35108bc..c23e19b4d 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -4,13 +4,12 @@ import re from urllib import quote, unquote from random import randrange -from time import sleep from module.plugins.Hoster import Hoster class RealdebridCom(Hoster): __name__ = "RealdebridCom" - __version__ = "0.4" + __version__ = "0.41" __type__ = "hoster" __pattern__ = r"https?://.*real-debrid\..*" @@ -80,5 +79,5 @@ class RealdebridCom(Hoster): if check == "error": #usual this download can safely be retried - self.retry(reason="An error occured while generating link.") + self.retry(reason="An error occured while generating link.", wait_time=60) -- cgit v1.2.3