summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-07-19 00:36:50 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-07-19 00:36:50 +0200
commit876673902e5ea8d5336e144cad18d23fda613e94 (patch)
tree5b6ba792882eb110e822b2e64dda2b6a4f3722e9 /module/plugins
parentimproved hook loader (diff)
downloadpyload-876673902e5ea8d5336e144cad18d23fda613e94.tar.xz
cleanup
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/Container.py11
-rw-r--r--module/plugins/Crypter.py17
-rw-r--r--module/plugins/hoster/RealdebridCom.py5
3 files changed, 14 insertions, 19 deletions
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)