From acc46fc3497a66a427b795b4a22c6e71d69185a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 13 Dec 2014 15:56:57 +0100 Subject: Update --- pyload/plugin/hoster/UpstoreNet.py | 73 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 pyload/plugin/hoster/UpstoreNet.py (limited to 'pyload/plugin/hoster/UpstoreNet.py') diff --git a/pyload/plugin/hoster/UpstoreNet.py b/pyload/plugin/hoster/UpstoreNet.py new file mode 100644 index 000000000..e0153c742 --- /dev/null +++ b/pyload/plugin/hoster/UpstoreNet.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- + +import re + +from pyload.plugin.internal.captcha import ReCaptcha +from pyload.plugin.internal.SimpleHoster import SimpleHoster, create_getInfo + + +class UpstoreNet(SimpleHoster): + __name = "UpstoreNet" + __type = "hoster" + __version = "0.03" + + __pattern = r'https?://(?:www\.)?upstore\.net/' + + __description = """Upstore.Net File Download Hoster""" + __license = "GPLv3" + __authors = [("igel", "igelkun@myopera.com")] + + + INFO_PATTERN = r'
.*?
\s*\n

(?P.*?)

\s*\n
\s*\n\s*(?P[\d.,]+) (?P[\w^_]+)' + OFFLINE_PATTERN = r'File not found' + + WAIT_PATTERN = r'var sec = (\d+)' + CHASH_PATTERN = r'' + LINK_PATTERN = r'' + + + def handleFree(self): + # STAGE 1: get link to continue + m = re.search(self.CHASH_PATTERN, self.html) + if m is None: + self.error(_("CHASH_PATTERN not found")) + chash = m.group(1) + self.logDebug("Read hash " + chash) + # continue to stage2 + post_data = {'hash': chash, 'free': 'Slow download'} + self.html = self.load(self.pyfile.url, post=post_data, decode=True) + + # STAGE 2: solv captcha and wait + # first get the infos we need: recaptcha key and wait time + recaptcha = ReCaptcha(self) + + # try the captcha 5 times + for i in xrange(5): + m = re.search(self.WAIT_PATTERN, self.html) + if m is None: + self.error(_("Wait pattern not found")) + wait_time = int(m.group(1)) + + # then, do the waiting + self.wait(wait_time) + + # then, handle the captcha + challenge, response = recaptcha.challenge() + post_data.update({'recaptcha_challenge_field': challenge, + 'recaptcha_response_field' : response}) + + self.html = self.load(self.pyfile.url, post=post_data, decode=True) + + # STAGE 3: get direct link + m = re.search(self.LINK_PATTERN, self.html, re.S) + if m: + break + + if m is None: + self.error(_("Download link not found")) + + direct = m.group(1) + self.download(direct, disposition=True) + + +getInfo = create_getInfo(UpstoreNet) -- cgit v1.2.3