summaryrefslogtreecommitdiffstats
path: root/module/plugins/container
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-07 23:40:50 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-14 10:58:42 +0200
commit887ad58e4c6c20b992311bbdf931bcd18e73d384 (patch)
treef31beb241bacca0bfea4c1acc4e9ace813755cef /module/plugins/container
parent[AccountManager] Fixed #733 (diff)
parent[File4safe] distributing LINK_PATTERN (diff)
downloadpyload-887ad58e4c6c20b992311bbdf931bcd18e73d384.tar.xz
Merge branch 'stable' into 0.4.10
Conflicts: module/plugins/Account.py module/plugins/AccountManager.py module/plugins/Hook.py module/plugins/OCR.py module/plugins/Plugin.py module/plugins/PluginManager.py module/plugins/ReCaptcha.py module/plugins/accounts/Ftp.py module/plugins/accounts/Http.py module/plugins/internal/MultiHoster.py module/plugins/ocr/GigasizeCom.py module/plugins/ocr/LinksaveIn.py module/plugins/ocr/NetloadIn.py module/plugins/ocr/ShareonlineBiz.py
Diffstat (limited to 'module/plugins/container')
-rw-r--r--module/plugins/container/CCF.py19
-rw-r--r--module/plugins/container/LinkList.py14
-rw-r--r--module/plugins/container/RSDF.py12
3 files changed, 29 insertions, 16 deletions
diff --git a/module/plugins/container/CCF.py b/module/plugins/container/CCF.py
index 8aec97f6a..ee92beb9a 100644
--- a/module/plugins/container/CCF.py
+++ b/module/plugins/container/CCF.py
@@ -1,22 +1,28 @@
# -*- coding: utf-8 -*-
import re
+
+from os import makedirs
+from os.path import exists
from urllib2 import build_opener
-from module.plugins.Container import Container
from module.lib.MultipartPostHandler import MultipartPostHandler
-from os import makedirs
-from os.path import exists, join
+from module.plugins.Container import Container
+from module.utils import save_join
+
class CCF(Container):
__name__ = "CCF"
__version__ = "0.2"
+
__pattern__ = r'.+\.ccf'
+
__description__ = """CCF container decrypter plugin"""
__author_name__ = "Willnix"
__author_mail__ = "Willnix@pyload.org"
+
def decrypt(self, pyfile):
infile = pyfile.url.replace("\n", "")
@@ -28,13 +34,10 @@ class CCF(Container):
tempdlc_content = opener.open('http://service.jdownloader.net/dlcrypt/getDLC.php', params).read()
download_folder = self.config['general']['download_folder']
- location = download_folder #join(download_folder, pyfile.package().folder.decode(sys.getfilesystemencoding()))
- if not exists(location):
- makedirs(location)
- tempdlc_name = join(location, "tmp_%s.dlc" % pyfile.name)
+ tempdlc_name = save_join(download_folder, "tmp_%s.dlc" % pyfile.name)
tempdlc = open(tempdlc_name, "w")
tempdlc.write(re.search(r'<dlc>(.*)</dlc>', tempdlc_content, re.DOTALL).group(1))
tempdlc.close()
- self.packages.append((tempdlc_name, [tempdlc_name], tempdlc_name))
+ self.urls = [tempdlc_name]
diff --git a/module/plugins/container/LinkList.py b/module/plugins/container/LinkList.py
index 79678954d..7e418bd67 100644
--- a/module/plugins/container/LinkList.py
+++ b/module/plugins/container/LinkList.py
@@ -1,19 +1,24 @@
# -*- coding: utf-8 -*-
import codecs
-from module.utils import fs_encode
+
from module.plugins.Container import Container
+from module.utils import fs_encode
+
class LinkList(Container):
__name__ = "LinkList"
__version__ = "0.12"
+
__pattern__ = r'.+\.txt'
- __description__ = """Read link lists in txt format"""
__config__ = [("clear", "bool", "Clear Linklist after adding", False),
("encoding", "string", "File encoding (default utf-8)", "")]
+
+ __description__ = """Read link lists in txt format"""
__author_name__ = ("spoob", "jeix")
__author_mail__ = ("spoob@pyload.org", "jeix@hasnomail.com")
+
def decrypt(self, pyfile):
try:
file_enc = codecs.lookup(self.getConfig("encoding")).name
@@ -33,7 +38,8 @@ class LinkList(Container):
for link in links:
link = link.strip()
- if not link: continue
+ if not link:
+ continue
if link.startswith(";"):
continue
@@ -61,7 +67,7 @@ class LinkList(Container):
txt = open(file_name, 'wb')
txt.close()
except:
- self.log.warning(_("LinkList could not be cleared."))
+ self.logWarning(_("LinkList could not be cleared."))
for name, links in packages.iteritems():
self.packages.append((name, links, name))
diff --git a/module/plugins/container/RSDF.py b/module/plugins/container/RSDF.py
index 42296f2d5..c35efacc6 100644
--- a/module/plugins/container/RSDF.py
+++ b/module/plugins/container/RSDF.py
@@ -6,14 +6,18 @@ import re
from module.plugins.Container import Container
+
class RSDF(Container):
__name__ = "RSDF"
- __version__ = "0.21"
+ __version__ = "0.22"
+
__pattern__ = r'.+\.rsdf'
+
__description__ = """RSDF container decrypter plugin"""
__author_name__ = ("RaNaN", "spoob")
__author_mail__ = ("RaNaN@pyload.org", "spoob@pyload.org")
+
def decrypt(self, pyfile):
from Crypto.Cipher import AES
@@ -36,12 +40,12 @@ class RSDF(Container):
data = binascii.unhexlify(''.join(data.split()))
data = data.splitlines()
- links = []
for link in data:
+ if not link:
+ continue
link = base64.b64decode(link)
link = obj.decrypt(link)
decryptedUrl = link.replace('CCF: ', '')
- links.append(decryptedUrl)
+ self.urls.append(decryptedUrl)
self.log.debug("%s: adding package %s with %d links" % (self.__name__,pyfile.package().name,len(links)))
- self.packages.append((pyfile.package().name, links))