From 0e1ef9bc01579328e17e79416fa3c1c7b77adcc8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 06:08:01 +0200 Subject: Update everything --- module/plugins/crypter/RelinkUs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index ed3da1f9b..7dfb3876f 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -7,14 +7,14 @@ import re import os from Crypto.Cipher import AES -from module.plugins.Crypter import Crypter +from module.plugins.internal.Crypter import Crypter from module.utils import save_join class RelinkUs(Crypter): __name__ = "RelinkUs" __type__ = "crypter" - __version__ = "3.12" + __version__ = "3.13" __pattern__ = r'http://(?:www\.)?relink\.us/(f/|((view|go)\.php\?id=))(?P.+)' __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), -- cgit v1.2.3 From 5a139055ae658d3a05cbb658cbd66aeae0d01db5 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 15 Jun 2015 21:06:10 +0200 Subject: Spare code cosmetics --- module/plugins/crypter/RelinkUs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index 7dfb3876f..316d44b4c 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -8,7 +8,7 @@ import os from Crypto.Cipher import AES from module.plugins.internal.Crypter import Crypter -from module.utils import save_join +from module.utils import save_join as fs_join class RelinkUs(Crypter): @@ -219,7 +219,7 @@ class RelinkUs(Crypter): try: dlc = self.load(container_url) dlc_filename = self.fileid + ".dlc" - dlc_filepath = save_join(self.config['general']['download_folder'], dlc_filename) + dlc_filepath = fs_join(self.core.config['general']['download_folder'], dlc_filename) with open(dlc_filepath, "wb") as f: f.write(dlc) package_links.append(dlc_filepath) -- cgit v1.2.3 From c1764e2fea0bb05164c83a876e8cd58b97f58f25 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 16 Jun 2015 17:31:38 +0200 Subject: Update all --- module/plugins/crypter/RelinkUs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index 316d44b4c..6e7c80561 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -104,7 +104,7 @@ class RelinkUs(Crypter): def requestPackage(self): - self.html = self.load(self.pyfile.url, decode=True) + self.html = self.load(self.pyfile.url) def isOnline(self): @@ -135,7 +135,7 @@ class RelinkUs(Crypter): if password: passwd_url = self.PASSWORD_SUBMIT_URL + "?id=%s" % self.fileid passwd_data = {'id': self.fileid, 'password': password, 'pw': 'submit'} - self.html = self.load(passwd_url, post=passwd_data, decode=True) + self.html = self.load(passwd_url, post=passwd_data) def unlockCaptchaProtection(self): @@ -145,7 +145,7 @@ class RelinkUs(Crypter): self.logDebug("Captcha resolved, coords [%s]" % str(coords)) captcha_post_url = self.CAPTCHA_SUBMIT_URL + "?id=%s" % self.fileid captcha_post_data = {'button.x': coords[0], 'button.y': coords[1], 'captcha': 'submit'} - self.html = self.load(captcha_post_url, post=captcha_post_data, decode=True) + self.html = self.load(captcha_post_url, post=captcha_post_data) def getPackageInfo(self): @@ -244,7 +244,7 @@ class RelinkUs(Crypter): self.logDebug("Decrypting Web link %d, %s" % (index + 1, url)) - res = self.load(url, decode=True) + res = self.load(url) link = re.search(self.WEB_LINK_REGEX, res).group(1) package_links.append(link) -- cgit v1.2.3 From 164512b6a74c94a731fcee7435dce1ccfa2f71e7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 18:29:50 +0200 Subject: Spare code cosmetics --- module/plugins/crypter/RelinkUs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index 6e7c80561..25bd98190 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -219,7 +219,7 @@ class RelinkUs(Crypter): try: dlc = self.load(container_url) dlc_filename = self.fileid + ".dlc" - dlc_filepath = fs_join(self.core.config['general']['download_folder'], dlc_filename) + dlc_filepath = fs_join(self.core.config.get("general", "download_folder"), dlc_filename) with open(dlc_filepath, "wb") as f: f.write(dlc) package_links.append(dlc_filepath) -- cgit v1.2.3 From 20b6a2ec022202b0efb6cb69415239fb8f4d1445 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 18:59:20 +0200 Subject: Spare code cosmetics (2) --- module/plugins/crypter/RelinkUs.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'module/plugins/crypter/RelinkUs.py') 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 -- cgit v1.2.3 From b1759bc440cd6013837697eb8de540914f693ffd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Jul 2015 01:23:55 +0200 Subject: No camelCase style anymore --- module/plugins/crypter/RelinkUs.py | 114 ++++++++++++++++++------------------- 1 file changed, 57 insertions(+), 57 deletions(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index cda70816d..4f3077771 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -14,7 +14,7 @@ from module.utils import save_join as fs_join class RelinkUs(Crypter): __name__ = "RelinkUs" __type__ = "crypter" - __version__ = "3.13" + __version__ = "3.14" __pattern__ = r'http://(?:www\.)?relink\.us/(f/|((view|go)\.php\?id=))(?P.+)' __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), @@ -63,32 +63,32 @@ class RelinkUs(Crypter): def decrypt(self, pyfile): #: Init - self.initPackage(pyfile) + self.init_package(pyfile) #: Request package - self.requestPackage() + self.request_package() #: Check for online - if not self.isOnline(): + if not self.is_online(): self.offline() #: Check for protection - if self.isPasswordProtected(): - self.unlockPasswordProtection() - self.handleErrors() + if self.is_password_protected(): + self.unlock_password_protection() + self.handle_errors() - if self.isCaptchaProtected(): + if self.is_captcha_protected(): self.captcha = True - self.unlockCaptchaProtection() - self.handleErrors() + self.unlock_captcha_protection() + self.handle_errors() #: Get package name and folder - (package_name, folder_name) = self.getPackageInfo() + (package_name, folder_name) = self.get_package_info() #: Extract package links package_links = [] for sources in self.PREFERRED_LINK_SOURCES: - package_links.extend(self.handleLinkSource(sources)) + package_links.extend(self.handle_link_source(sources)) if package_links: #: use only first source which provides links break package_links = set(package_links) @@ -98,39 +98,39 @@ class RelinkUs(Crypter): self.packages = [(package_name, package_links, folder_name)] - def initPackage(self, pyfile): + def init_package(self, pyfile): self.fileid = re.match(self.__pattern__, pyfile.url).group('ID') self.package = pyfile.package() - def requestPackage(self): + def request_package(self): self.html = self.load(self.pyfile.url) - def isOnline(self): + def is_online(self): if self.OFFLINE_TOKEN in self.html: - self.logDebug("File not found") + self.log_debug("File not found") return False return True - def isPasswordProtected(self): + def is_password_protected(self): if self.PASSWORD_TOKEN in self.html: - self.logDebug("Links are password protected") + self.log_debug("Links are password protected") return True - def isCaptchaProtected(self): + def is_captcha_protected(self): if self.CAPTCHA_TOKEN in self.html: - self.logDebug("Links are captcha protected") + self.log_debug("Links are captcha protected") return True return False - def unlockPasswordProtection(self): - password = self.getPassword() + def unlock_password_protection(self): + password = self.get_password() - self.logDebug("Submitting password [%s] for protected links" % password) + self.log_debug("Submitting password [%s] for protected links" % password) if password: passwd_url = self.PASSWORD_SUBMIT_URL + "?id=%s" % self.fileid @@ -138,17 +138,17 @@ class RelinkUs(Crypter): self.html = self.load(passwd_url, post=passwd_data) - def unlockCaptchaProtection(self): - self.logDebug("Request user positional captcha resolving") + def unlock_captcha_protection(self): + self.log_debug("Request user positional captcha resolving") captcha_img_url = self.CAPTCHA_IMG_URL + "?id=%s" % self.fileid - coords = self.decryptCaptcha(captcha_img_url, forceUser=True, imgtype="png", result_type='positional') - self.logDebug("Captcha resolved, coords [%s]" % str(coords)) + coords = self.decrypt_captcha(captcha_img_url, forceUser=True, imgtype="png", result_type='positional') + self.log_debug("Captcha resolved, coords [%s]" % str(coords)) captcha_post_url = self.CAPTCHA_SUBMIT_URL + "?id=%s" % self.fileid captcha_post_data = {'button.x': coords[0], 'button.y': coords[1], 'captcha': 'submit'} self.html = self.load(captcha_post_url, post=captcha_post_data) - def getPackageInfo(self): + def get_package_info(self): name = folder = None #: Try to get info from web @@ -157,65 +157,65 @@ class RelinkUs(Crypter): title = m.group(1).strip() if not self.FILE_NOTITLE in title: name = folder = title - self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder)) + self.log_debug("Found name [%s] and folder [%s] in package info" % (name, folder)) #: 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)) + self.log_debug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) #: Return package info return name, folder - def handleErrors(self): + def handle_errors(self): if self.PASSWORD_ERROR_ROKEN in self.html: msg = "Incorrect password, please set right password on 'Edit package' form and retry" - self.logDebug(msg) + self.log_debug(msg) self.fail(_(msg)) if self.captcha: if self.CAPTCHA_ERROR_ROKEN in self.html: - self.invalidCaptcha() + self.invalid_captcha() self.retry() else: - self.correctCaptcha() + self.correct_captcha() - def handleLinkSource(self, source): + def handle_link_source(self, source): if source == 'cnl2': - return self.handleCNL2Links() + return self.handle_CNL2Links() elif source == 'dlc': - return self.handleDLCLinks() + return self.handle_d_l_c_links() elif source == 'web': - return self.handleWEBLinks() + return self.handle_w_e_b_links() else: self.error(_('Unknown source type "%s"') % source) - def handleCNL2Links(self): - self.logDebug("Search for CNL2 links") + def handle_CNL2Links(self): + self.log_debug("Search for CNL2 links") package_links = [] m = re.search(self.CNL2_FORM_REGEX, self.html, re.S) if m: cnl2_form = m.group(1) try: - (vcrypted, vjk) = self._getCipherParams(cnl2_form) + (vcrypted, vjk) = self._get_cipher_params(cnl2_form) for (crypted, jk) in zip(vcrypted, vjk): - package_links.extend(self._getLinks(crypted, jk)) + package_links.extend(self._get_links(crypted, jk)) except Exception: - self.logDebug("Unable to decrypt CNL2 links") + self.log_debug("Unable to decrypt CNL2 links") return package_links - def handleDLCLinks(self): - self.logDebug("Search for DLC links") + def handle_d_l_c_links(self): + self.log_debug("Search for DLC links") package_links = [] m = re.search(self.DLC_LINK_REGEX, self.html) if m: container_url = self.DLC_DOWNLOAD_URL + "?id=%s&dlc=1" % self.fileid - self.logDebug("Downloading DLC container link [%s]" % container_url) + self.log_debug("Downloading DLC container link [%s]" % container_url) try: dlc = self.load(container_url) dlc_filename = self.fileid + ".dlc" @@ -230,19 +230,19 @@ class RelinkUs(Crypter): return package_links - def handleWEBLinks(self): - self.logDebug("Search for WEB links") + def handle_w_e_b_links(self): + self.log_debug("Search for WEB links") package_links = [] params = re.findall(self.WEB_FORWARD_REGEX, self.html) - self.logDebug("Decrypting %d Web links" % len(params)) + self.log_debug("Decrypting %d Web links" % len(params)) for index, param in enumerate(params): try: url = self.WEB_FORWARD_URL + "?%s" % param - self.logDebug("Decrypting Web link %d, %s" % (index + 1, url)) + self.log_debug("Decrypting Web link %d, %s" % (index + 1, url)) res = self.load(url) link = re.search(self.WEB_LINK_REGEX, res).group(1) @@ -250,15 +250,15 @@ class RelinkUs(Crypter): package_links.append(link) except Exception, detail: - self.logDebug("Error decrypting Web link %s, %s" % (index, detail)) + self.log_debug("Error decrypting Web link %s, %s" % (index, detail)) - self.setWait(4) + self.set_wait(4) self.wait() return package_links - def _getCipherParams(self, cnl2_form): + def _get_cipher_params(self, cnl2_form): #: Get jk jk_re = self.CNL2_FORMINPUT_REGEX % self.CNL2_JK_KEY vjk = re.findall(jk_re, cnl2_form, re.I) @@ -268,14 +268,14 @@ class RelinkUs(Crypter): vcrypted = re.findall(crypted_re, cnl2_form, re.I) #: Log and return - self.logDebug("Detected %d crypted blocks" % len(vcrypted)) + self.log_debug("Detected %d crypted blocks" % len(vcrypted)) return vcrypted, vjk - def _getLinks(self, crypted, jk): + def _get_links(self, crypted, jk): #: Get key jreturn = self.js.eval("%s f()" % jk) - self.logDebug("JsEngine returns value [%s]" % jreturn) + self.log_debug("JsEngine returns value [%s]" % jreturn) key = binascii.unhexlify(jreturn) #: Decrypt @@ -289,5 +289,5 @@ class RelinkUs(Crypter): links = filter(bool, text.split('\n')) #: Log and return - self.logDebug("Package has %d links" % len(links)) + self.log_debug("Package has %d links" % len(links)) return links -- cgit v1.2.3 From d2e2b127651a5a44b56337eb6d9ca246c97a208a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 17 Jul 2015 03:03:26 +0200 Subject: Spare fixes and code cosmetics --- module/plugins/crypter/RelinkUs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index 4f3077771..01fb7bffc 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -187,9 +187,9 @@ class RelinkUs(Crypter): if source == 'cnl2': return self.handle_CNL2Links() elif source == 'dlc': - return self.handle_d_l_c_links() + return self.handle_DLC_links() elif source == 'web': - return self.handle_w_e_b_links() + return self.handle_WEB_links() else: self.error(_('Unknown source type "%s"') % source) @@ -209,7 +209,7 @@ class RelinkUs(Crypter): return package_links - def handle_d_l_c_links(self): + def handle_DLC_links(self): self.log_debug("Search for DLC links") package_links = [] m = re.search(self.DLC_LINK_REGEX, self.html) @@ -230,7 +230,7 @@ class RelinkUs(Crypter): return package_links - def handle_w_e_b_links(self): + def handle_WEB_links(self): self.log_debug("Search for WEB links") package_links = [] -- cgit v1.2.3 From 9e5d813d7721e351ac02ba72bdc473a7d77ba6b7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 18 Jul 2015 20:04:36 +0200 Subject: Code cosmetics --- module/plugins/crypter/RelinkUs.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index 01fb7bffc..b270ccbbd 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -252,8 +252,7 @@ class RelinkUs(Crypter): except Exception, detail: self.log_debug("Error decrypting Web link %s, %s" % (index, detail)) - self.set_wait(4) - self.wait() + self.wait(4) return package_links -- cgit v1.2.3 From dad722ac7255640e7e0541c4094a4d2e4de79cd3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 00:05:58 +0200 Subject: Code cosmetics (2) --- module/plugins/crypter/RelinkUs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index b270ccbbd..77d5eff50 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -89,7 +89,7 @@ class RelinkUs(Crypter): package_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 + if package_links: #: Use only first source which provides links break package_links = set(package_links) -- cgit v1.2.3 From 56389e28ba5d2f5658278bc7f486d73be747f135 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 11:44:49 +0200 Subject: Rename self.core to self.pyload (plugins only) --- module/plugins/crypter/RelinkUs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index 77d5eff50..8c4d4eba0 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -219,7 +219,7 @@ class RelinkUs(Crypter): try: dlc = self.load(container_url) dlc_filename = self.fileid + ".dlc" - dlc_filepath = fs_join(self.core.config.get("general", "download_folder"), dlc_filename) + dlc_filepath = fs_join(self.pyload.config.get("general", "download_folder"), dlc_filename) with open(dlc_filepath, "wb") as f: f.write(dlc) package_links.append(dlc_filepath) -- cgit v1.2.3 From d38e830b7c0b3c6561a0072c74bbccb5fcdf4a61 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 14:43:42 +0200 Subject: New __status__ magic key --- module/plugins/crypter/RelinkUs.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index 8c4d4eba0..c2b72ae0e 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -15,6 +15,7 @@ class RelinkUs(Crypter): __name__ = "RelinkUs" __type__ = "crypter" __version__ = "3.14" + __status__ = "stable" __pattern__ = r'http://(?:www\.)?relink\.us/(f/|((view|go)\.php\?id=))(?P.+)' __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), -- cgit v1.2.3 From 027cb529d79558de19c47da88a782b31745a65c9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 21 Jul 2015 22:53:37 +0200 Subject: New Captcha skeleton --- module/plugins/crypter/RelinkUs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index c2b72ae0e..f95da1b26 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -142,7 +142,7 @@ class RelinkUs(Crypter): def unlock_captcha_protection(self): self.log_debug("Request user positional captcha resolving") captcha_img_url = self.CAPTCHA_IMG_URL + "?id=%s" % self.fileid - coords = self.decrypt_captcha(captcha_img_url, forceUser=True, imgtype="png", result_type='positional') + coords = self.captcha.decrypt_image(captcha_img_url, input_type="png", output_type='positional', try_ocr=False) self.log_debug("Captcha resolved, coords [%s]" % str(coords)) captcha_post_url = self.CAPTCHA_SUBMIT_URL + "?id=%s" % self.fileid captcha_post_data = {'button.x': coords[0], 'button.y': coords[1], 'captcha': 'submit'} @@ -178,10 +178,10 @@ class RelinkUs(Crypter): if self.captcha: if self.CAPTCHA_ERROR_ROKEN in self.html: - self.invalid_captcha() + self.captcha.invalid() self.retry() else: - self.correct_captcha() + self.captcha.correct() def handle_link_source(self, source): -- cgit v1.2.3 From 6af9b38a8d5d49355b85aef6ddd003605d6bba05 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 23 Jul 2015 23:44:45 +0200 Subject: Improve Captcha --- module/plugins/crypter/RelinkUs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index f95da1b26..1d27f7c93 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -142,7 +142,7 @@ class RelinkUs(Crypter): def unlock_captcha_protection(self): self.log_debug("Request user positional captcha resolving") captcha_img_url = self.CAPTCHA_IMG_URL + "?id=%s" % self.fileid - coords = self.captcha.decrypt_image(captcha_img_url, input_type="png", output_type='positional', try_ocr=False) + coords = self.captcha.decrypt(captcha_img_url, input_type="png", output_type='positional', ocr=False) self.log_debug("Captcha resolved, coords [%s]" % str(coords)) captcha_post_url = self.CAPTCHA_SUBMIT_URL + "?id=%s" % self.fileid captcha_post_data = {'button.x': coords[0], 'button.y': coords[1], 'captcha': 'submit'} -- cgit v1.2.3 From 94d017cd2a5c1f194960827a8c7e46afc3682008 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 06:55:49 +0200 Subject: Hotfixes (2) --- module/plugins/crypter/RelinkUs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index 1d27f7c93..fc8938b2e 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -15,7 +15,7 @@ class RelinkUs(Crypter): __name__ = "RelinkUs" __type__ = "crypter" __version__ = "3.14" - __status__ = "stable" + __status__ = "testing" __pattern__ = r'http://(?:www\.)?relink\.us/(f/|((view|go)\.php\?id=))(?P.+)' __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), -- cgit v1.2.3 From 761ca5c66e07559925ebbdbc6531f9ca658b12ce Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 16:11:58 +0200 Subject: Code cosmetics --- module/plugins/crypter/RelinkUs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index fc8938b2e..d2f0a278b 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -185,11 +185,11 @@ class RelinkUs(Crypter): def handle_link_source(self, source): - if source == 'cnl2': + if source == "cnl2": return self.handle_CNL2Links() - elif source == 'dlc': + elif source == "dlc": return self.handle_DLC_links() - elif source == 'web': + elif source == "web": return self.handle_WEB_links() else: self.error(_('Unknown source type "%s"') % source) -- cgit v1.2.3 From dc47212c8e801d380e4db4bd1bec0bf183de9de1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 31 Jul 2015 05:48:44 +0200 Subject: [Captcha] Fix _decrypt method --- module/plugins/crypter/RelinkUs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index d2f0a278b..b3c13db5d 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -142,7 +142,7 @@ class RelinkUs(Crypter): def unlock_captcha_protection(self): self.log_debug("Request user positional captcha resolving") captcha_img_url = self.CAPTCHA_IMG_URL + "?id=%s" % self.fileid - coords = self.captcha.decrypt(captcha_img_url, input_type="png", output_type='positional', ocr=False) + coords = self.captcha.decrypt(captcha_img_url, input_type="png", output_type='positional', ocr="CircleCaptcha") self.log_debug("Captcha resolved, coords [%s]" % str(coords)) captcha_post_url = self.CAPTCHA_SUBMIT_URL + "?id=%s" % self.fileid captcha_post_data = {'button.x': coords[0], 'button.y': coords[1], 'captcha': 'submit'} -- cgit v1.2.3