From 04038a2cf0c4c2d9cc9a0c8e8bf9beb6426afae8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 10 Jul 2014 03:02:26 +0200 Subject: Use parseError instead PluginParseError + unified all download pattern attributes as LINK_PATTERN + removed some old patterns (not used anymore) + other code cosmetics --- module/plugins/crypter/RelinkUs.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index aad55c867..f6503374f 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -21,27 +21,28 @@ class RelinkUs(Crypter): # Constants PREFERRED_LINK_SOURCES = ['cnl2', 'dlc', 'web'] - OFFLINE_TOKEN = "Tattooside" - PASSWORD_TOKEN = "container_password.php" - PASSWORD_ERROR_ROKEN = "You have entered an incorrect password" - PASSWORD_SUBMIT_URL = "http://www.relink.us/container_password.php" - CAPTCHA_TOKEN = "container_captcha.php" - CAPTCHA_ERROR_ROKEN = "You have solved the captcha wrong" - CAPTCHA_IMG_URL = "http://www.relink.us/core/captcha/circlecaptcha.php" - CAPTCHA_SUBMIT_URL = "http://www.relink.us/container_captcha.php" - FILE_TITLE_REGEX = r"<th>Title</th><td><i>(.*)</i></td></tr>" - FILE_NOTITLE = 'No title' + OFFLINE_TOKEN = r'<title>Tattooside' + PASSWORD_TOKEN = r'container_password\.php' + PASSWORD_ERROR_ROKEN = r'You have entered an incorrect password' + PASSWORD_SUBMIT_URL = r'http://www\.relink\.us/container_password\.php' + CAPTCHA_TOKEN = r'container_captcha\.php' + CAPTCHA_ERROR_ROKEN = r'You have solved the captcha wrong' + CAPTCHA_IMG_URL = r'http://www\.relink\.us/core/captcha/circlecaptcha\.php' + CAPTCHA_SUBMIT_URL = r'http://www\.relink\.us/container_captcha\.php' + FILE_TITLE_REGEX = r'<th>Title</th><td><i>(.*)</i></td></tr>' + FILE_NOTITLE = r'No title' CNL2_FORM_REGEX = r'<form id="cnl_form-(.*?)</form>' CNL2_FORMINPUT_REGEX = r'<input.*?name="%s".*?value="(.*?)"' CNL2_JK_KEY = "jk" CNL2_CRYPTED_KEY = "crypted" DLC_LINK_REGEX = r'<a href=".*?" class="dlc_button" target="_blank">' - DLC_DOWNLOAD_URL = "http://www.relink.us/download.php" + DLC_DOWNLOAD_URL = r'http://www\.relink\.us/download\.php' WEB_FORWARD_REGEX = r"getFile\('(?P<link>.+)'\)" - WEB_FORWARD_URL = "http://www.relink.us/frame.php" + WEB_FORWARD_URL = r'http://www\.relink\.us/frame\.php' WEB_LINK_REGEX = r'<iframe name="Container" height="100%" frameborder="no" width="100%" src="(?P<link>.+)"></iframe>' + def setup(self): self.fileid = None self.package = None -- cgit v1.2.3 From 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 15 Jul 2014 16:25:41 +0200 Subject: Fix code indentation, some bad whitespaces and missing authors + use 'not' instead 'is None' + replace __pattern__'s r" with r' + other minor cosmetics --- module/plugins/crypter/RelinkUs.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index f6503374f..f5c158d2e 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -51,7 +51,6 @@ class RelinkUs(Crypter): self.captcha = False def decrypt(self, pyfile): - # Init self.initPackage(pyfile) @@ -226,7 +225,6 @@ class RelinkUs(Crypter): return package_links def _getCipherParams(self, cnl2_form): - # Get jk jk_re = self.CNL2_FORMINPUT_REGEX % self.CNL2_JK_KEY vjk = re.findall(jk_re, cnl2_form, re.IGNORECASE) @@ -240,7 +238,6 @@ class RelinkUs(Crypter): return vcrypted, vjk def _getLinks(self, crypted, jk): - # Get key jreturn = self.js.eval("%s f()" % jk) self.logDebug("JsEngine returns value [%s]" % jreturn) -- cgit v1.2.3 From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- 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 f5c158d2e..1187692a0 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -19,7 +19,7 @@ class RelinkUs(Crypter): __author_mail__ = "fragonib[AT]yahoo[DOT]es" # Constants - PREFERRED_LINK_SOURCES = ['cnl2', 'dlc', 'web'] + PREFERRED_LINK_SOURCES = ["cnl2", "dlc", "web"] OFFLINE_TOKEN = r'<title>Tattooside' PASSWORD_TOKEN = r'container_password\.php' @@ -197,7 +197,7 @@ class RelinkUs(Crypter): try: dlc = self.load(container_url) dlc_filename = self.fileid + ".dlc" - dlc_filepath = os.path.join(self.config["general"]["download_folder"], dlc_filename) + dlc_filepath = os.path.join(self.config['general']['download_folder'], dlc_filename) f = open(dlc_filepath, "wb") f.write(dlc) f.close() -- cgit v1.2.3 From 8e47b0de30a25d0fd5dfb518bfe4e1e7beff93fd Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 15 Jul 2014 16:27:44 +0200 Subject: Key attributes cleanup for account, container and crypter plugins --- module/plugins/crypter/RelinkUs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index 1187692a0..5474ef3b6 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -11,9 +11,11 @@ from module.plugins.Crypter import Crypter class RelinkUs(Crypter): __name__ = "RelinkUs" + __version__ = "3.0" __type__ = "crypter" + __pattern__ = r'http://(?:www\.)?relink.us/(f/|((view|go).php\?id=))(?P<id>.+)' - __version__ = "3.0" + __description__ = """Relink.us decrypter plugin""" __author_name__ = "fragonib" __author_mail__ = "fragonib[AT]yahoo[DOT]es" -- cgit v1.2.3 From a1e78f33dc2b0b6777fdcbc415673f3965b25542 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 16 Jul 2014 00:46:26 +0200 Subject: Prefer self.urls and self.packages for adding links --- 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 5474ef3b6..160900144 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -94,10 +94,9 @@ class RelinkUs(Crypter): self.fileid = re.match(self.__pattern__, pyfile.url).group('id') self.package = pyfile.package() self.password = self.getPassword() - self.url = pyfile.url def requestPackage(self): - self.html = self.load(self.url, decode=True) + self.html = self.load(self.pyfile.url, decode=True) def isOnline(self): if self.OFFLINE_TOKEN in self.html: -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor 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 160900144..1b120fc77 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -11,8 +11,8 @@ from module.plugins.Crypter import Crypter class RelinkUs(Crypter): __name__ = "RelinkUs" - __version__ = "3.0" __type__ = "crypter" + __version__ = "3.0" __pattern__ = r'http://(?:www\.)?relink.us/(f/|((view|go).php\?id=))(?P<id>.+)' @@ -63,7 +63,7 @@ class RelinkUs(Crypter): if not self.isOnline(): self.offline() - # Check for protection + # Check for protection if self.isPasswordProtected(): self.unlockPasswordProtection() self.handleErrors() @@ -133,7 +133,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 is not None: title = m.group(1).strip() @@ -147,7 +147,7 @@ class RelinkUs(Crypter): 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 def handleErrors(self): -- cgit v1.2.3 From 0d220d634e512d89bda540f91c643b361c82ea8a Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 27 Sep 2014 01:38:32 +0200 Subject: Logging string 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 1b120fc77..1c1afea25 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -125,7 +125,7 @@ class RelinkUs(Crypter): self.logDebug("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)) + self.logDebug("Captcha resolved, coords [%s]" % 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) @@ -189,7 +189,7 @@ class RelinkUs(Crypter): return package_links def handleDLCLinks(self): - self.logDebug('Search for DLC links') + self.logDebug("Search for DLC links") package_links = [] m = re.search(self.DLC_LINK_REGEX, self.html) if m is not None: -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- 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 1c1afea25..4d0132ac4 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -17,8 +17,8 @@ class RelinkUs(Crypter): __pattern__ = r'http://(?:www\.)?relink.us/(f/|((view|go).php\?id=))(?P<id>.+)' __description__ = """Relink.us decrypter plugin""" - __author_name__ = "fragonib" - __author_mail__ = "fragonib[AT]yahoo[DOT]es" + __authors__ = [("fragonib", "fragonib[AT]yahoo[DOT]es")] + # Constants PREFERRED_LINK_SOURCES = ["cnl2", "dlc", "web"] -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- 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 4d0132ac4..25cc9ada1 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -17,6 +17,7 @@ class RelinkUs(Crypter): __pattern__ = r'http://(?:www\.)?relink.us/(f/|((view|go).php\?id=))(?P<id>.+)' __description__ = """Relink.us decrypter plugin""" + __license__ = "GPLv3" __authors__ = [("fragonib", "fragonib[AT]yahoo[DOT]es")] -- cgit v1.2.3 From c5d1a4fd8943877c6d2eb3843e0de725dba5191e Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 11 Oct 2014 15:09:53 +0200 Subject: Pattern update 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 25cc9ada1..7b6dff328 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -14,7 +14,7 @@ class RelinkUs(Crypter): __type__ = "crypter" __version__ = "3.0" - __pattern__ = r'http://(?:www\.)?relink.us/(f/|((view|go).php\?id=))(?P<id>.+)' + __pattern__ = r'http://(?:www\.)?relink\.us/(f/|((view|go)\.php\?id=))(?P<id>.+)' __description__ = """Relink.us decrypter plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 8939f015a688a07ec7d0bd14b6a3704f6a2cb4a0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 11 Oct 2014 15:12:40 +0200 Subject: Pattern update 3 --- 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 7b6dff328..d99b7fb1a 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -41,7 +41,7 @@ class RelinkUs(Crypter): CNL2_CRYPTED_KEY = "crypted" DLC_LINK_REGEX = r'<a href=".*?" class="dlc_button" target="_blank">' DLC_DOWNLOAD_URL = r'http://www\.relink\.us/download\.php' - WEB_FORWARD_REGEX = r"getFile\('(?P<link>.+)'\)" + WEB_FORWARD_REGEX = r'getFile\(\'(?P<link>.+)\'\)' WEB_FORWARD_URL = r'http://www\.relink\.us/frame\.php' WEB_LINK_REGEX = r'<iframe name="Container" height="100%" frameborder="no" width="100%" src="(?P<link>.+)"></iframe>' -- cgit v1.2.3 From 089c1341de6ec7fa3a6cfc30fbf24cbef02cbfce Mon Sep 17 00:00:00 2001 From: AndroKev <neureither.kevin@gmail.com> Date: Sat, 18 Oct 2014 18:58:28 +0200 Subject: [RelinkUs] Fix regex errors and str conversion --- module/plugins/crypter/RelinkUs.py | 45 ++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 12 deletions(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index d99b7fb1a..dc97fca74 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -12,37 +12,42 @@ from module.plugins.Crypter import Crypter class RelinkUs(Crypter): __name__ = "RelinkUs" __type__ = "crypter" - __version__ = "3.0" + __version__ = "3.1" __pattern__ = r'http://(?:www\.)?relink\.us/(f/|((view|go)\.php\?id=))(?P<id>.+)' __description__ = """Relink.us decrypter plugin""" __license__ = "GPLv3" - __authors__ = [("fragonib", "fragonib[AT]yahoo[DOT]es")] + __authors__ = [("fragonib", "fragonib[AT]yahoo[DOT]es"), + ("AndroKev", "neureither.kevin@gmail.com")] - # Constants PREFERRED_LINK_SOURCES = ["cnl2", "dlc", "web"] OFFLINE_TOKEN = r'<title>Tattooside' - PASSWORD_TOKEN = r'container_password\.php' + + PASSWORD_TOKEN = r'container_password.php' PASSWORD_ERROR_ROKEN = r'You have entered an incorrect password' - PASSWORD_SUBMIT_URL = r'http://www\.relink\.us/container_password\.php' - CAPTCHA_TOKEN = r'container_captcha\.php' + PASSWORD_SUBMIT_URL = r'http://www.relink.us/container_password.php' + + CAPTCHA_TOKEN = r'container_captcha.php' CAPTCHA_ERROR_ROKEN = r'You have solved the captcha wrong' - CAPTCHA_IMG_URL = r'http://www\.relink\.us/core/captcha/circlecaptcha\.php' - CAPTCHA_SUBMIT_URL = r'http://www\.relink\.us/container_captcha\.php' - FILE_TITLE_REGEX = r'<th>Title</th><td><i>(.*)</i></td></tr>' + CAPTCHA_IMG_URL = r'http://www.relink.us/core/captcha/circlecaptcha.php' + CAPTCHA_SUBMIT_URL = r'http://www.relink.us/container_captcha.php' + + FILE_TITLE_REGEX = r'<th>Title</th><td>(.*)</td></tr>' FILE_NOTITLE = r'No title' CNL2_FORM_REGEX = r'<form id="cnl_form-(.*?)</form>' CNL2_FORMINPUT_REGEX = r'<input.*?name="%s".*?value="(.*?)"' CNL2_JK_KEY = "jk" CNL2_CRYPTED_KEY = "crypted" + DLC_LINK_REGEX = r'<a href=".*?" class="dlc_button" target="_blank">' - DLC_DOWNLOAD_URL = r'http://www\.relink\.us/download\.php' + DLC_DOWNLOAD_URL = r'http://www.relink.us/download.php' + WEB_FORWARD_REGEX = r'getFile\(\'(?P<link>.+)\'\)' - WEB_FORWARD_URL = r'http://www\.relink\.us/frame\.php' + WEB_FORWARD_URL = r'http://www.relink.us/frame.php' WEB_LINK_REGEX = r'<iframe name="Container" height="100%" frameborder="no" width="100%" src="(?P<link>.+)"></iframe>' @@ -53,6 +58,7 @@ class RelinkUs(Crypter): self.html = None self.captcha = False + def decrypt(self, pyfile): # Init self.initPackage(pyfile) @@ -91,46 +97,54 @@ class RelinkUs(Crypter): else: self.fail('Could not extract any links') + def initPackage(self, pyfile): self.fileid = re.match(self.__pattern__, pyfile.url).group('id') self.package = pyfile.package() self.password = self.getPassword() + def requestPackage(self): self.html = self.load(self.pyfile.url, decode=True) + def isOnline(self): if self.OFFLINE_TOKEN in self.html: self.logDebug("File not found") return False return True + def isPasswordProtected(self): if self.PASSWORD_TOKEN in self.html: self.logDebug("Links are password protected") return True + def isCaptchaProtected(self): if self.CAPTCHA_TOKEN in self.html: self.logDebug("Links are captcha protected") return True return False + def unlockPasswordProtection(self): self.logDebug("Submitting password [%s] for protected links" % self.password) passwd_url = self.PASSWORD_SUBMIT_URL + "?id=%s" % self.fileid passwd_data = {'id': self.fileid, 'password': self.password, 'pw': 'submit'} self.html = self.load(passwd_url, post=passwd_data, decode=True) + def unlockCaptchaProtection(self): self.logDebug("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]" % coords) + 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) + def getPackageInfo(self): name = folder = None @@ -151,6 +165,7 @@ class RelinkUs(Crypter): # Return package info return name, folder + def handleErrors(self): if self.PASSWORD_ERROR_ROKEN in self.html: msg = "Incorrect password, please set right password on 'Edit package' form and retry" @@ -165,6 +180,7 @@ class RelinkUs(Crypter): else: self.correctCaptcha() + def handleLinkSource(self, source): if source == 'cnl2': return self.handleCNL2Links() @@ -175,6 +191,7 @@ class RelinkUs(Crypter): else: self.fail('Unknown source [%s] (this is probably a bug)' % source) + def handleCNL2Links(self): self.logDebug("Search for CNL2 links") package_links = [] @@ -189,6 +206,7 @@ class RelinkUs(Crypter): self.logDebug("Unable to decrypt CNL2 links") return package_links + def handleDLCLinks(self): self.logDebug("Search for DLC links") package_links = [] @@ -208,6 +226,7 @@ class RelinkUs(Crypter): self.logDebug("Unable to download DLC container") return package_links + def handleWEBLinks(self): self.logDebug("Search for WEB links") package_links = [] @@ -226,6 +245,7 @@ class RelinkUs(Crypter): self.wait() return package_links + def _getCipherParams(self, cnl2_form): # Get jk jk_re = self.CNL2_FORMINPUT_REGEX % self.CNL2_JK_KEY @@ -239,6 +259,7 @@ class RelinkUs(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) -- cgit v1.2.3 From dabee359dd8c3870e0302e99457e6dd1bb93d736 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 21 Oct 2014 16:01:05 +0200 Subject: Remove needless self.html --- module/plugins/crypter/RelinkUs.py | 1 - 1 file changed, 1 deletion(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index dc97fca74..09b83b82b 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -55,7 +55,6 @@ class RelinkUs(Crypter): self.fileid = None self.package = None self.password = None - self.html = None self.captcha = False -- cgit v1.2.3 From 8cde8385b0224f8fa26758f6c2b6b782e5fb3663 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Thu, 23 Oct 2014 22:34:36 +0200 Subject: Call error instead fail in some plugins --- 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 09b83b82b..b4ee31568 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -188,7 +188,7 @@ class RelinkUs(Crypter): elif source == 'web': return self.handleWEBLinks() else: - self.fail('Unknown source [%s] (this is probably a bug)' % source) + self.error('Unknown source [%s] (this is probably a bug)' % source) def handleCNL2Links(self): -- cgit v1.2.3 From 4da90891eb2544ac15a7d512aba8cb357f68ee5f Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 25 Oct 2014 01:11:29 +0200 Subject: Spare code cosmetics --- module/plugins/crypter/RelinkUs.py | 7 +++---- 1 file changed, 3 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 b4ee31568..5c9d9e5ca 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -173,7 +173,6 @@ class RelinkUs(Crypter): if self.captcha: if self.CAPTCHA_ERROR_ROKEN in self.html: - self.logDebug("Invalid captcha, retrying") self.invalidCaptcha() self.retry() else: @@ -194,7 +193,7 @@ class RelinkUs(Crypter): def handleCNL2Links(self): self.logDebug("Search for CNL2 links") package_links = [] - m = re.search(self.CNL2_FORM_REGEX, self.html, re.DOTALL) + m = re.search(self.CNL2_FORM_REGEX, self.html, re.S) if m is not None: cnl2_form = m.group(1) try: @@ -248,11 +247,11 @@ class RelinkUs(Crypter): def _getCipherParams(self, cnl2_form): # Get jk jk_re = self.CNL2_FORMINPUT_REGEX % self.CNL2_JK_KEY - vjk = re.findall(jk_re, cnl2_form, re.IGNORECASE) + vjk = re.findall(jk_re, cnl2_form, re.I) # Get crypted crypted_re = self.CNL2_FORMINPUT_REGEX % RelinkUs.CNL2_CRYPTED_KEY - vcrypted = re.findall(crypted_re, cnl2_form, re.IGNORECASE) + vcrypted = re.findall(crypted_re, cnl2_form, re.I) # Log and return self.logDebug("Detected %d crypted blocks" % len(vcrypted)) -- cgit v1.2.3 From e3f5280529921100f48bb8a79853bf480c7611e4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 25 Oct 2014 02:53:05 +0200 Subject: Replace single quotes with doubles in self.error and self.fail msg --- 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 5c9d9e5ca..184e1a38e 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -94,7 +94,7 @@ class RelinkUs(Crypter): if package_links: self.packages = [(package_name, package_links, folder_name)] else: - self.fail('Could not extract any links') + self.fail("Could not extract any links") def initPackage(self, pyfile): @@ -187,7 +187,7 @@ class RelinkUs(Crypter): elif source == 'web': return self.handleWEBLinks() else: - self.error('Unknown source [%s] (this is probably a bug)' % source) + self.error('Unknown source type "%s" (this is probably a bug)' % source) def handleCNL2Links(self): -- cgit v1.2.3 From 9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 26 Oct 2014 02:31:54 +0200 Subject: Extend translation support in plugins + a lot of code cosmetics and typo fixes --- 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 184e1a38e..a71c736b5 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -94,7 +94,7 @@ class RelinkUs(Crypter): if package_links: self.packages = [(package_name, package_links, folder_name)] else: - self.fail("Could not extract any links") + self.fail(_("Could not extract any links")) def initPackage(self, pyfile): @@ -169,7 +169,7 @@ class RelinkUs(Crypter): 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.fail(msg) + self.fail(_(msg)) if self.captcha: if self.CAPTCHA_ERROR_ROKEN in self.html: -- cgit v1.2.3 From aa0751bcfd995e308bcd586a6965c75e68b1274b Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Mon, 27 Oct 2014 23:05:13 +0100 Subject: Code cosmetics --- module/plugins/crypter/RelinkUs.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index a71c736b5..135268dcc 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -93,8 +93,6 @@ class RelinkUs(Crypter): # Pack if package_links: self.packages = [(package_name, package_links, folder_name)] - else: - self.fail(_("Could not extract any links")) def initPackage(self, pyfile): -- cgit v1.2.3 From 885f8ed782e64d9e73367905e642a84d0a8999f1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 28 Oct 2014 04:01:38 +0100 Subject: Update __config__ --- module/plugins/crypter/RelinkUs.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index 135268dcc..1a3d47cf8 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -15,6 +15,8 @@ class RelinkUs(Crypter): __version__ = "3.1" __pattern__ = r'http://(?:www\.)?relink\.us/(f/|((view|go)\.php\?id=))(?P<id>.+)' + __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), + ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """Relink.us decrypter plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/crypter/RelinkUs.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index 1a3d47cf8..cdb699ae0 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -10,8 +10,8 @@ from module.plugins.Crypter import Crypter class RelinkUs(Crypter): - __name__ = "RelinkUs" - __type__ = "crypter" + __name__ = "RelinkUs" + __type__ = "crypter" __version__ = "3.1" __pattern__ = r'http://(?:www\.)?relink\.us/(f/|((view|go)\.php\?id=))(?P<id>.+)' @@ -19,9 +19,9 @@ class RelinkUs(Crypter): ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """Relink.us decrypter plugin""" - __license__ = "GPLv3" - __authors__ = [("fragonib", "fragonib[AT]yahoo[DOT]es"), - ("AndroKev", "neureither.kevin@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("fragonib", "fragonib[AT]yahoo[DOT]es"), + ("AndroKev", "neureither.kevin@gmail.com")] PREFERRED_LINK_SOURCES = ["cnl2", "dlc", "web"] -- cgit v1.2.3 From bd8259220ab4d56ab419b7b32045b08cc9b0a7c8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 9 Nov 2014 03:08:19 +0100 Subject: Use with statement instead open method when accessing fod + handle i/o error --- module/plugins/crypter/RelinkUs.py | 7 +++---- 1 file changed, 3 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 cdb699ae0..4c84b62f7 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -216,12 +216,11 @@ class RelinkUs(Crypter): dlc = self.load(container_url) dlc_filename = self.fileid + ".dlc" dlc_filepath = os.path.join(self.config['general']['download_folder'], dlc_filename) - f = open(dlc_filepath, "wb") - f.write(dlc) - f.close() + with open(dlc_filepath, "wb") as f: + f.write(dlc) package_links.append(dlc_filepath) except: - self.logDebug("Unable to download DLC container") + self.fail("Unable to download DLC container") return package_links -- cgit v1.2.3 From 52664e6fe8dd99fc9bb78ea8cf158c17705b6ded Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Fri, 5 Dec 2014 19:18:11 +0100 Subject: Fix with statement on old env like python 2.5 (2) --- module/plugins/crypter/RelinkUs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index 4c84b62f7..1111118b2 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +from __future__ import with_statement + import base64 import binascii import re @@ -12,7 +14,7 @@ from module.plugins.Crypter import Crypter class RelinkUs(Crypter): __name__ = "RelinkUs" __type__ = "crypter" - __version__ = "3.1" + __version__ = "3.11" __pattern__ = r'http://(?:www\.)?relink\.us/(f/|((view|go)\.php\?id=))(?P<id>.+)' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), -- cgit v1.2.3 From 4d578cb15f3d6edd036e438e504739b97660f93e Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 9 Dec 2014 16:58:35 +0100 Subject: Spare code cosmetics --- module/plugins/crypter/RelinkUs.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index 1111118b2..94a73cded 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -228,20 +228,29 @@ class RelinkUs(Crypter): def handleWEBLinks(self): self.logDebug("Search for WEB links") + package_links = [] - fw_params = re.findall(self.WEB_FORWARD_REGEX, self.html) - self.logDebug("Decrypting %d Web links" % len(fw_params)) - for index, fw_param in enumerate(fw_params): + params = re.findall(self.WEB_FORWARD_REGEX, self.html) + + self.logDebug("Decrypting %d Web links" % len(params)) + + for index, param in enumerate(params): try: - fw_url = self.WEB_FORWARD_URL + "?%s" % fw_param - self.logDebug("Decrypting Web link %d, %s" % (index + 1, fw_url)) - fw_response = self.load(fw_url, decode=True) - dl_link = re.search(self.WEB_LINK_REGEX, fw_response).group('link') - package_links.append(dl_link) + url = self.WEB_FORWARD_URL + "?%s" % param + + self.logDebug("Decrypting Web link %d, %s" % (index + 1, url)) + + res = self.load(url, decode=True) + link = re.search(self.WEB_LINK_REGEX, res).group('link') + + package_links.append(link) + except Exception, detail: self.logDebug("Error decrypting Web link %s, %s" % (index, detail)) + self.setWait(4) self.wait() + return package_links -- cgit v1.2.3 From 854efeb463bd98cb8e22f1f78f5ce97e6c0ab49f Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Mon, 22 Dec 2014 16:45:04 +0100 Subject: Spare code cosmetics --- module/plugins/crypter/RelinkUs.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/crypter/RelinkUs.py') diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index 94a73cded..5933839ec 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -16,7 +16,7 @@ class RelinkUs(Crypter): __type__ = "crypter" __version__ = "3.11" - __pattern__ = r'http://(?:www\.)?relink\.us/(f/|((view|go)\.php\?id=))(?P<id>.+)' + __pattern__ = r'http://(?:www\.)?relink\.us/(f/|((view|go)\.php\?id=))(?P<ID>.+)' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] @@ -50,9 +50,9 @@ class RelinkUs(Crypter): DLC_LINK_REGEX = r'<a href=".*?" class="dlc_button" target="_blank">' DLC_DOWNLOAD_URL = r'http://www.relink.us/download.php' - WEB_FORWARD_REGEX = r'getFile\(\'(?P<link>.+)\'\)' + WEB_FORWARD_REGEX = r'getFile\(\'(.+)\'\)' WEB_FORWARD_URL = r'http://www.relink.us/frame.php' - WEB_LINK_REGEX = r'<iframe name="Container" height="100%" frameborder="no" width="100%" src="(?P<link>.+)"></iframe>' + WEB_LINK_REGEX = r'<iframe name="Container" height="100%" frameborder="no" width="100%" src="(.+)"></iframe>' def setup(self): @@ -100,7 +100,7 @@ class RelinkUs(Crypter): def initPackage(self, pyfile): - self.fileid = re.match(self.__pattern__, pyfile.url).group('id') + self.fileid = re.match(self.__pattern__, pyfile.url).group('ID') self.package = pyfile.package() self.password = self.getPassword() @@ -241,7 +241,7 @@ class RelinkUs(Crypter): self.logDebug("Decrypting Web link %d, %s" % (index + 1, url)) res = self.load(url, decode=True) - link = re.search(self.WEB_LINK_REGEX, res).group('link') + link = re.search(self.WEB_LINK_REGEX, res).group(1) package_links.append(link) -- cgit v1.2.3