summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar zapp-brannigan <zapp-brannigan@users.noreply.github.com> 2015-04-22 21:02:21 +0200
committerGravatar zapp-brannigan <zapp-brannigan@users.noreply.github.com> 2015-04-22 21:02:21 +0200
commit3e9b1980a488ff9947554c6f72fbe18637f3567e (patch)
tree720a5a0ac2cefe26fc36a276c19d83b9d8e39552
parentMerge pull request #1366 from Gutz-Pilz/patch-1 (diff)
downloadpyload-3e9b1980a488ff9947554c6f72fbe18637f3567e.tar.xz
[FilecryptCc.py] Avoid hardcoded urls
Fix https://github.com/pyload/pyload/issues/1364 again ;)
-rw-r--r--module/plugins/crypter/FilecryptCc.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py
index ca4cf57cb..3c55ddd01 100644
--- a/module/plugins/crypter/FilecryptCc.py
+++ b/module/plugins/crypter/FilecryptCc.py
@@ -14,7 +14,7 @@ from module.plugins.internal.CaptchaService import ReCaptcha
class FilecryptCc(Crypter):
__name__ = "FilecryptCc"
__type__ = "crypter"
- __version__ = "0.12"
+ __version__ = "0.13"
__pattern__ = r'https?://(?:www\.)?filecrypt\.cc/Container/\w+'
@@ -31,7 +31,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):
@@ -40,6 +40,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()
@@ -88,7 +89,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")
@@ -98,7 +99,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,
@@ -130,7 +131,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):
@@ -138,7 +139,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'])