summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-07-15 16:25:41 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-07-15 16:25:41 +0200
commit5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 (patch)
treeb3f80dbd9e759747f9c2acb60f614c5daa7af69e /module/plugins/crypter
parentFix class definition (diff)
downloadpyload-5060e4c6374a5116d0d8b02528f910f8c5f8bcf9.tar.xz
Fix code indentation, some bad whitespaces and missing authors + use 'not' instead 'is None' + replace __pattern__'s r" with r' + other minor cosmetics
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r--module/plugins/crypter/CzshareComFolder.py3
-rw-r--r--module/plugins/crypter/DuckCryptInfo.py1
-rw-r--r--module/plugins/crypter/FilerNetFolder.py2
-rw-r--r--module/plugins/crypter/FileserveComFolder.py3
-rw-r--r--module/plugins/crypter/ImgurComAlbum.py2
-rw-r--r--module/plugins/crypter/LetitbitNetFolder.py2
-rw-r--r--module/plugins/crypter/LinkSaveIn.py9
-rw-r--r--module/plugins/crypter/MultiUpOrg.py2
-rw-r--r--module/plugins/crypter/NCryptIn.py12
-rw-r--r--module/plugins/crypter/NetfolderIn.py3
-rw-r--r--module/plugins/crypter/QuickshareCzFolder.py2
-rw-r--r--module/plugins/crypter/RelinkUs.py3
-rw-r--r--module/plugins/crypter/SafelinkingNet.py6
-rw-r--r--module/plugins/crypter/ShareLinksBiz.py5
-rw-r--r--module/plugins/crypter/UlozToFolder.py2
15 files changed, 22 insertions, 35 deletions
diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py
index d1ba8335c..c3606fdab 100644
--- a/module/plugins/crypter/CzshareComFolder.py
+++ b/module/plugins/crypter/CzshareComFolder.py
@@ -22,7 +22,8 @@ class CzshareComFolder(Crypter):
new_links = []
found = re.search(self.FOLDER_PATTERN, html, re.DOTALL)
- if found is None: self.fail("Parse error (FOLDER)")
+ if not found:
+ self.fail("Parse error (FOLDER)")
new_links.extend(re.findall(self.LINK_PATTERN, found.group(1)))
if new_links:
diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py
index f44bac2e9..4cd3ec197 100644
--- a/module/plugins/crypter/DuckCryptInfo.py
+++ b/module/plugins/crypter/DuckCryptInfo.py
@@ -32,7 +32,6 @@ class DuckCryptInfo(Crypter):
else:
self.handleFolder(found)
-
def handleFolder(self, found):
src = self.load("http://duckcrypt.info/ajax/auth.php?hash=" + str(found.group(2)))
found = re.match(self.__pattern__, src)
diff --git a/module/plugins/crypter/FilerNetFolder.py b/module/plugins/crypter/FilerNetFolder.py
index 70c932d00..c4cf658bd 100644
--- a/module/plugins/crypter/FilerNetFolder.py
+++ b/module/plugins/crypter/FilerNetFolder.py
@@ -8,7 +8,7 @@ class FilerNetFolder(SimpleCrypter):
__type__ = "crypter"
__version__ = "0.3"
__description__ = """Filer.net decrypter plugin"""
- __pattern__ = r"https?://filer\.net/folder/\w{16}"
+ __pattern__ = r'https?://filer\.net/folder/\w{16}'
__author_name_ = ("nath_schwarz", "stickell")
__author_mail_ = ("nathan.notwhite@gmail.com", "l.stickell@yahoo.it")
diff --git a/module/plugins/crypter/FileserveComFolder.py b/module/plugins/crypter/FileserveComFolder.py
index c3c8b58fe..74d7806e6 100644
--- a/module/plugins/crypter/FileserveComFolder.py
+++ b/module/plugins/crypter/FileserveComFolder.py
@@ -23,7 +23,8 @@ class FileserveComFolder(Crypter):
new_links = []
folder = re.search(self.FOLDER_PATTERN, html, re.DOTALL)
- if folder is None: self.fail("Parse error (FOLDER)")
+ if not folder:
+ self.fail("Parse error (FOLDER)")
new_links.extend(re.findall(self.LINK_PATTERN, folder.group(1)))
diff --git a/module/plugins/crypter/ImgurComAlbum.py b/module/plugins/crypter/ImgurComAlbum.py
index 267f92e1a..79306fc6c 100644
--- a/module/plugins/crypter/ImgurComAlbum.py
+++ b/module/plugins/crypter/ImgurComAlbum.py
@@ -9,7 +9,7 @@ class ImgurComAlbum(SimpleCrypter):
__type__ = "crypter"
__version__ = "0.4"
__description__ = """Imgur.com decrypter plugin"""
- __pattern__ = r"https?://(?:www\.|m\.)?imgur\.com/(a|gallery|)/?\w{5,7}"
+ __pattern__ = r'https?://(?:www\.|m\.)?imgur\.com/(a|gallery|)/?\w{5,7}'
__author_name_ = "nath_schwarz"
__author_mail_ = "nathan.notwhite@gmail.com"
diff --git a/module/plugins/crypter/LetitbitNetFolder.py b/module/plugins/crypter/LetitbitNetFolder.py
index 8e994984b..8ae2ad118 100644
--- a/module/plugins/crypter/LetitbitNetFolder.py
+++ b/module/plugins/crypter/LetitbitNetFolder.py
@@ -22,7 +22,7 @@ class LetitbitNetFolder(Crypter):
new_links = []
folder = re.search(self.FOLDER_PATTERN, html, re.DOTALL)
- if folder is None:
+ if not folder:
self.fail("Parse error (FOLDER)")
new_links.extend(re.findall(self.LINK_PATTERN, folder.group(0)))
diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py
index 13277e3f3..e4497eb09 100644
--- a/module/plugins/crypter/LinkSaveIn.py
+++ b/module/plugins/crypter/LinkSaveIn.py
@@ -37,7 +37,6 @@ class LinkSaveIn(Crypter):
self.preferred_sources = ['cnl2', 'rsdf', 'ccf', 'dlc', 'web']
def decrypt(self, pyfile):
-
# Init
self.package = pyfile.package()
self.fileid = re.match(self.__pattern__, pyfile.url).group('id')
@@ -124,11 +123,11 @@ class LinkSaveIn(Crypter):
self.correctCaptcha()
def handleLinkSource(self, type_):
- if type_ == 'cnl2':
+ if type_ == "cnl2":
return self.handleCNL2()
- elif type_ in ('rsdf', 'ccf', 'dlc'):
+ elif type_ in ("rsdf", "ccf", "dlc"):
return self.handleContainer(type_)
- elif type_ == 'web':
+ elif type_ == "web":
return self.handleWebLinks()
else:
self.fail('unknown source type "%s" (this is probably a bug)' % type_)
@@ -189,7 +188,6 @@ class LinkSaveIn(Crypter):
return package_links
def _getCipherParams(self):
-
# Get jk
jk_re = r'<INPUT.*?NAME="%s".*?VALUE="(.*?)"' % LinkSaveIn._JK_KEY_
vjk = re.findall(jk_re, self.html)
@@ -203,7 +201,6 @@ class LinkSaveIn(Crypter):
return vcrypted, vjk
def _getLinks(self, crypted, jk):
-
# Get key
jreturn = self.js.eval("%s f()" % jk)
self.logDebug("JsEngine returns value [%s]" % jreturn)
diff --git a/module/plugins/crypter/MultiUpOrg.py b/module/plugins/crypter/MultiUpOrg.py
index a565b3888..d08daaf75 100644
--- a/module/plugins/crypter/MultiUpOrg.py
+++ b/module/plugins/crypter/MultiUpOrg.py
@@ -24,7 +24,7 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class MultiUpOrg(SimpleCrypter):
__name__ = "MultiUpOrg"
__type__ = "crypter"
- __pattern__ = r"http://(?:www\.)?multiup\.org/(en|fr)/(?P<TYPE>project|download|miror)/\w+(/\w+)?"
+ __pattern__ = r'http://(?:www\.)?multiup\.org/(en|fr)/(?P<TYPE>project|download|miror)/\w+(/\w+)?'
__version__ = "0.01"
__description__ = """MultiUp.org crypter plugin"""
__author_name__ = "Walter Purcaro"
diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py
index eacd4aa8d..cadf2760f 100644
--- a/module/plugins/crypter/NCryptIn.py
+++ b/module/plugins/crypter/NCryptIn.py
@@ -32,7 +32,6 @@ class NCryptIn(Crypter):
self.protection_type = None
def decrypt(self, pyfile):
-
# Init
self.package = pyfile.package()
package_links = []
@@ -75,7 +74,7 @@ class NCryptIn(Crypter):
def isSingleLink(self):
link_type = re.match(self.__pattern__, self.pyfile.url).group('type')
- return link_type in ('link', 'frame')
+ return link_type in ("link", "frame")
def requestFolderHome(self):
return self.load(self.pyfile.url, decode=True)
@@ -163,7 +162,6 @@ class NCryptIn(Crypter):
return self.load(self.pyfile.url, post=postData, decode=True)
def handleErrors(self):
-
if self.protection_type == "password":
if "This password is invalid!" in self.cleanedHtml:
self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry")
@@ -178,9 +176,8 @@ class NCryptIn(Crypter):
self.correctCaptcha()
def handleLinkSource(self, link_source_type):
-
# Check for JS engine
- require_js_engine = link_source_type in ('cnl2', 'rsdf', 'ccf', 'dlc')
+ require_js_engine = link_source_type in ("cnl2", "rsdf", "ccf", "dlc")
if require_js_engine and not self.js:
self.logDebug("No JS engine available, skip %s links" % link_source_type)
return []
@@ -190,9 +187,9 @@ class NCryptIn(Crypter):
return self.handleSingleLink()
if link_source_type == 'cnl2':
return self.handleCNL2()
- elif link_source_type in ('rsdf', 'ccf', 'dlc'):
+ elif link_source_type in ("rsdf", "ccf", "dlc"):
return self.handleContainer(link_source_type)
- elif link_source_type == 'web':
+ elif link_source_type == "web":
return self.handleWebLinks()
else:
self.fail('unknown source type "%s" (this is probably a bug)' % link_source_type)
@@ -279,7 +276,6 @@ class NCryptIn(Crypter):
return vcrypted, vjk
def _getLinks(self, crypted, jk):
-
# Get key
jreturn = self.js.eval("%s f()" % jk)
self.logDebug("JsEngine returns value [%s]" % jreturn)
diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py
index 28ee3a9dd..286b9366b 100644
--- a/module/plugins/crypter/NetfolderIn.py
+++ b/module/plugins/crypter/NetfolderIn.py
@@ -23,7 +23,7 @@ class NetfolderIn(SimpleCrypter):
# Check for password protection
if self.isPasswordProtected():
self.html = self.submitPassword()
- if self.html is None:
+ if not self.html:
self.fail("Incorrect password, please set right password on Add package form and retry")
# Get package name and folder
@@ -36,7 +36,6 @@ class NetfolderIn(SimpleCrypter):
self.packages = [(package_name, package_links, folder_name)]
def isPasswordProtected(self):
-
if '<input type="password" name="password"' in self.html:
self.logDebug("Links are password protected")
return True
diff --git a/module/plugins/crypter/QuickshareCzFolder.py b/module/plugins/crypter/QuickshareCzFolder.py
index 13d7671bf..a412a5d18 100644
--- a/module/plugins/crypter/QuickshareCzFolder.py
+++ b/module/plugins/crypter/QuickshareCzFolder.py
@@ -21,7 +21,7 @@ class QuickshareCzFolder(Crypter):
new_links = []
found = re.search(self.FOLDER_PATTERN, html, re.DOTALL)
- if found is None:
+ if not found:
self.fail("Parse error (FOLDER)")
new_links.extend(re.findall(self.LINK_PATTERN, found.group(1)))
diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py
index f6503374f..f5c158d2e 100644
--- a/module/plugins/crypter/RelinkUs.py
+++ b/module/plugins/crypter/RelinkUs.py
@@ -51,7 +51,6 @@ class RelinkUs(Crypter):
self.captcha = False
def decrypt(self, pyfile):
-
# Init
self.initPackage(pyfile)
@@ -226,7 +225,6 @@ class RelinkUs(Crypter):
return package_links
def _getCipherParams(self, cnl2_form):
-
# Get jk
jk_re = self.CNL2_FORMINPUT_REGEX % self.CNL2_JK_KEY
vjk = re.findall(jk_re, cnl2_form, re.IGNORECASE)
@@ -240,7 +238,6 @@ class RelinkUs(Crypter):
return vcrypted, vjk
def _getLinks(self, crypted, jk):
-
# Get key
jreturn = self.js.eval("%s f()" % jk)
self.logDebug("JsEngine returns value [%s]" % jreturn)
diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py
index 4a907c28d..cb2617168 100644
--- a/module/plugins/crypter/SafelinkingNet.py
+++ b/module/plugins/crypter/SafelinkingNet.py
@@ -10,10 +10,10 @@ from module.lib.BeautifulSoup import BeautifulSoup
class SafelinkingNet(Crypter):
- __name__ = 'SafelinkingNet'
- __type__ = 'crypter'
+ __name__ = "SafelinkingNet"
+ __type__ = "crypter"
__pattern__ = r'https?://(?:www\.)?safelinking.net/([pd])/\w+'
- __version__ = '0.1'
+ __version__ = "0.1"
__description__ = """Safelinking.net decrypter plugin"""
__author_name__ = "quareevo"
__author_mail__ = "quareevo@arcor.de"
diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py
index bd23d4751..4ea5955db 100644
--- a/module/plugins/crypter/ShareLinksBiz.py
+++ b/module/plugins/crypter/ShareLinksBiz.py
@@ -25,7 +25,6 @@ class ShareLinksBiz(Crypter):
self.captcha = False
def decrypt(self, pyfile):
-
# Init
self.initFile(pyfile)
@@ -111,7 +110,7 @@ class ShareLinksBiz(Crypter):
# Resolve captcha
href = self._resolveCoords(coords, captchaMap)
- if href is None:
+ if not href:
self.logDebug("Invalid captcha resolving, retrying")
self.invalidCaptcha()
self.setWait(5, False)
@@ -223,7 +222,6 @@ class ShareLinksBiz(Crypter):
return package_links
def _getCipherParams(self):
-
# Request CNL2
code = re.search(r'ClicknLoad.swf\?code=(.*?)"', self.html).group(1)
url = "%s/get/cnl2/%s" % (self.baseUrl, code)
@@ -244,7 +242,6 @@ class ShareLinksBiz(Crypter):
return crypted, jk
def _getLinks(self, crypted, jk):
-
# Get key
jreturn = self.js.eval("%s f()" % jk)
self.logDebug("JsEngine returns value [%s]" % jreturn)
diff --git a/module/plugins/crypter/UlozToFolder.py b/module/plugins/crypter/UlozToFolder.py
index eebb14497..6c7729fee 100644
--- a/module/plugins/crypter/UlozToFolder.py
+++ b/module/plugins/crypter/UlozToFolder.py
@@ -24,7 +24,7 @@ class UlozToFolder(Crypter):
for i in xrange(1, 100):
self.logInfo("Fetching links from page %i" % i)
found = re.search(self.FOLDER_PATTERN, html, re.DOTALL)
- if found is None:
+ if not found:
self.fail("Parse error (FOLDER)")
new_links.extend(re.findall(self.LINK_PATTERN, found.group(1)))