summaryrefslogtreecommitdiffstats
path: root/module/plugins/container
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/container')
-rw-r--r--module/plugins/container/CCF.py14
-rw-r--r--module/plugins/container/DLC.py18
-rw-r--r--module/plugins/container/RSDF.py18
-rw-r--r--module/plugins/container/TXT.py20
4 files changed, 35 insertions, 35 deletions
diff --git a/module/plugins/container/CCF.py b/module/plugins/container/CCF.py
index 563eaef6d..2cafb2977 100644
--- a/module/plugins/container/CCF.py
+++ b/module/plugins/container/CCF.py
@@ -8,19 +8,19 @@ import urllib2
import MultipartPostHandler
from module.plugins.internal.Container import Container
-from module.plugins.internal.utils import encode, fs_join
+from module.plugins.internal.misc import encode, fsjoin
class CCF(Container):
__name__ = "CCF"
__type__ = "container"
- __version__ = "0.27"
+ __version__ = "0.28"
__status__ = "testing"
__pattern__ = r'.+\.ccf$'
- __config__ = [("activated" , "bool", "Activated" , True),
- ("use_subfolder" , "bool", "Save package to subfolder" , True),
- ("subfolder_per_package", "bool", "Create a subfolder for each package", True)]
+ __config__ = [("activated" , "bool" , "Activated" , True ),
+ ("use_premium" , "bool" , "Use premium account if available", True ),
+ ("folder_per_package", "Default;Yes;No", "Create folder for each package" , "Default")]
__description__ = """CCF container decrypter plugin"""
__license__ = "GPLv3"
@@ -29,7 +29,7 @@ class CCF(Container):
def decrypt(self, pyfile):
- fs_filename = encode(pyfile.url.strip())
+ fs_filename = encode(pyfile.url)
opener = urllib2.build_opener(MultipartPostHandler.MultipartPostHandler)
dlc_content = opener.open('http://service.jdownloader.net/dlcrypt/getDLC.php',
@@ -38,7 +38,7 @@ class CCF(Container):
'upload' : open(fs_filename, "rb")}).read()
dl_folder = self.pyload.config.get("general", "download_folder")
- dlc_file = fs_join(dl_folder, "tmp_%s.dlc" % pyfile.name)
+ dlc_file = fsjoin(dl_folder, "tmp_%s.dlc" % pyfile.name)
try:
dlc = re.search(r'<dlc>(.+)</dlc>', dlc_content, re.S).group(1).decode('base64')
diff --git a/module/plugins/container/DLC.py b/module/plugins/container/DLC.py
index 7b4364a0a..91e421590 100644
--- a/module/plugins/container/DLC.py
+++ b/module/plugins/container/DLC.py
@@ -5,22 +5,22 @@ from __future__ import with_statement
import re
import xml.dom.minidom
-from Crypto.Cipher import AES
+import Crypto.Cipher
from module.plugins.internal.Container import Container
-from module.plugins.internal.utils import decode, encode
+from module.plugins.internal.misc import decode, encode
class DLC(Container):
__name__ = "DLC"
__type__ = "container"
- __version__ = "0.28"
+ __version__ = "0.29"
__status__ = "testing"
__pattern__ = r'(.+\.dlc|[\w\+^_]+==[\w\+^_/]+==)$'
- __config__ = [("activated" , "bool", "Activated" , True),
- ("use_subfolder" , "bool", "Save package to subfolder" , True),
- ("subfolder_per_package", "bool", "Create a subfolder for each package", True)]
+ __config__ = [("activated" , "bool" , "Activated" , True ),
+ ("use_premium" , "bool" , "Use premium account if available", True ),
+ ("folder_per_package", "Default;Yes;No", "Create folder for each package" , "Default")]
__description__ = """DLC container decrypter plugin"""
__license__ = "GPLv3"
@@ -37,7 +37,7 @@ class DLC(Container):
def decrypt(self, pyfile):
- fs_filename = encode(pyfile.url.strip())
+ fs_filename = encode(pyfile.url)
with open(fs_filename) as dlc:
data = dlc.read().strip()
@@ -53,9 +53,9 @@ class DLC(Container):
except AttributeError:
self.fail(_("Container is corrupted"))
- key = iv = AES.new(self.KEY, AES.MODE_CBC, self.IV).decrypt(rc)
+ key = iv = Crypto.Cipher.AES.new(self.KEY, Crypto.Cipher.AES.MODE_CBC, self.IV).decrypt(rc)
- self.data = AES.new(key, AES.MODE_CBC, iv).decrypt(dlc_data).decode('base64')
+ self.data = Crypto.Cipher.AES.new(key, Crypto.Cipher.AES.MODE_CBC, iv).decrypt(dlc_data).decode('base64')
self.packages = [(name or pyfile.name, links, name or pyfile.name) \
for name, links in self.get_packages()]
diff --git a/module/plugins/container/RSDF.py b/module/plugins/container/RSDF.py
index 2401a79ce..ec9e89171 100644
--- a/module/plugins/container/RSDF.py
+++ b/module/plugins/container/RSDF.py
@@ -5,22 +5,22 @@ from __future__ import with_statement
import binascii
import re
-from Crypto.Cipher import AES
+import Crypto.Cipher
from module.plugins.internal.Container import Container
-from module.plugins.internal.utils import encode
+from module.plugins.internal.misc import encode
class RSDF(Container):
__name__ = "RSDF"
__type__ = "container"
- __version__ = "0.33"
+ __version__ = "0.34"
__status__ = "testing"
__pattern__ = r'.+\.rsdf$'
- __config__ = [("activated" , "bool", "Activated" , True),
- ("use_subfolder" , "bool", "Save package to subfolder" , True),
- ("subfolder_per_package", "bool", "Create a subfolder for each package", True)]
+ __config__ = [("activated" , "bool" , "Activated" , True ),
+ ("use_premium" , "bool" , "Use premium account if available", True ),
+ ("folder_per_package", "Default;Yes;No", "Create folder for each package" , "Default")]
__description__ = """RSDF container decrypter plugin"""
__license__ = "GPLv3"
@@ -37,11 +37,11 @@ class RSDF(Container):
KEY = binascii.unhexlify(self.KEY)
IV = binascii.unhexlify(self.IV)
- iv = AES.new(KEY, AES.MODE_ECB).encrypt(IV)
- cipher = AES.new(KEY, AES.MODE_CFB, iv)
+ iv = Crypto.Cipher.AES.new(KEY, Crypto.Cipher.AES.MODE_ECB).encrypt(IV)
+ cipher = Crypto.Cipher.AES.new(KEY, Crypto.Cipher.AES.MODE_CFB, iv)
try:
- fs_filename = encode(pyfile.url.strip())
+ fs_filename = encode(pyfile.url)
with open(fs_filename, 'r') as rsdf:
data = rsdf.read()
diff --git a/module/plugins/container/TXT.py b/module/plugins/container/TXT.py
index 741538947..6ab870d94 100644
--- a/module/plugins/container/TXT.py
+++ b/module/plugins/container/TXT.py
@@ -3,21 +3,21 @@
import codecs
from module.plugins.internal.Container import Container
-from module.plugins.internal.utils import encode
+from module.plugins.internal.misc import encode
class TXT(Container):
__name__ = "TXT"
__type__ = "container"
- __version__ = "0.19"
+ __version__ = "0.20"
__status__ = "testing"
__pattern__ = r'.+\.(txt|text)$'
- __config__ = [("activated" , "bool", "Activated" , True ),
- ("use_subfolder" , "bool", "Save package to subfolder" , True ),
- ("subfolder_per_package", "bool", "Create a subfolder for each package", True ),
- ("flush" , "bool", "Flush list after adding" , False ),
- ("encoding" , "str" , "File encoding" , "utf-8")]
+ __config__ = [("activated" , "bool" , "Activated" , True ),
+ ("use_premium" , "bool" , "Use premium account if available", True ),
+ ("folder_per_package", "Default;Yes;No", "Create folder for each package" , "Default"),
+ ("flush" , "bool" , "Flush list after adding" , False ),
+ ("encoding" , "str" , "File encoding" , "utf-8" )]
__description__ = """Read link lists in plain text formats"""
__license__ = "GPLv3"
@@ -27,12 +27,12 @@ class TXT(Container):
def decrypt(self, pyfile):
try:
- encoding = codecs.lookup(self.get_config('encoding')).name
+ encoding = codecs.lookup(self.config.get('encoding')).name
except Exception:
encoding = "utf-8"
- fs_filename = encode(pyfile.url.strip())
+ fs_filename = encode(pyfile.url)
txt = codecs.open(fs_filename, 'r', encoding)
curPack = "Parsed links from %s" % pyfile.name
packages = {curPack:[],}
@@ -61,7 +61,7 @@ class TXT(Container):
if not value:
packages.pop(key, None)
- if self.get_config('flush'):
+ if self.config.get('flush'):
try:
txt = open(fs_filename, 'wb')
txt.close()