summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r--module/plugins/crypter/FilecryptCc.py8
-rw-r--r--module/plugins/crypter/LinkCryptWs.py26
-rw-r--r--module/plugins/crypter/MediafireComFolder.py17
-rw-r--r--module/plugins/crypter/NCryptIn.py46
-rw-r--r--module/plugins/crypter/NitroflareComFolder.py11
-rw-r--r--module/plugins/crypter/PastedCo.py6
-rw-r--r--module/plugins/crypter/RelinkUs.py32
-rw-r--r--module/plugins/crypter/SafelinkingNet.py2
-rw-r--r--module/plugins/crypter/SexuriaCom.py8
-rw-r--r--module/plugins/crypter/ShareLinksBiz.py32
10 files changed, 95 insertions, 93 deletions
diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py
index c2fca1ab4..517dc7652 100644
--- a/module/plugins/crypter/FilecryptCc.py
+++ b/module/plugins/crypter/FilecryptCc.py
@@ -119,7 +119,7 @@ class FilecryptCc(Crypter):
elif m3: #: Solvemedia captcha
self.log_debug("Solvemedia Captcha URL: %s" % urlparse.urljoin(self.pyfile.url, m3.group(1)))
- solvemedia = SolveMedia(self)
+ solvemedia = SolveMedia(self.pyfile)
captcha_key = solvemedia.detect_key()
if captcha_key:
@@ -134,12 +134,12 @@ class FilecryptCc(Crypter):
self.retry()
else:
- recaptcha = ReCaptcha(self)
- captcha_key = self.captcha.detect_key()
+ recaptcha = ReCaptcha(self.pyfile)
+ captcha_key = recaptcha.detect_key()
if captcha_key:
self.captcha = recaptcha
-
+
try:
response, challenge = recaptcha.challenge(captcha_key)
diff --git a/module/plugins/crypter/LinkCryptWs.py b/module/plugins/crypter/LinkCryptWs.py
index 65b671c11..ea8103ad7 100644
--- a/module/plugins/crypter/LinkCryptWs.py
+++ b/module/plugins/crypter/LinkCryptWs.py
@@ -72,7 +72,7 @@ class LinkCryptWs(Crypter):
self.getunrarpw()
#: Get package name and folder
- package_name, folder_name = self.get_package_info()
+ pack_name, folder_name = self.get_package_info()
#: Get the container definitions from script section
self.get_container_html()
@@ -86,7 +86,7 @@ class LinkCryptWs(Crypter):
break
if self.urls:
- self.packages = [(package_name, self.urls, folder_name)]
+ self.packages = [(pack_name, self.urls, folder_name)]
def is_online(self):
@@ -187,7 +187,7 @@ class LinkCryptWs(Crypter):
def handle_web_links(self):
self.log_debug("Search for Web links ")
- package_links = []
+ pack_links = []
pattern = r'<form action="http://linkcrypt.ws/out.html"[^>]*?>.*?<input[^>]*?value="(.+?)"[^>]*?name="file"'
ids = re.findall(pattern, self.data, re.I | re.S)
@@ -203,12 +203,12 @@ class LinkCryptWs(Crypter):
link2 = res[indexs:indexe]
link2 = html_unescape(link2)
- package_links.append(link2)
+ pack_links.append(link2)
except Exception, detail:
self.log_debug("Error decrypting Web link %s, %s" % (weblink_id, detail))
- return package_links
+ return pack_links
def get_container_html(self):
@@ -227,7 +227,7 @@ class LinkCryptWs(Crypter):
def handle_container(self, type):
- package_links = []
+ pack_links = []
type = type.lower()
self.log_debug('Search for %s Container links' % type.upper())
@@ -245,18 +245,18 @@ class LinkCryptWs(Crypter):
self.log_debug("clink found")
- package_name, folder_name = self.get_package_info()
- self.log_debug("Added package with name %s.%s and container link %s" %( package_name, type, clink.group(1)))
- self.pyload.api.uploadContainer('.'.join([package_name, type]), self.load(clink.group(1)))
+ 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.pyload.api.uploadContainer('.'.join([pack_name, type]), self.load(clink.group(1)))
return "Found it"
- return package_links
+ return pack_links
def handle_CNL2(self):
self.log_debug("Search for CNL links")
- package_links = []
+ pack_links = []
cnl_line = None
for line in self.container_html:
@@ -271,13 +271,13 @@ class LinkCryptWs(Crypter):
cnl_section = self.handle_javascript(cnl_line)
(vcrypted, vjk) = self._get_cipher_params(cnl_section)
for (crypted, jk) in zip(vcrypted, vjk):
- package_links.extend(self._get_links(crypted, jk))
+ pack_links.extend(self._get_links(crypted, jk))
except Exception:
self.log_error(_("Unable to decrypt CNL links (JS Error) try to get over links"), trace=True)
return self.handle_web_links()
- return package_links
+ return pack_links
def _get_cipher_params(self, cnl_section):
diff --git a/module/plugins/crypter/MediafireComFolder.py b/module/plugins/crypter/MediafireComFolder.py
index 464552c97..d75b5946a 100644
--- a/module/plugins/crypter/MediafireComFolder.py
+++ b/module/plugins/crypter/MediafireComFolder.py
@@ -73,16 +73,17 @@ class MediafireComFolder(Crypter):
folder_key = m.group(1)
self.log_debug("FOLDER KEY: %s" % folder_key)
- json_resp = json.loads(self.load("http://www.mediafire.com/api/folder/get_info.php",
- get={'folder_key' : folder_key,
- 'response_format': "json",
- 'version' : 1}))
- # self.log_info(json_resp)
- if json_resp['response']['result'] == "Success":
- for link in json_resp['response']['folder_info']['files']:
+ html = self.load("http://www.mediafire.com/api/folder/get_info.php",
+ get={'folder_key' : folder_key,
+ 'response_format': "json",
+ 'version' : 1})
+ json_data = json.loads(html)
+ # self.log_info(json_data)
+ if json_data['response']['result'] == "Success":
+ for link in json_data['response']['folder_info']['files']:
self.links.append("http://www.mediafire.com/file/%s" % link['quickkey'])
else:
- self.fail(json_resp['response']['message'])
+ self.fail(json_data['response']['message'])
elif result is 1:
self.offline()
diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py
index 2ebdd5de8..c0e48ba25 100644
--- a/module/plugins/crypter/NCryptIn.py
+++ b/module/plugins/crypter/NCryptIn.py
@@ -43,13 +43,13 @@ class NCryptIn(Crypter):
def decrypt(self, pyfile):
#: Init
self.package = pyfile.package()
- package_links = []
- package_name = self.package.name
+ pack_links = []
+ pack_name = self.package.name
folder_name = self.package.folder
#: Deal with single links
if self.is_single_link():
- package_links.extend(self.handle_single_link())
+ pack_links.extend(self.handle_single_link())
#: Deal with folders
else:
@@ -67,18 +67,18 @@ class NCryptIn(Crypter):
self.handle_errors()
#: Prepare package name and folder
- (package_name, folder_name) = self.get_package_info()
+ (pack_name, folder_name) = self.get_package_info()
#: Extract package links
for link_source_type in self.links_source_order:
- package_links.extend(self.handle_link_source(link_source_type))
- if package_links: #: Use only first source which provides links
+ pack_links.extend(self.handle_link_source(link_source_type))
+ if pack_links: #: Use only first source which provides links
break
- package_links = set(package_links)
+ pack_links = set(pack_links)
#: Pack and return links
- if package_links:
- self.packages = [(package_name, package_links, folder_name)]
+ if pack_links:
+ self.packages = [(pack_name, pack_links, folder_name)]
def is_single_link(self):
@@ -157,8 +157,8 @@ class NCryptIn(Crypter):
self.log_debug("ReCaptcha protected")
captcha_key = re.search(r'\?k=(.*?)"', form).group(1)
self.log_debug("Resolving ReCaptcha with key [%s]" % captcha_key)
- recaptcha = ReCaptcha(self)
- response, challenge = recaptcha.challenge(captcha_key)
+ self.captcha = ReCaptcha(self.pyfile)
+ response, challenge = self.captcha.challenge(captcha_key)
postData['recaptcha_challenge_field'] = challenge
postData['recaptcha_response_field'] = response
@@ -210,44 +210,44 @@ class NCryptIn(Crypter):
def handle_single_link(self):
self.log_debug("Handling Single link")
- package_links = []
+ pack_links = []
#: Decrypt single link
decrypted_link = self.decrypt_link(self.pyfile.url)
if decrypted_link:
- package_links.append(decrypted_link)
+ pack_links.append(decrypted_link)
- return package_links
+ return pack_links
def handle_CNL2(self):
self.log_debug("Handling CNL2 links")
- package_links = []
+ pack_links = []
if 'cnl2_output' in self.cleaned_html:
try:
(vcrypted, vjk) = self._get_cipher_params()
for (crypted, jk) in zip(vcrypted, vjk):
- package_links.extend(self._get_links(crypted, jk))
+ pack_links.extend(self._get_links(crypted, jk))
except Exception:
self.fail(_("Unable to decrypt CNL2 links"))
- return package_links
+ return pack_links
def handle_containers(self):
self.log_debug("Handling Container links")
- package_links = []
+ pack_links = []
pattern = r'/container/(rsdf|dlc|ccf)/(\w+)'
containersLinks = re.findall(pattern, self.data)
self.log_debug("Decrypting %d Container links" % len(containersLinks))
for containerLink in containersLinks:
link = "http://ncrypt.in/container/%s/%s.%s" % (containerLink[0], containerLink[1], containerLink[0])
- package_links.append(link)
+ pack_links.append(link)
- return package_links
+ return pack_links
def handle_web_links(self):
@@ -255,15 +255,15 @@ class NCryptIn(Crypter):
pattern = r'(http://ncrypt\.in/link-.*?=)'
links = re.findall(pattern, self.data)
- package_links = []
+ pack_links = []
self.log_debug("Decrypting %d Web links" % len(links))
for i, link in enumerate(links):
self.log_debug("Decrypting Web link %d, %s" % (i + 1, link))
decrypted_link = self.decrypt(link)
if decrypted_link:
- package_links.append(decrypted_link)
+ pack_links.append(decrypted_link)
- return package_links
+ return pack_links
def decrypt_link(self, link):
diff --git a/module/plugins/crypter/NitroflareComFolder.py b/module/plugins/crypter/NitroflareComFolder.py
index 80d0e9270..db80c4234 100644
--- a/module/plugins/crypter/NitroflareComFolder.py
+++ b/module/plugins/crypter/NitroflareComFolder.py
@@ -23,11 +23,12 @@ class NitroflareComFolder(SimpleCrypter):
def get_links(self):
- res = json.loads(self.load("http://nitroflare.com/ajax/folder.php",
- post={'userId' : self.info['pattern']['USER'],
- 'folder' : self.info['pattern']['ID'],
- 'page' : 1,
- 'perPage': 10000}))
+ html = self.load("http://nitroflare.com/ajax/folder.php",
+ post={'userId' : self.info['pattern']['USER'],
+ 'folder' : self.info['pattern']['ID'],
+ 'page' : 1,
+ 'perPage': 10000})
+ res = json.loads(html)
if res['name']:
self.pyfile.name = res['name']
else:
diff --git a/module/plugins/crypter/PastedCo.py b/module/plugins/crypter/PastedCo.py
index ac55049fc..f6988ed11 100644
--- a/module/plugins/crypter/PastedCo.py
+++ b/module/plugins/crypter/PastedCo.py
@@ -27,8 +27,8 @@ class PastedCo(Crypter):
def decrypt(self, pyfile):
package = pyfile.package()
- package_name = package.name
- package_folder = package.folder
+ pack_name = package.name
+ pack_folder = package.folder
html = self.load(pyfile.url, decode = True).splitlines()
fs_url = None
FS_URL_RE = re.compile('%s/fullscreen\.php\?hash=[0-9a-f]*' % pyfile.url)
@@ -42,4 +42,4 @@ class PastedCo(Crypter):
urls = self.load(fs_url, decode = True)
urls = urls[urls.find(PastedCo.FS_URL_PREFIX) + len(PastedCo.FS_URL_PREFIX):]
urls = urls[:urls.find(PastedCo.FS_URL_SUFFIX)].splitlines()
- self.packages.append((package_name, urls, package_folder))
+ self.packages.append((pack_name, urls, pack_folder))
diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py
index 13bb0d0b2..16a0ac234 100644
--- a/module/plugins/crypter/RelinkUs.py
+++ b/module/plugins/crypter/RelinkUs.py
@@ -87,19 +87,19 @@ class RelinkUs(Crypter):
self.handle_errors()
#: Get package name and folder
- (package_name, folder_name) = self.get_package_info()
+ (pack_name, folder_name) = self.get_package_info()
#: Extract package links
- package_links = []
+ pack_links = []
for sources in self.PREFERRED_LINK_SOURCES:
- package_links.extend(self.handle_link_source(sources))
- if package_links: #: Use only first source which provides links
+ pack_links.extend(self.handle_link_source(sources))
+ if pack_links: #: Use only first source which provides links
break
- package_links = set(package_links)
+ pack_links = set(pack_links)
#: Pack
- if package_links:
- self.packages = [(package_name, package_links, folder_name)]
+ if pack_links:
+ self.packages = [(pack_name, pack_links, folder_name)]
def init_package(self, pyfile):
@@ -197,24 +197,24 @@ class RelinkUs(Crypter):
def handle_CNL2Links(self):
self.log_debug("Search for CNL2 links")
- package_links = []
+ pack_links = []
m = re.search(self.CNL2_FORM_REGEX, self.data, re.S)
if m is not None:
cnl2_form = m.group(1)
try:
(vcrypted, vjk) = self._get_cipher_params(cnl2_form)
for (crypted, jk) in zip(vcrypted, vjk):
- package_links.extend(self._get_links(crypted, jk))
+ pack_links.extend(self._get_links(crypted, jk))
except Exception:
self.log_debug("Unable to decrypt CNL2 links", trace=True)
- return package_links
+ return pack_links
def handle_DLC_links(self):
self.log_debug("Search for DLC links")
- package_links = []
+ pack_links = []
m = re.search(self.DLC_LINK_REGEX, self.data)
if m is not None:
container_url = self.DLC_DOWNLOAD_URL + "?id=%s&dlc=1" % self.fileid
@@ -225,18 +225,18 @@ class RelinkUs(Crypter):
dlc_filepath = fsjoin(self.pyload.config.get("general", "download_folder"), dlc_filename)
with open(dlc_filepath, "wb") as f:
f.write(dlc)
- package_links.append(dlc_filepath)
+ pack_links.append(dlc_filepath)
except Exception:
self.fail(_("Unable to download DLC container"))
- return package_links
+ return pack_links
def handle_WEB_links(self):
self.log_debug("Search for WEB links")
- package_links = []
+ pack_links = []
params = re.findall(self.WEB_FORWARD_REGEX, self.data)
self.log_debug("Decrypting %d Web links" % len(params))
@@ -250,14 +250,14 @@ class RelinkUs(Crypter):
res = self.load(url)
link = re.search(self.WEB_LINK_REGEX, res).group(1)
- package_links.append(link)
+ pack_links.append(link)
except Exception, detail:
self.log_debug("Error decrypting Web link %s, %s" % (index, detail))
self.wait(4)
- return package_links
+ return pack_links
def _get_cipher_params(self, cnl2_form):
diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py
index 9ec91b45a..a41d1e8d1 100644
--- a/module/plugins/crypter/SafelinkingNet.py
+++ b/module/plugins/crypter/SafelinkingNet.py
@@ -52,7 +52,7 @@ class SafelinkingNet(Crypter):
m = re.search(self.SOLVEMEDIA_PATTERN, self.data)
if m is not None:
captchaKey = m.group(1)
- captcha = SolveMedia(self)
+ captcha = SolveMedia(pyfile)
captchaProvider = "Solvemedia"
else:
self.fail(_("Error parsing captcha"))
diff --git a/module/plugins/crypter/SexuriaCom.py b/module/plugins/crypter/SexuriaCom.py
index c19f4ffd4..2ae17019e 100644
--- a/module/plugins/crypter/SexuriaCom.py
+++ b/module/plugins/crypter/SexuriaCom.py
@@ -36,10 +36,10 @@ class SexuriaCom(Crypter):
self.package = pyfile.package()
#: Decrypt and add links
- package_name, self.urls, folder_name, package_pwd = self.decrypt_links(self.pyfile.url)
- if package_pwd:
- self.pyfile.package().password = package_pwd
- self.packages = [(package_name, self.urls, folder_name)]
+ pack_name, self.urls, folder_name, pack_pwd = self.decrypt_links(self.pyfile.url)
+ if pack_pwd:
+ self.pyfile.package().password = pack_pwd
+ self.packages = [(pack_name, self.urls, folder_name)]
def decrypt_links(self, url):
diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py
index 12d647e7a..d62eba779 100644
--- a/module/plugins/crypter/ShareLinksBiz.py
+++ b/module/plugins/crypter/ShareLinksBiz.py
@@ -54,17 +54,17 @@ class ShareLinksBiz(Crypter):
self.handle_errors()
#: Extract package links
- package_links = []
- package_links.extend(self.handle_web_links())
- package_links.extend(self.handle_containers())
- package_links.extend(self.handle_CNL2())
- package_links = set(package_links)
+ pack_links = []
+ pack_links.extend(self.handle_web_links())
+ pack_links.extend(self.handle_containers())
+ pack_links.extend(self.handle_CNL2())
+ pack_links = set(pack_links)
#: Get package info
- package_name, package_folder = self.get_package_info()
+ pack_name, pack_folder = self.get_package_info()
#: Pack
- self.packages = [(package_name, package_links, package_folder)]
+ self.packages = [(pack_name, pack_links, pack_folder)]
def init_file(self, pyfile):
@@ -201,7 +201,7 @@ class ShareLinksBiz(Crypter):
def handle_web_links(self):
- package_links = []
+ pack_links = []
self.log_debug("Handling Web links")
#@TODO: Gather paginated web links
@@ -227,16 +227,16 @@ class ShareLinksBiz(Crypter):
self.log_debug("JsEngine returns value [%s] for redirection link" % dlLink)
- package_links.append(dlLink)
+ pack_links.append(dlLink)
except Exception, detail:
self.log_debug("Error decrypting Web link [%s], %s" % (ID, detail))
- return package_links
+ return pack_links
def handle_containers(self):
- package_links = []
+ pack_links = []
self.log_debug("Handling Container links")
pattern = r'javascript:_get\(\'(.*?)\', 0, \'(rsdf|ccf|dlc)\'\)'
@@ -244,23 +244,23 @@ class ShareLinksBiz(Crypter):
self.log_debug("Decrypting %d Container links" % len(containersLinks))
for containerLink in containersLinks:
link = "%s/get/%s/%s" % (self.base_url, containerLink[1], containerLink[0])
- package_links.append(link)
- return package_links
+ pack_links.append(link)
+ return pack_links
def handle_CNL2(self):
- package_links = []
+ pack_links = []
self.log_debug("Handling CNL2 links")
if '/lib/cnl2/ClicknLoad.swf' in self.data:
try:
(crypted, jk) = self._get_cipher_params()
- package_links.extend(self._get_links(crypted, jk))
+ pack_links.extend(self._get_links(crypted, jk))
except Exception:
self.fail(_("Unable to decrypt CNL2 links"))
- return package_links
+ return pack_links
def _get_cipher_params(self):