From 4a6cfe415a0d362bf30f22fac16b732195f97232 Mon Sep 17 00:00:00 2001 From: Jeix Date: Fri, 11 Feb 2011 20:17:20 +0100 Subject: GUI updates, closed #181, updated XDCC, fixed FileSonic --- module/plugins/hoster/EasyShareCom.py | 69 +++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 module/plugins/hoster/EasyShareCom.py (limited to 'module/plugins/hoster/EasyShareCom.py') diff --git a/module/plugins/hoster/EasyShareCom.py b/module/plugins/hoster/EasyShareCom.py new file mode 100644 index 000000000..9d185f4b5 --- /dev/null +++ b/module/plugins/hoster/EasyShareCom.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from module.plugins.Hoster import Hoster +from module.plugins.ReCaptcha import ReCaptcha + +class EasyShareCom(Hoster): + __name__ = "EasyShareCom" + __type__ = "hoster" + __pattern__ = r"http://[\w\d\.]*?easy-share\.com/(\d{6}).*" + __version__ = "0.1" + __description__ = """easy-share.com One-Klick Hoster""" + __author_name__ = ("jeix") + __author_mail__ = ("jeix@hasnomail.de") + + + def setup(self): + self.multiDL = False + self.html = None + + def process(self, pyfile): + self.pyfile = pyfile + + self.html = self.load(self.pyfile.url) + self.pyfile.name = self.getFileName() + + self.download( self.getFileUrl() ) + + + def getFileName(self): + return re.search(r'requesting:\s*(.*?)<', self.html).group(1) + + + def getFileUrl(self): + + if "There is another download in progress from your IP" in self.html: + self.log.info("%s: IP blocked, retry in 5 minutes." % self.__name__) + self.setWait(5 * 60) + self.wait() + self.retry() + + if "You need a premium membership to download this file" in self.html: + self.fail("You need a premium membership to download this file.") + + + wait = re.search(r"w='(\d+)'", self.html) + if wait: + wait = int( wait.group(1).strip() ) + self.log.info("%s: Waiting %d seconds." % (self.__name__, wait)) + self.setWait(wait) + self.wait() + + tempurl = self.pyfile.url + if not tempurl.endswith("/"): + tempurl += "/" + id = re.search(r'http://[\w\d\.]*?easy-share\.com/(\d+)/', tempurl).group(1) + self.html = self.load("http://www.easy-share.com/file_contents/captcha/" + id) + + challenge = re.search(r'Recaptcha\.create\("(.*?)"', self.html).group(1) + re_captcha = ReCaptcha(self) + challenge, result = re_captcha.challenge(challenge) + + link = re.search(r'', self.html).group(1) + id = re.search(r'file/id/(\d+)/', link) + self.download( link, post={"id" : id, + "recaptcha_challenge_field" : challenge, + "recaptcha_response_field": result} ) + -- cgit v1.2.3