summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Arno-Nymous <Arno-Nymous@users.noreply.github.com> 2016-01-21 13:37:46 +0100
committerGravatar Arno-Nymous <Arno-Nymous@users.noreply.github.com> 2016-01-21 13:37:46 +0100
commitd7801dc862e99d5a9b2d988f65c4a61705bf9882 (patch)
treee92fe94a552c62e28495db97d0bf6555361ea70c /module
parent[Acount] fix account refresh (2) (diff)
downloadpyload-d7801dc862e99d5a9b2d988f65c4a61705bf9882.tar.xz
[LinkCryptWs] Small fixes
Add one missing `self` and fix download link parsing. While on it, also replace oudated `%` string formatting operator with recommended `.format()` method. See [PEP 3101](https://www.python.org/dev/peps/pep-3101/).
Diffstat (limited to 'module')
-rw-r--r--module/plugins/crypter/LinkCryptWs.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/module/plugins/crypter/LinkCryptWs.py b/module/plugins/crypter/LinkCryptWs.py
index 0cdfa1e34..cfb888074 100644
--- a/module/plugins/crypter/LinkCryptWs.py
+++ b/module/plugins/crypter/LinkCryptWs.py
@@ -40,7 +40,7 @@ class LinkCryptWs(Crypter):
#: Init
self.fileid = re.match(self.__pattern__, self.pyfile.url).group('ID')
- set_cookie(req.cj, "linkcrypt.ws", "language", "en")
+ set_cookie(self.req.cj, "linkcrypt.ws", "language", "en")
#: Request package
self.req.http.c.setopt(pycurl.USERAGENT, "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko") #: Better chance to not get those key-captchas
@@ -125,7 +125,7 @@ class LinkCryptWs(Crypter):
password = self.get_password()
if password:
- self.log_debug("Submitting password [%s] for protected links" % password)
+ self.log_debug("Submitting password [{0}] for protected links".format(password))
self.data = self.load(self.pyfile.url, post={'password': password, 'x': "0", 'y': "0"})
else:
self.fail(_("Folder is password protected"))
@@ -142,7 +142,7 @@ class LinkCryptWs(Crypter):
name = self.pyfile.package().name
folder = self.pyfile.package().folder
- self.log_debug("Defaulting to pyfile name [%s] and folder [%s] for package" % (name, folder))
+ self.log_debug("Defaulting to pyfile name [{0}] and folder [{1}] for package".format(name, folder))
return name, folder
@@ -186,13 +186,13 @@ class LinkCryptWs(Crypter):
pattern = r'<form action="http://linkcrypt.ws/out.html"[^>]*?>.*?<input[^>]*?value="(.+?)"[^>]*?name="file"'
ids = re.findall(pattern, self.data, re.I | re.S)
- self.log_debug("Decrypting %d Web links" % len(ids))
+ self.log_debug("Decrypting {0} Web links".format(len(ids)))
for idx, weblink_id in enumerate(ids):
try:
res = self.load("http://linkcrypt.ws/out.html", post = {'file':weblink_id})
- indexs = res.find("var url = ") + 11
+ indexs = res.find("href=doNotTrack('") + 17
indexe = res.find("'", indexs)
link2 = res[indexs:indexe]
@@ -201,7 +201,7 @@ class LinkCryptWs(Crypter):
pack_links.append(link2)
except Exception, detail:
- self.log_debug("Error decrypting Web link %s, %s" % (weblink_id, detail))
+ self.log_debug("Error decrypting Web link {0}, {1}".format(weblink_id, detail))
return pack_links
@@ -241,7 +241,7 @@ class LinkCryptWs(Crypter):
self.log_debug("clink found")
pack_name, folder_name = self.get_package_info()
- self.log_debug("Added package with name %s.%s and container link %s" %( pack_name, type, clink.group(1)))
+ self.log_debug("Added package with name {0}.{1} and container link {2}".format(pack_name, type, clink.group(1)))
self.pyload.api.uploadContainer('.'.join([pack_name, type]), self.load(clink.group(1)))
return "Found it"
@@ -285,7 +285,7 @@ class LinkCryptWs(Crypter):
vcrypted = re.findall(crypted_re, cnl_section)
#: Log and return
- self.log_debug("Detected %d crypted blocks" % len(vcrypted))
+ self.log_debug("Detected {0} crypted blocks".format(len(vcrypted)))
return vcrypted, vjk
@@ -293,7 +293,7 @@ class LinkCryptWs(Crypter):
#: Get key
key = binascii.unhexlify(jk)
- self.log_debug("JsEngine returns value [%s]" % key)
+ self.log_debug("JsEngine returns value [{0}]".format(key))
#: Decrypt
Key = key
@@ -306,6 +306,6 @@ class LinkCryptWs(Crypter):
links = filter(bool, text.split('\n'))
#: Log and return
- self.log_debug("Package has %d links" % len(links))
+ self.log_debug("Package has {0} links".format(len(links)))
return links