From 1cfc960fd3ec384364ffb1e09d3ee98fc657eddb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Apr 2015 16:51:14 +0200 Subject: [SimpleDereferer][SimpleHoster] Update user-agent --- module/plugins/hoster/Keep2ShareCc.py | 13 ++++++------- module/plugins/hoster/YadiSk.py | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'module/plugins/hoster') 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'', self.html).group(1) + self.fid = re.search(r'', 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}) -- cgit v1.2.3