diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-04-22 21:29:04 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-04-22 21:29:04 +0200 |
commit | 4e78f3fb5d50e52a5eba1ea9ab811ce488b02d32 (patch) | |
tree | dea75e893d79df8a87a07b9a80975ffd5df7c514 | |
parent | [FilecryptCc] Version up (diff) | |
parent | [FilecryptCc.py] Avoid hardcoded urls (diff) | |
download | pyload-4e78f3fb5d50e52a5eba1ea9ab811ce488b02d32.tar.xz |
Merge pull request #1367 from zapp-brannigan/patch-1
[FilecryptCc.py] Avoid hardcoded urls
-rw-r--r-- | module/plugins/crypter/FilecryptCc.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py index fdb65b657..1bbe8f4fe 100644 --- a/module/plugins/crypter/FilecryptCc.py +++ b/module/plugins/crypter/FilecryptCc.py @@ -33,7 +33,7 @@ class FilecryptCc(Crypter): CAPTCHA_PATTERN = r'<img id="nc" src="(.+?)"' CIRCLE_CAPTCHA_PATTERN = r'<input type="image" src="(.+?)"' - MIRROR_PAGE_PATTERN = r'"[\w]*" href="(http://filecrypt.cc/Container/\w+\.html\?mirror=\d+)">' + MIRROR_PAGE_PATTERN = r'"[\w]*" href="(https?://(?:www\.)?filecrypt.cc/Container/\w+\.html\?mirror=\d+)">' def setup(self): @@ -42,6 +42,7 @@ class FilecryptCc(Crypter): def decrypt(self, pyfile): self.html = self.load(pyfile.url) + self.base_url = self.pyfile.url.split("Container")[0] if "content notfound" in self.html: #@NOTE: "content notfound" is NOT a typo self.offline() @@ -90,7 +91,7 @@ class FilecryptCc(Crypter): if m: #: normal captcha self.logDebug("Captcha-URL: %s" % m.group(1)) - captcha_code = self.decryptCaptcha(urljoin("http://filecrypt.cc", m.group(1)), + captcha_code = self.decryptCaptcha(urljoin(self.base_url, m.group(1)), forceUser=True, imgtype="gif") @@ -100,7 +101,7 @@ class FilecryptCc(Crypter): elif m2: #: circle captcha self.logDebug("Captcha-URL: %s" % m2.group(1)) - captcha_code = self.decryptCaptcha('https://filecrypt.cc/captcha/circle.php?c=abc', + captcha_code = self.decryptCaptcha('%s%s?c=abc' %(self.base_url,m2.group(1)), result_type='positional') self.siteWithLinks = self.load(self.pyfile.url, @@ -132,7 +133,7 @@ class FilecryptCc(Crypter): return for i in dlc: - self.links.append("http://filecrypt.cc/DLC/%s.dlc" % i) + self.links.append("%s/DLC/%s.dlc" % (self.base_url,i)) def handleWeblinks(self): @@ -140,7 +141,7 @@ class FilecryptCc(Crypter): weblinks = re.findall(self.WEBLINK_PATTERN, self.siteWithLinks) for link in weblinks: - res = self.load("http://filecrypt.cc/Link/%s.html" % link) + res = self.load("%s/Link/%s.html" % (self.base_url,link)) link2 = re.search('<iframe noresize src="(.*)"></iframe>', res) res2 = self.load(link2.group(1), just_header=True) self.links.append(res2['location']) |