summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/crypter/LinkSaveIn.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-05 13:32:36 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-05 13:32:36 +0200
commitd1e2da48ff1158c84bab62aba3e62ff16f24f124 (patch)
tree14c2b461b84ab1c07ab39fbe3a80aa69c7b4c8ef /pyload/plugins/crypter/LinkSaveIn.py
parentFix refs on hook plugins + add missing __init__ files (diff)
parentRemove old Ev0InFetcher hook (diff)
downloadpyload-d1e2da48ff1158c84bab62aba3e62ff16f24f124.tar.xz
Merge branch 'stable' into 0.4.10
Conflicts: module/plugins/internal/CaptchaService.py pyload/plugins/account/CyberlockerCh.py pyload/plugins/account/EgoFilesCom.py pyload/plugins/account/HotfileCom.py pyload/plugins/crypter/HotfileFolderCom.py pyload/plugins/crypter/LinkSaveIn.py pyload/plugins/crypter/OneKhDe.py pyload/plugins/hoster/EgoFilesCom.py pyload/plugins/internal/XFSPAccount.py
Diffstat (limited to 'pyload/plugins/crypter/LinkSaveIn.py')
-rw-r--r--pyload/plugins/crypter/LinkSaveIn.py26
1 files changed, 21 insertions, 5 deletions
diff --git a/pyload/plugins/crypter/LinkSaveIn.py b/pyload/plugins/crypter/LinkSaveIn.py
index fcc526092..f5c28e28e 100644
--- a/pyload/plugins/crypter/LinkSaveIn.py
+++ b/pyload/plugins/crypter/LinkSaveIn.py
@@ -8,14 +8,15 @@ import binascii
import re
from Crypto.Cipher import AES
-from pyload.plugins.base.Crypter import Crypter
+
+from pyload.plugins.internal.SimpleCrypter import SimpleCrypter
from pyload.utils import html_unescape
-class LinkSaveIn(Crypter):
+class LinkSaveIn(SimpleCrypter):
__name__ = "LinkSaveIn"
__type__ = "crypter"
- __version__ = "2.01"
+ __version__ = "2.02"
__pattern__ = r'http://(?:www\.)?linksave.in/(?P<id>\w+)$'
@@ -23,10 +24,12 @@ class LinkSaveIn(Crypter):
__author_name__ = "fragonib"
__author_mail__ = "fragonib[AT]yahoo[DOT]es"
+
+ COOKIES = [(".linksave.in", "Linksave_Language", "english")]
+
# Constants
_JK_KEY_ = "jk"
_CRYPTED_KEY_ = "crypted"
- HOSTER_NAME = "linksave.in"
def setup(self):
@@ -36,11 +39,11 @@ class LinkSaveIn(Crypter):
self.package = None
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_NAME, "Linksave_Language", "english")
# Request package
self.html = self.load(pyfile.url)
@@ -74,41 +77,48 @@ class LinkSaveIn(Crypter):
else:
self.fail('Could not extract any links')
+
def isOnline(self):
if "<big>Error 404 - Folder not found!</big>" in self.html:
self.logDebug("File not found")
return False
return True
+
def isPasswordProtected(self):
if re.search(r'''<input.*?type="password"''', self.html):
self.logDebug("Links are password protected")
return True
+
def isCaptchaProtected(self):
if "<b>Captcha:</b>" in self.html:
self.logDebug("Links are captcha protected")
return True
return False
+
def unlockPasswordProtection(self):
password = self.getPassword()
self.logDebug("Submitting password [%s] for protected links" % password)
post = {"id": self.fileid, "besucherpasswort": password, 'login': 'submit'}
self.html = self.load(self.pyfile.url, post=post)
+
def unlockCaptchaProtection(self):
captcha_hash = re.search(r'name="hash" value="([^"]+)', self.html).group(1)
captcha_url = re.search(r'src=".(/captcha/cap.php\?hsh=[^"]+)', self.html).group(1)
captcha_code = self.decryptCaptcha("http://linksave.in" + captcha_url, forceUser=True)
self.html = self.load(self.pyfile.url, post={"id": self.fileid, "hash": captcha_hash, "code": captcha_code})
+
def getPackageInfo(self):
name = self.pyfile.package().name
folder = self.pyfile.package().folder
self.logDebug("Defaulting to pyfile name [%s] and folder [%s] for package" % (name, folder))
return name, folder
+
def handleErrors(self):
if "The visitorpassword you have entered is wrong" in self.html:
self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry")
@@ -122,6 +132,7 @@ class LinkSaveIn(Crypter):
else:
self.correctCaptcha()
+
def handleLinkSource(self, type_):
if type_ == "cnl2":
return self.handleCNL2()
@@ -132,6 +143,7 @@ class LinkSaveIn(Crypter):
else:
self.fail('unknown source type "%s" (this is probably a bug)' % type_)
+
def handleWebLinks(self):
package_links = []
self.logDebug("Search for Web links")
@@ -159,6 +171,7 @@ class LinkSaveIn(Crypter):
self.logDebug("Error decrypting Web link %s, %s" % (webLink, detail))
return package_links
+
def handleContainer(self, type_):
package_links = []
type_ = type_.lower()
@@ -173,6 +186,7 @@ class LinkSaveIn(Crypter):
package_links.append(link)
return package_links
+
def handleCNL2(self):
package_links = []
self.logDebug("Search for CNL2 links")
@@ -187,6 +201,7 @@ class LinkSaveIn(Crypter):
self.fail("Unable to decrypt CNL2 links")
return package_links
+
def _getCipherParams(self):
# Get jk
jk_re = r'<INPUT.*?NAME="%s".*?VALUE="(.*?)"' % LinkSaveIn._JK_KEY_
@@ -200,6 +215,7 @@ class LinkSaveIn(Crypter):
self.logDebug("Detected %d crypted blocks" % len(vcrypted))
return vcrypted, vjk
+
def _getLinks(self, crypted, jk):
# Get key
jreturn = self.js.eval("%s f()" % jk)