summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r--module/plugins/crypter/DataHuFolder.py4
-rw-r--r--module/plugins/crypter/DlProtectCom.py2
-rw-r--r--module/plugins/crypter/FilecryptCc.py6
-rw-r--r--module/plugins/crypter/LinkCryptWs.py28
-rw-r--r--module/plugins/crypter/MediafireComFolder.py6
-rw-r--r--module/plugins/crypter/NCryptIn.py48
-rw-r--r--module/plugins/crypter/RelinkUs.py36
-rw-r--r--module/plugins/crypter/SexuriaCom.py14
-rw-r--r--module/plugins/crypter/ShareLinksBiz.py42
-rw-r--r--module/plugins/crypter/YoutubeComFolder.py2
10 files changed, 94 insertions, 94 deletions
diff --git a/module/plugins/crypter/DataHuFolder.py b/module/plugins/crypter/DataHuFolder.py
index fcbc5b2af..0b241bf66 100644
--- a/module/plugins/crypter/DataHuFolder.py
+++ b/module/plugins/crypter/DataHuFolder.py
@@ -28,7 +28,7 @@ class DataHuFolder(SimpleCrypter):
def prepare(self):
super(DataHuFolder, self).prepare()
- if u'K\xe9rlek add meg a jelsz\xf3t' in self.html: # Password protected
+ if u'K\xe9rlek add meg a jelsz\xf3t' in self.html: #: Password protected
password = self.getPassword()
if not password:
self.fail(_("Password required"))
@@ -37,7 +37,7 @@ class DataHuFolder(SimpleCrypter):
self.html = self.load(self.pyfile.url, post={'mappa_pass': password})
- if u'Hib\xe1s jelsz\xf3' in self.html: # Wrong password
+ if u'Hib\xe1s jelsz\xf3' in self.html: #: Wrong password
self.fail(_("Wrong password"))
diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py
index fde43ff43..6ced6a706 100644
--- a/module/plugins/crypter/DlProtectCom.py
+++ b/module/plugins/crypter/DlProtectCom.py
@@ -29,7 +29,7 @@ class DlProtectCom(SimpleCrypter):
def getLinks(self):
- # Direct link with redirect
+ #: Direct link with redirect
if not re.match(r"https?://(?:www\.)?dl-protect\.com/.+", self.req.http.lastEffectiveURL):
return [self.req.http.lastEffectiveURL]
diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py
index 7ca5659fb..769877802 100644
--- a/module/plugins/crypter/FilecryptCc.py
+++ b/module/plugins/crypter/FilecryptCc.py
@@ -160,16 +160,16 @@ class FilecryptCc(Crypter):
def _getLinks(self, crypted, jk):
- # Get key
+ #: Get key
key = binascii.unhexlify(str(jk))
- # Decrypt
+ #: Decrypt
Key = key
IV = key
obj = AES.new(Key, AES.MODE_CBC, IV)
text = obj.decrypt(crypted.decode('base64'))
- # Extract links
+ #: Extract links
text = text.replace("\x00", "").replace("\r", "")
links = filter(bool, text.split('\n'))
diff --git a/module/plugins/crypter/LinkCryptWs.py b/module/plugins/crypter/LinkCryptWs.py
index 28c431e80..b9abb08d2 100644
--- a/module/plugins/crypter/LinkCryptWs.py
+++ b/module/plugins/crypter/LinkCryptWs.py
@@ -36,12 +36,12 @@ class LinkCryptWs(Crypter):
def prepare(self):
- # Init
+ #: Init
self.fileid = re.match(self.__pattern__, self.pyfile.url).group('ID')
self.req.cj.setCookie("linkcrypt.ws", "language", "en")
- # Request package
+ #: 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
self.html = self.load(self.pyfile.url)
@@ -63,21 +63,21 @@ class LinkCryptWs(Crypter):
self.unlockCaptchaProtection()
self.handleCaptchaErrors()
- # Check for protection
+ #: Check for protection
if self.isPasswordProtected():
self.unlockPasswordProtection()
self.handleErrors()
- # get unrar password
+ #: get unrar password
self.getunrarpw()
- # Get package name and folder
+ #: Get package name and folder
package_name, folder_name = self.getPackageInfo()
#get the container definitions from script section
self.get_container_html()
- # Extract package links
+ #: Extract package links
for type in self.sources:
links = self.handleLinkSource(type)
@@ -234,7 +234,7 @@ class LinkCryptWs(Crypter):
self.logDebug('Search for %s Container links' % type.upper())
- if not type.isalnum(): # check to prevent broken re-pattern (cnl2,rsdf,ccf,dlc,web are all alpha-numeric)
+ if not type.isalnum(): #: check to prevent broken re-pattern (cnl2,rsdf,ccf,dlc,web are all alpha-numeric)
self.fail(_("Unknown container type: %s") % type) #@TODO: Replace with self.error in 0.4.10
for line in self.container_html:
@@ -282,37 +282,37 @@ class LinkCryptWs(Crypter):
def _getCipherParams(self, cnl_section):
- # Get jk
+ #: Get jk
jk_re = r'<INPUT.*?NAME="%s".*?VALUE="(.*?)"' % LinkCryptWs.JK_KEY
vjk = re.findall(jk_re, cnl_section)
- # Get crypted
+ #: Get crypted
crypted_re = r'<INPUT.*?NAME="%s".*?VALUE="(.*?)"' % LinkCryptWs.CRYPTED_KEY
vcrypted = re.findall(crypted_re, cnl_section)
- # Log and return
+ #: Log and return
self.logDebug("Detected %d crypted blocks" % len(vcrypted))
return vcrypted, vjk
def _getLinks(self, crypted, jk):
- # Get key
+ #: Get key
jreturn = self.js.eval("%s f()" % jk)
key = binascii.unhexlify(jreturn)
self.logDebug("JsEngine returns value [%s]" % jreturn)
- # Decrypt
+ #: Decrypt
Key = key
IV = key
obj = AES.new(Key, AES.MODE_CBC, IV)
text = obj.decrypt(crypted.decode('base64'))
- # Extract links
+ #: Extract links
text = text.replace("\x00", "").replace("\r", "")
links = filter(bool, text.split('\n'))
- # Log and return
+ #: Log and return
self.logDebug("Package has %d links" % len(links))
return links
diff --git a/module/plugins/crypter/MediafireComFolder.py b/module/plugins/crypter/MediafireComFolder.py
index c3b1c7e9f..dd23df7ca 100644
--- a/module/plugins/crypter/MediafireComFolder.py
+++ b/module/plugins/crypter/MediafireComFolder.py
@@ -29,14 +29,14 @@ class MediafireComFolder(Crypter):
self.logDebug("Location (%d): %s" % (result, url))
if result == 0:
- # load and parse html
+ #: load and parse html
html = self.load(pyfile.url)
m = re.search(self.LINK_PATTERN, html)
if m:
- # file page
+ #: file page
self.urls.append("http://www.mediafire.com/file/%s" % m.group(1))
else:
- # folder page
+ #: folder page
m = re.search(self.FOLDER_KEY_PATTERN, html)
if m:
folder_key = m.group(1)
diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py
index f92f47e99..ec43d7fa9 100644
--- a/module/plugins/crypter/NCryptIn.py
+++ b/module/plugins/crypter/NCryptIn.py
@@ -38,42 +38,42 @@ class NCryptIn(Crypter):
def decrypt(self, pyfile):
- # Init
+ #: Init
self.package = pyfile.package()
package_links = []
package_name = self.package.name
folder_name = self.package.folder
- # Deal with single links
+ #: Deal with single links
if self.isSingleLink():
package_links.extend(self.handleSingleLink())
- # Deal with folders
+ #: Deal with folders
else:
- # Request folder home
+ #: Request folder home
self.html = self.requestFolderHome()
self.cleanedHtml = self.removeHtmlCrap(self.html)
if not self.isOnline():
self.offline()
- # Check for folder protection
+ #: Check for folder protection
if self.isProtected():
self.html = self.unlockProtection()
self.cleanedHtml = self.removeHtmlCrap(self.html)
self.handleErrors()
- # Prepare package name and folder
+ #: Prepare package name and folder
(package_name, folder_name) = self.getPackageInfo()
- # Extract package links
+ #: Extract package links
for link_source_type in self.links_source_order:
package_links.extend(self.handleLinkSource(link_source_type))
- if package_links: # use only first source which provides links
+ if package_links: #: use only first source which provides links
break
package_links = set(package_links)
- # Pack and return links
+ #: Pack and return links
if package_links:
self.packages = [(package_name, package_links, folder_name)]
@@ -135,13 +135,13 @@ class NCryptIn(Crypter):
form = re.search(r'<form name="protected"(.*?)</form>', self.cleanedHtml, re.S).group(1)
- # Submit package password
+ #: Submit package password
if "password" in form:
password = self.getPassword()
self.logDebug("Submitting password [%s] for protected links" % password)
postData['password'] = password
- # Resolve anicaptcha
+ #: Resolve anicaptcha
if "anicaptcha" in form:
self.logDebug("Captcha protected")
captchaUri = re.search(r'src="(/temp/anicaptcha/.+?)"', form).group(1)
@@ -149,7 +149,7 @@ class NCryptIn(Crypter):
self.logDebug("Captcha resolved [%s]" % captcha)
postData['captcha'] = captcha
- # Resolve recaptcha
+ #: Resolve recaptcha
if "recaptcha" in form:
self.logDebug("ReCaptcha protected")
captcha_key = re.search(r'\?k=(.*?)"', form).group(1)
@@ -159,7 +159,7 @@ class NCryptIn(Crypter):
postData['recaptcha_challenge_field'] = challenge
postData['recaptcha_response_field'] = response
- # Resolve circlecaptcha
+ #: Resolve circlecaptcha
if "circlecaptcha" in form:
self.logDebug("CircleCaptcha protected")
captcha_img_url = "http://ncrypt.in/classes/captcha/circlecaptcha.php"
@@ -168,7 +168,7 @@ class NCryptIn(Crypter):
postData['circle.x'] = coords[0]
postData['circle.y'] = coords[1]
- # Unlock protection
+ #: Unlock protection
postData['submit_protected'] = 'Continue to folder'
return self.load(self.pyfile.url, post=postData)
@@ -188,13 +188,13 @@ class NCryptIn(Crypter):
def handleLinkSource(self, link_source_type):
- # Check for JS engine
+ #: Check for JS engine
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 []
- # Select suitable handler
+ #: Select suitable handler
if link_source_type == 'single':
return self.handleSingleLink()
if link_source_type == 'cnl2':
@@ -211,7 +211,7 @@ class NCryptIn(Crypter):
self.logDebug("Handling Single link")
package_links = []
- # Decrypt single link
+ #: Decrypt single link
decrypted_link = self.decryptLink(self.pyfile.url)
if decrypted_link:
package_links.append(decrypted_link)
@@ -276,35 +276,35 @@ class NCryptIn(Crypter):
def _getCipherParams(self):
pattern = r'<input.*?name="%s".*?value="(.*?)"'
- # Get jk
+ #: Get jk
jk_re = pattern % NCryptIn.JK_KEY
vjk = re.findall(jk_re, self.html)
- # Get crypted
+ #: Get crypted
crypted_re = pattern % NCryptIn.CRYPTED_KEY
vcrypted = re.findall(crypted_re, self.html)
- # Log and return
+ #: Log and return
self.logDebug("Detected %d crypted blocks" % len(vcrypted))
return vcrypted, vjk
def _getLinks(self, crypted, jk):
- # Get key
+ #: Get key
jreturn = self.js.eval("%s f()" % jk)
self.logDebug("JsEngine returns value [%s]" % jreturn)
key = binascii.unhexlify(jreturn)
- # Decrypt
+ #: Decrypt
Key = key
IV = key
obj = AES.new(Key, AES.MODE_CBC, IV)
text = obj.decrypt(crypted.decode('base64'))
- # Extract links
+ #: Extract links
text = text.replace("\x00", "").replace("\r", "")
links = filter(bool, text.split('\n'))
- # Log and return
+ #: Log and return
self.logDebug("Block has %d links" % len(links))
return links
diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py
index 25bd98190..cda70816d 100644
--- a/module/plugins/crypter/RelinkUs.py
+++ b/module/plugins/crypter/RelinkUs.py
@@ -62,17 +62,17 @@ class RelinkUs(Crypter):
def decrypt(self, pyfile):
- # Init
+ #: Init
self.initPackage(pyfile)
- # Request package
+ #: Request package
self.requestPackage()
- # Check for online
+ #: Check for online
if not self.isOnline():
self.offline()
- # Check for protection
+ #: Check for protection
if self.isPasswordProtected():
self.unlockPasswordProtection()
self.handleErrors()
@@ -82,18 +82,18 @@ class RelinkUs(Crypter):
self.unlockCaptchaProtection()
self.handleErrors()
- # Get package name and folder
+ #: Get package name and folder
(package_name, folder_name) = self.getPackageInfo()
- # Extract package links
+ #: Extract package links
package_links = []
for sources in self.PREFERRED_LINK_SOURCES:
package_links.extend(self.handleLinkSource(sources))
- if package_links: # use only first source which provides links
+ if package_links: #: use only first source which provides links
break
package_links = set(package_links)
- # Pack
+ #: Pack
if package_links:
self.packages = [(package_name, package_links, folder_name)]
@@ -151,7 +151,7 @@ class RelinkUs(Crypter):
def getPackageInfo(self):
name = folder = None
- # Try to get info from web
+ #: Try to get info from web
m = re.search(self.FILE_TITLE_REGEX, self.html)
if m:
title = m.group(1).strip()
@@ -159,13 +159,13 @@ class RelinkUs(Crypter):
name = folder = title
self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder))
- # Fallback to defaults
+ #: Fallback to defaults
if not name or not folder:
name = self.package.name
folder = self.package.folder
self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder))
- # Return package info
+ #: Return package info
return name, folder
@@ -259,35 +259,35 @@ class RelinkUs(Crypter):
def _getCipherParams(self, cnl2_form):
- # Get jk
+ #: Get jk
jk_re = self.CNL2_FORMINPUT_REGEX % self.CNL2_JK_KEY
vjk = re.findall(jk_re, cnl2_form, re.I)
- # Get crypted
+ #: Get crypted
crypted_re = self.CNL2_FORMINPUT_REGEX % RelinkUs.CNL2_CRYPTED_KEY
vcrypted = re.findall(crypted_re, cnl2_form, re.I)
- # Log and return
+ #: Log and return
self.logDebug("Detected %d crypted blocks" % len(vcrypted))
return vcrypted, vjk
def _getLinks(self, crypted, jk):
- # Get key
+ #: Get key
jreturn = self.js.eval("%s f()" % jk)
self.logDebug("JsEngine returns value [%s]" % jreturn)
key = binascii.unhexlify(jreturn)
- # Decrypt
+ #: Decrypt
Key = key
IV = key
obj = AES.new(Key, AES.MODE_CBC, IV)
text = obj.decrypt(crypted.decode('base64'))
- # Extract links
+ #: Extract links
text = text.replace("\x00", "").replace("\r", "")
links = filter(bool, text.split('\n'))
- # Log and return
+ #: Log and return
self.logDebug("Package has %d links" % len(links))
return links
diff --git a/module/plugins/crypter/SexuriaCom.py b/module/plugins/crypter/SexuriaCom.py
index 4ee4eb0b3..cce2177f4 100644
--- a/module/plugins/crypter/SexuriaCom.py
+++ b/module/plugins/crypter/SexuriaCom.py
@@ -29,11 +29,11 @@ class SexuriaCom(Crypter):
def decrypt(self, pyfile):
- # Init
+ #: Init
self.pyfile = pyfile
self.package = pyfile.package()
- # Get package links
+ #: Get package links
package_name, self.links, folder_name, package_pwd = self.decryptLinks(self.pyfile.url)
self.packages = [(package_name, self.links, folder_name)]
@@ -45,20 +45,20 @@ class SexuriaCom(Crypter):
password = None
if re.match(self.PATTERN_SUPPORTED_MAIN, url, re.I):
- # Processing main page
+ #: Processing main page
html = self.load(url)
links = re.findall(self.PATTERN_DL_LINK_PAGE, html, re.I)
for link in links:
linklist.append("http://sexuria.com/v1/" + link)
elif re.match(self.PATTERN_SUPPORTED_REDIRECT, url, re.I):
- # Processing direct redirect link (out.php), redirecting to main page
+ #: Processing direct redirect link (out.php), redirecting to main page
id = re.search(self.PATTERN_SUPPORTED_REDIRECT, url, re.I).group('ID')
if id:
linklist.append("http://sexuria.com/v1/Pornos_Kostenlos_liebe_%s.html" % id)
elif re.match(self.PATTERN_SUPPORTED_CRYPT, url, re.I):
- # Extract info from main file
+ #: Extract info from main file
id = re.search(self.PATTERN_SUPPORTED_CRYPT, url, re.I).group('ID')
html = self.load("http://sexuria.com/v1/Pornos_Kostenlos_info_%s.html" % id)
@@ -72,7 +72,7 @@ class SexuriaCom(Crypter):
password = pwd.strip()
self.logDebug("Password info [%s] found" % password)
- # Process link (dl_link)
+ #: Process link (dl_link)
html = self.load(url)
links = re.findall(self.PATTERN_REDIRECT_LINKS, html, re.I)
if len(links) == 0:
@@ -86,7 +86,7 @@ class SexuriaCom(Crypter):
else:
linklist.append(finallink)
- # Debug log
+ #: Debug log
self.logDebug("%d supported links" % len(linklist))
for i, link in enumerate(linklist):
self.logDebug("Supported link %d, %s" % (i + 1, link))
diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py
index 2d72b513e..250cc0c81 100644
--- a/module/plugins/crypter/ShareLinksBiz.py
+++ b/module/plugins/crypter/ShareLinksBiz.py
@@ -29,17 +29,17 @@ class ShareLinksBiz(Crypter):
def decrypt(self, pyfile):
- # Init
+ #: Init
self.initFile(pyfile)
- # Request package
+ #: Request package
url = self.baseUrl + '/' + self.fileId
self.html = self.load(url)
- # Unblock server (load all images)
+ #: Unblock server (load all images)
self.unblockServer()
- # Check for protection
+ #: Check for protection
if self.isPasswordProtected():
self.unlockPasswordProtection()
self.handleErrors()
@@ -49,17 +49,17 @@ class ShareLinksBiz(Crypter):
self.unlockCaptchaProtection()
self.handleErrors()
- # Extract package links
+ #: Extract package links
package_links = []
package_links.extend(self.handleWebLinks())
package_links.extend(self.handleContainers())
package_links.extend(self.handleCNL2())
package_links = set(package_links)
- # Get package info
+ #: Get package info
package_name, package_folder = self.getPackageInfo()
- # Pack
+ #: Pack
self.packages = [(package_name, package_links, package_folder)]
@@ -108,18 +108,18 @@ class ShareLinksBiz(Crypter):
def unlockCaptchaProtection(self):
- # Get captcha map
+ #: Get captcha map
captchaMap = self._getCaptchaMap()
self.logDebug("Captcha map with [%d] positions" % len(captchaMap.keys()))
- # Request user for captcha coords
+ #: Request user for captcha coords
m = re.search(r'<img src="/captcha.gif\?d=(.*?)&amp;PHPSESSID=(.*?)&amp;legend=1"', self.html)
captchaUrl = self.baseUrl + '/captcha.gif?d=%s&PHPSESSID=%s' % (m.group(1), m.group(2))
self.logDebug("Waiting user for correct position")
coords = self.decryptCaptcha(captchaUrl, forceUser=True, imgtype="gif", result_type='positional')
self.logDebug("Captcha resolved, coords [%s]" % str(coords))
- # Resolve captcha
+ #: Resolve captcha
href = self._resolveCoords(coords, captchaMap)
if href is None:
self.invalidCaptcha()
@@ -161,7 +161,7 @@ class ShareLinksBiz(Crypter):
def getPackageInfo(self):
name = folder = None
- # Extract from web package header
+ #: Extract from web package header
title_re = r'<h2><img.*?/>(.*)</h2>'
m = re.search(title_re, self.html, re.S)
if m:
@@ -170,13 +170,13 @@ class ShareLinksBiz(Crypter):
name = folder = title
self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder))
- # Fallback to defaults
+ #: Fallback to defaults
if not name or not folder:
name = self.package.name
folder = self.package.folder
self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder))
- # Return package info
+ #: Return package info
return name, folder
@@ -240,40 +240,40 @@ class ShareLinksBiz(Crypter):
def _getCipherParams(self):
- # Request CNL2
+ #: Request CNL2
code = re.search(r'ClicknLoad.swf\?code=(.*?)"', self.html).group(1)
url = "%s/get/cnl2/%s" % (self.baseUrl, code)
res = self.load(url)
params = res.split(";;")
- # Get jk
+ #: Get jk
strlist = list(params[1].decode('base64'))
jk = ''.join(strlist[::-1])
- # Get crypted
+ #: Get crypted
strlist = list(params[2].decode('base64'))
crypted = ''.join(strlist[::-1])
- # Log and return
+ #: Log and return
return crypted, jk
def _getLinks(self, crypted, jk):
- # Get key
+ #: Get key
jreturn = self.js.eval("%s f()" % jk)
self.logDebug("JsEngine returns value [%s]" % jreturn)
key = binascii.unhexlify(jreturn)
- # Decrypt
+ #: Decrypt
Key = key
IV = key
obj = AES.new(Key, AES.MODE_CBC, IV)
text = obj.decrypt(crypted.decode('base64'))
- # Extract links
+ #: Extract links
text = text.replace("\x00", "").replace("\r", "")
links = filter(bool, text.split('\n'))
- # Log and return
+ #: Log and return
self.logDebug("Block has %d links" % len(links))
return links
diff --git a/module/plugins/crypter/YoutubeComFolder.py b/module/plugins/crypter/YoutubeComFolder.py
index c6f86113d..fed832b7d 100644
--- a/module/plugins/crypter/YoutubeComFolder.py
+++ b/module/plugins/crypter/YoutubeComFolder.py
@@ -42,7 +42,7 @@ class YoutubeComFolder(Crypter):
return {"id": channel['id'],
"title": channel['snippet']['title'],
"relatedPlaylists": channel['contentDetails']['relatedPlaylists'],
- "user": user} # One lone channel for user?
+ "user": user} #: One lone channel for user?
def getPlaylist(self, p_id):