diff options
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/hoster/Keep2ShareCc.py | 13 | ||||
-rw-r--r-- | module/plugins/hoster/YadiSk.py | 2 | ||||
-rw-r--r-- | module/plugins/internal/SimpleDereferer.py | 3 | ||||
-rw-r--r-- | module/plugins/internal/SimpleHoster.py | 6 |
4 files changed, 13 insertions, 11 deletions
diff --git a/module/plugins/hoster/Keep2ShareCc.py b/module/plugins/hoster/Keep2ShareCc.py index 296226e3c..65e9ddc2d 100644 --- a/module/plugins/hoster/Keep2ShareCc.py +++ b/module/plugins/hoster/Keep2ShareCc.py @@ -30,7 +30,7 @@ class Keep2ShareCc(SimpleHoster): OFFLINE_PATTERN = r'File not found or deleted|Sorry, this file is blocked or deleted|Error 404' TEMP_OFFLINE_PATTERN = r'Downloading blocked due to' - LINK_FREE_PATTERN = r'"([^"]+url.html\?file=.+?)"|window\.location\.href = \'(.+?)\';' + LINK_FREE_PATTERN = r'"(.+?url.html\?file=.+?)"|window\.location\.href = \'(.+?)\';' LINK_PREMIUM_PATTERN = r'window\.location\.href = \'(.+?)\';' CAPTCHA_PATTERN = r'src="(/file/captcha\.html.+?)"' @@ -67,20 +67,18 @@ class Keep2ShareCc(SimpleHoster): def handleFree(self, pyfile): - self.fid = re.search(r'<input type="hidden" name="slow_id" value="([^"]+)">', self.html).group(1) + self.fid = re.search(r'<input type="hidden" name="slow_id" value="(.+?)">', self.html).group(1) self.html = self.load(pyfile.url, post={'yt0': '', 'slow_id': self.fid}) - self.logDebug(self.fid) - self.logDebug(pyfile.url) + + # self.logDebug(self.fid) + # self.logDebug(pyfile.url) self.checkErrors() m = re.search(self.LINK_FREE_PATTERN, self.html) - if m is None: self.handleCaptcha() - self.wait(31) - self.html = self.load(pyfile.url) m = re.search(self.LINK_FREE_PATTERN, self.html) @@ -98,6 +96,7 @@ class Keep2ShareCc(SimpleHoster): m = re.search(r'id="(captcha\-form)"', self.html) self.logDebug("captcha-form found %s" % m) + m = re.search(self.CAPTCHA_PATTERN, self.html) self.logDebug("CAPTCHA_PATTERN found %s" % m) if m: diff --git a/module/plugins/hoster/YadiSk.py b/module/plugins/hoster/YadiSk.py index c71d16cf2..57d8ae786 100644 --- a/module/plugins/hoster/YadiSk.py +++ b/module/plugins/hoster/YadiSk.py @@ -70,7 +70,7 @@ class YadiSk(SimpleHoster): result_json = self.load("https://yadi.sk/models/?_m=do-get-resource-url", post={'idClient': yadisk_idclient, 'version' : yadisk_ver, - '_model.0': 'do-get-resource-url', + '_model.0': "do-get-resource-url", 'sk' : yadisk_sk, 'id.0' : yadisk_id}) diff --git a/module/plugins/internal/SimpleDereferer.py b/module/plugins/internal/SimpleDereferer.py index 360cd7c30..41c6aa985 100644 --- a/module/plugins/internal/SimpleDereferer.py +++ b/module/plugins/internal/SimpleDereferer.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import getFileURL, set_cookies class SimpleDereferer(Crypter): __name__ = "SimpleDereferer" __type__ = "crypter" - __version__ = "0.08" + __version__ = "0.09" __pattern__ = r'^unmatchable$' __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), @@ -70,6 +70,7 @@ class SimpleDereferer(Crypter): self.html = "" self.req.setOption("timeout", 120) + self.req.http.c.setopt(pycurl.USERAGENT, "Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0") if isinstance(self.COOKIES, list): set_cookies(self.req.cj, self.COOKIES) diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 6f1c7409d..4446eed00 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -3,6 +3,7 @@ import datetime import mimetypes import os +import pycurl import re import time import urllib2 @@ -247,7 +248,7 @@ def secondsToMidnight(gmt=0): class SimpleHoster(Hoster): __name__ = "SimpleHoster" __type__ = "hoster" - __version__ = "1.33" + __version__ = "1.34" __pattern__ = r'^unmatchable$' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -315,7 +316,7 @@ class SimpleHoster(Hoster): @classmethod - def parseInfos(cls, urls): #@TODO: Built-in in 0.4.10 core, then remove from plugins + def parseInfos(cls, urls): #@TODO: Built-in in 0.4.10 core (remove from plugins) for url in urls: url = replace_patterns(url, cls.URL_REPLACEMENTS) yield cls.getInfo(url) @@ -433,6 +434,7 @@ class SimpleHoster(Hoster): self.fail(_("Required account not found")) self.req.setOption("timeout", 120) + self.req.http.c.setopt(pycurl.USERAGENT, "Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0") if isinstance(self.COOKIES, list): set_cookies(self.req.cj, self.COOKIES) |