summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter/LinkSaveIn.py
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/crypter/LinkSaveIn.py
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/crypter/LinkSaveIn.py')
-rw-r--r--module/plugins/crypter/LinkSaveIn.py23
1 files changed, 10 insertions, 13 deletions
diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py
index 85dde6c87..060a434d2 100644
--- a/module/plugins/crypter/LinkSaveIn.py
+++ b/module/plugins/crypter/LinkSaveIn.py
@@ -1,10 +1,7 @@
# -*- coding: utf-8 -*-
-
#
-# v2.01 - hagg
# * cnl2 and web links are skipped if JS is not available (instead of failing the package)
# * only best available link source is used (priority: cnl2>rsdf>ccf>dlc>web
-#
import base64
import binascii
@@ -18,8 +15,10 @@ from module.unescape import unescape
class LinkSaveIn(Crypter):
__name__ = "LinkSaveIn"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?linksave.in/(?P<id>\w+)$'
__version__ = "2.01"
+
+ __pattern__ = r'http://(?:www\.)?linksave.in/(?P<id>\w+)$'
+
__description__ = """LinkSave.in decrypter plugin"""
__author_name__ = "fragonib"
__author_mail__ = "fragonib[AT]yahoo[DOT]es"
@@ -27,21 +26,21 @@ class LinkSaveIn(Crypter):
# Constants
_JK_KEY_ = "jk"
_CRYPTED_KEY_ = "crypted"
- HOSTER_DOMAIN = "linksave.in"
+ HOSTER_NAME = "linksave.in"
+
def setup(self):
self.html = None
self.fileid = None
self.captcha = False
self.package = None
- self.preferred_sources = ['cnl2', 'rsdf', 'ccf', 'dlc', 'web']
+ 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')
- self.req.cj.setCookie(self.HOSTER_DOMAIN, "Linksave_Language", "english")
+ self.req.cj.setCookie(self.HOSTER_NAME, "Linksave_Language", "english")
# Request package
self.html = self.load(pyfile.url)
@@ -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)