예제 #1
0
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo


class XdadevelopersCom(SimpleHoster):
    __name__ = "XdadevelopersCom"
    __type__ = "hoster"
    __version__ = "0.03"

    __pattern__ = r'https?://(?:www\.)?forum\.xda-developers\.com/devdb/project/dl/\?id=\d+'
    __config__ = [("use_premium", "bool", "Use premium account if available",
                   True)]

    __description__ = """Xda-developers.com hoster plugin"""
    __license__ = "GPLv3"
    __authors__ = [("zapp-brannigan", "*****@*****.**")]

    NAME_PATTERN = r'<label>Filename:</label>\s*<div>\s*(?P<N>.*?)\n'
    SIZE_PATTERN = r'<label>Size:</label>\s*<div>\s*(?P<S>[\d.,]+)(?P<U>[\w^_]+)'
    OFFLINE_PATTERN = r'</i> Device Filter</h3>'

    def setup(self):
        self.multiDL = True
        self.resumeDownload = True
        self.chunkLimit = 1

    def handleFree(self, pyfile):
        self.link = pyfile.url + "&task=get"  #@TODO: Revert to `get={'task': "get"}` in 0.4.10


getInfo = create_getInfo(XdadevelopersCom)
예제 #2
0
# -*- coding: utf-8 -*-

from module.plugins.hoster.UnibytesCom import UnibytesCom
from module.plugins.internal.SimpleHoster import create_getInfo


class Share4webCom(UnibytesCom):
    __name__ = "Share4webCom"
    __type__ = "hoster"
    __pattern__ = r"http://(www\.)?share4web\.com/get/\w+"
    __version__ = "0.1"
    __description__ = """Share4web.com"""
    __author_name__ = ("zoidberg")

    DOMAIN = 'http://www.share4web.com'


getInfo = create_getInfo(UnibytesCom)
예제 #3
0
        self.logDebug(" > Rand " + rand_val)
        self.logDebug(" > Referer " + re_val)

        # Create post data
        post_data = {
            "op": op_val,
            "id": id_val,
            "rand": rand_val,
            "referer": re_val,
            "method_free": "+Free+Download",
            "method_premium": "",
            "down_direct": "1"
        }

        # Post and get new HTML source
        self.logDebug("Getting third HTML source")
        html = self.load(self.pyfile.url, post=post_data, decode=True)
        self.logDebug(" > Done")

        # Get link value
        if re.search(link_pattern, html) is not None:
            link_val = re.search(link_pattern, html).group(1)
            self.logDebug(" > Link " + link_val)
            self.download(link_val)
        else:
            self.logDebug("No link found!!")
            self.retry(3, 10, "No link found!!")


getInfo = create_getInfo(MovReelCom)
예제 #4
0
    SH_COOKIES = [("http://www.wrzuc.to", "language", "en")]
    FILE_SIZE_PATTERN = r'class="info">\s*<tr>\s*<td>(?P<S>.*?)</td>'
    FILE_NAME_PATTERN = r'id="file_info">\s*<strong>(?P<N>.*?)</strong>'

    def setup(self):
        self.multiDL = True

    def handleFree(self):
        data = dict(re.findall(r'(md5|file): "(.*?)"', self.html))
        if len(data) != 2:
            self.parseError('File ID')

        self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"])
        self.req.http.lastURL = self.pyfile.url
        self.load("http://www.wrzuc.to/ajax/server/prepair", post={"md5": data['md5']})

        self.req.http.lastURL = self.pyfile.url
        self.html = self.load("http://www.wrzuc.to/ajax/server/download_link", post={"file": data['file']})

        data.update(re.findall(r'"(download_link|server_id)":"(.*?)"', self.html))
        if len(data) != 4:
            self.parseError('Download URL')

        download_url = "http://%s.wrzuc.to/pobierz/%s" % (data['server_id'], data['download_link'])
        self.logDebug("Download URL: %s" % download_url)
        self.download(download_url)


getInfo = create_getInfo(WrzucTo)
예제 #5
0
        json = self.parseJson(rep)
        self.wait(json['time'])

        recaptcha = ReCaptcha(self)

        for _i in xrange(5):
            response, challenge = recaptcha.challenge()
            rep = self.load(
                r"http://luckyshare.net/download/verify/challenge/%s/response/%s/hash/%s"
                % (challenge, response, json['hash']),
                decode=True)
            self.logDebug("JSON: " + rep)
            if 'link' in rep:
                json.update(self.parseJson(rep))
                self.correctCaptcha()
                break
            elif 'Verification failed' in rep:
                self.invalidCaptcha()
            else:
                self.error(_("Unable to get downlaod link"))

        if not json['link']:
            self.fail(
                _("No Download url retrieved/all captcha attempts failed"))

        self.link = json['link']


getInfo = create_getInfo(LuckyShareNet)
예제 #6
0
파일: DlFreeFr.py 프로젝트: DasLampe/pyload
                self.fail("Cookie error")
            location = headers.get("location")
            self.req.setCookieJar(cj)
            self.download(location, disposition=True)
        else:
            self.fail("Invalid response")

    def getLastHeaders(self):
        #parse header
        header = {"code": self.req.code}
        for line in self.req.http.header.splitlines():
            line = line.strip()
            if not line or ":" not in line:
                continue

            key, none, value = line.partition(":")
            key = key.lower().strip()
            value = value.strip()

            if key in header:
                if type(header[key]) == list:
                    header[key].append(value)
                else:
                    header[key] = [header[key], value]
            else:
                header[key] = value
        return header


getInfo = create_getInfo(DlFreeFr)
예제 #7
0
    __type__    = "hoster"
    __version__ = "0.04"

    __pattern__ = r'https?://(?:www\.)?dropbox\.com/.+'
    __config__  = [("use_premium", "bool", "Use premium account if available", True)]

    __description__ = """Dropbox.com hoster plugin"""
    __license__     = "GPLv3"
    __authors__     = [("zapp-brannigan", "*****@*****.**")]


    NAME_PATTERN = r'<title>Dropbox - (?P<N>.+?)<'
    SIZE_PATTERN = r'&nbsp;&middot;&nbsp; (?P<S>[\d.,]+) (?P<U>[\w^_]+)'

    OFFLINE_PATTERN = r'<title>Dropbox - (404|Shared link error)<'

    COOKIES = [("dropbox.com", "lang", "en")]


    def setup(self):
        self.multiDL        = True
        self.chunkLimit     = 1
        self.resumeDownload = True


    def handleFree(self, pyfile):
        self.download(pyfile.url, get={'dl': "1"})


getInfo = create_getInfo(DropboxCom)
예제 #8
0
        captcha_url = "http://ints.rusfolder.com/random/images/?session=%s" % session_id
        for _ in xrange(5):
            self.html = self.load(url, cookies=True)
            action, inputs = self.parseHtmlForm('ID="Form1"')
            inputs['ints_session'] = re.search(self.INTS_SESSION_PATTERN,
                                               self.html).group(1)
            inputs[re.search(self.HIDDEN_INPUT_PATTERN,
                             self.html).group(1)] = '1'
            inputs['confirmed_number'] = self.decryptCaptcha(captcha_url,
                                                             cookies=True)
            inputs['action'] = '1'
            self.logDebug(inputs)

            self.html = self.load(url, decode=True, cookies=True, post=inputs)
            if self.WRONG_CAPTCHA_PATTERN in self.html:
                self.invalidCaptcha()
            else:
                break
        else:
            self.fail("Invalid captcha")

        download_url = re.search(self.DOWNLOAD_LINK_PATTERN,
                                 self.html).group(1)
        self.correctCaptcha()
        self.logDebug("Download URL: %s" % download_url)
        self.download(download_url)


getInfo = create_getInfo(IfolderRu)
예제 #9
0
        self.html = self.load(pyfile.url, decode=True)
        self.getFileInfo()

        # parse the name from the site and set attribute in pyfile
        parsed_vars = re.search(self.VAR_PATTERN, self.html)
        if parsed_vars is None: self.parseError("VARs")
        
        pyfile.name = parsed_vars.group('ID3')

        # download the file, destination is determined by pyLoad
        download_url = parsed_vars.group('Server') + "/download.php"
        self.log.debug("File:" + pyfile.name)
        self.log.debug("URL:" + download_url)

        self.download(download_url, post={
            "ID1": parsed_vars.group('ID1'),
            "ID2": parsed_vars.group('ID2'),
            "ID3": parsed_vars.group('ID3'),
            "ID4": parsed_vars.group('ID4')
        })

        # check download
        check = self.checkDownload({
            "no_slots": "obsazen na 100 %"
        })

        if check == "no_slots":
            self.retry(5, 600, "No free slots")

create_getInfo(QuickshareCz)
예제 #10
0
            'KB': 1,
            'MB': 2,
            'GB': 3
        }[found.group(3)]
        self.logInfo(
            "Data left: %s %s (%d MB needed)" %
            (found.group(2), found.group(3), self.pyfile.size / 1048576))

        if not data_left:
            found = re.search(self.PASSPORT_RENEW_PATTERN, self.html)
            renew = (found.group(1) + 60 *
                     (found.group(2) + 60 * found.group(3))) if found else 600
            self.retry(renew, 15, "Unable to get passport")

        self.handleDownload(False)

    def handleDownload(self, premium=False):
        # Find download link;
        found = re.search(self.DOWNLOAD_URL_PATTERN % (1 if premium else 2),
                          self.html)
        msg = '%s download URL' % ('Premium' if premium else 'Free')
        if not found:
            self.parseError(msg)

        download_url = found.group(1)
        self.logDebug("%s: %s" % (msg, download_url))
        self.download(download_url)


getInfo = create_getInfo(MegasharesCom)
예제 #11
0
    the Free Software Foundation; either version 3 of the License,
    or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    See the GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, see <http://www.gnu.org/licenses/>.

    @author: zoidberg
"""

import re
from module.plugins.hoster.CoolshareCz import CoolshareCz
from module.plugins.internal.SimpleHoster import create_getInfo

class WarserverCz(CoolshareCz):
    __name__ = "WarserverCz"
    __type__ = "hoster"
    __pattern__ = r"http://(?:\w*\.)?warserver.cz/stahnout/(?P<ID>\d+)/.+"
    __version__ = "0.11"
    __description__ = """Warserver.cz"""
    __author_name__ = ("zoidberg")
    
    FILE_NAME_PATTERN = r'<h1.*?>(?P<N>[^<]+)</h1>'
    DOMAIN = "http://s01.warserver.cz"           

getInfo = create_getInfo(WarserverCz)
예제 #12
0
    __authors__ = [("zapp-brannigan", "*****@*****.**"),
                   ("Walter Purcaro", "*****@*****.**"),
                   ("sraedler", "*****@*****.**")]

    INFO_PATTERN = r'title=\'.+?\'>(?P<N>.+?)</span><span class=\'light2\'>&nbsp;\((?P<S>\d+)&nbsp;(?P<U>[\w^_]+)\)<'
    HASHSUM_PATTERN = r'>(?P<T>MD5): (?P<H>\w+)'
    OFFLINE_PATTERN = r'<h1>Ooops!'

    LINK_PATTERN = r'var uri = "(.+?)"'
    TOKEN_PATTERN = r'var acc = (\d+)'

    WAIT_PATTERN = r'var XYZ = "(\d+)"'

    def setup(self):
        self.multiDL = True
        self.chunkLimit = 1

    def handleFree(self, pyfile):
        b = re.search(self.LINK_PATTERN, self.html)
        if not b:
            self.error(_("File url"))

        c = re.search(self.TOKEN_PATTERN, self.html)
        if not c:
            self.error(_("File token"))

        self.link = b.group(1) + "/zzz/" + c.group(1)


getInfo = create_getInfo(RemixshareCom)
예제 #13
0
            recaptcha_key = unquote(found.group(1))
            self.logDebug("RECAPTCHA KEY: %s" % recaptcha_key)
            recaptcha = ReCaptcha(self)
            inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge(recaptcha_key)
            return 1
        else:
            found = re.search(self.CAPTCHA_URL_PATTERN, self.html)
            if found:
                captcha_url = found.group(1)
                inputs['code'] = self.decryptCaptcha(captcha_url)
                return 2
            else:
                found = re.search(self.CAPTCHA_DIV_PATTERN, self.html, re.S)
                if found:
                    captcha_div = found.group(1)
                    self.logDebug(captcha_div)
                    numerals = re.findall('<span.*?padding-left\s*:\s*(\d+).*?>(\d)</span>', html_unescape(captcha_div))
                    inputs['code'] = "".join([a[1] for a in sorted(numerals, key = lambda num: int(num[0]))])
                    self.logDebug("CAPTCHA", inputs['code'], numerals)
                    return 3
                else:
                    found = re.search(self.SOLVEMEDIA_PATTERN, self.html)
                    if found:
                        captcha_key = found.group(1)
                        captcha = SolveMedia(self)
                        inputs['adcopy_challenge'], inputs['adcopy_response'] = captcha.challenge(captcha_key)
                        return 4
        return 0

getInfo = create_getInfo(XFileSharingPro)
예제 #14
0
        for _i in xrange(5):
            m = re.search(self.CAPTCHA_PATTERN, self.html)
            if m:
                url = urlparse.urljoin("http://crocko.com", m.group(1))
                self.wait(m.group(2))
                self.html = self.load(url)
            else:
                break

        m = re.search(self.FORM_PATTERN, self.html, re.S)
        if m is None:
            self.error(_("FORM_PATTERN not found"))

        action, form = m.groups()
        inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form))
        recaptcha = ReCaptcha(self)

        for _i in xrange(5):
            inputs['recaptcha_response_field'], inputs['recaptcha_challenge_field'] = recaptcha.challenge()
            self.download(action, post=inputs)

            if self.check_download({'captcha': recaptcha.KEY_AJAX_PATTERN}):
                self.captcha.invalid()
            else:
                break
        else:
            self.fail(_("No valid captcha solution received"))


getInfo = create_getInfo(CrockoCom)
예제 #15
0
    __type__ = "hoster"
    __pattern__ = r"http://(www\.)?catshare.net/\w{16}.*"
    __version__ = "0.01"
    __description__ = """CatShare.net Download Hoster"""
    __author_name__ = ("z00nx")
    __author_mail__ = ("*****@*****.**")

    FILE_INFO_PATTERN = r'<h3 class="pull-left"[^>]+>(?P<N>.*)</h3>\s+<h3 class="pull-right"[^>]+>(?P<S>.*)</h3>'
    FILE_OFFLINE_PATTERN = r'Podany plik zosta'
    SECONDS_PATTERN = 'var\s+count\s+=\s+(\d+);'
    RECAPTCHA_KEY = "6Lfln9kSAAAAANZ9JtHSOgxUPB9qfDFeLUI_QMEy"

    def handleFree(self):
        found = re.search(self.SECONDS_PATTERN, self.html)
        seconds = int(found.group(1))
        self.logDebug("Seconds found", seconds)
        self.setWait(seconds + 1)
        self.wait()
        recaptcha = ReCaptcha(self)
        challenge, code = recaptcha.challenge(self.RECAPTCHA_KEY)
        post_data = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": code}
        self.download(self.pyfile.url, post=post_data)
        check = self.checkDownload({"html": re.compile("\A<!DOCTYPE html PUBLIC")})
        if check == "html":
            self.logDebug("Wrong captcha entered")
            self.invalidCaptcha()
            self.retry()


getInfo = create_getInfo(CatShareNet)
예제 #16
0
            r"(?:Delay between downloads must be not less than|Try again in)\s*(\d+)\s*(hour|min)",
            self.html)
        if found:
            wait_time = int(found.group(1)) * {
                "hour": 60,
                "min": 1
            }[found.group(2)]
        else:
            found = re.search(
                r"You have reached your (daily|hourly) downloads limit",
                self.html)
            if found:
                wait_time = 60
            else:
                return

        self.logDebug("Waiting %d minutes" % wait_time)
        self.setWait(wait_time * 60, True)
        self.wait()
        self.retry(max_tries=24)

    def getJsonResponse(self, url):
        response = self.load(url, decode=True)
        if not response.startswith('{'):
            self.retry()
        self.logDebug(url, response)
        return json_loads(response)


getInfo = create_getInfo(RapidgatorNet)
예제 #17
0
        if check:
            a = int(re.search(r'<script type="text/javascript">([^<]*?)(var a = (\d*);)', self.html).group(3))
            k = int(re.search(r'<script type="text/javascript">([^<]*?)(\d*%(\d*))', self.html).group(3))
            checksum = ((a + 3) % k) * ((a + 3) % 3) + 18
        else:
            # This might work but is insecure
            # checksum = eval(re.search("((\d*)\s\%\s(\d*)\s\+\s(\d*)\s\%\s(\d*))", self.html).group(0))

            m = re.search(r"((?P<a>\d*)\s%\s(?P<b>\d*)\s\+\s(?P<c>\d*)\s%\s(?P<k>\d*))", self.html)
            if not m:
                self.parseError("Unable to detect values to calculate direct link")
            a = int(m.group("a"))
            b = int(m.group("b"))
            c = int(m.group("c"))
            k = int(m.group("k"))
            if a == c:
                checksum = ((a % b) + (a % k))
            else:
                checksum = ((a % b) + (c % k))

        self.logInfo('Checksum: %s' % checksum)

        filename = re.search(r'>Name:</font>\s*<font [^>]*>(?P<N>[^<]+)</font><br />', self.html).group('N')

        url = "/d/%s/%s/%s" % (number, checksum, filename)
        self.logInfo(self.file_info['HOST'] + url)
        return self.file_info['HOST'] + url


getInfo = create_getInfo(ZippyshareCom)
예제 #18
0
        return swfdump

    def do_recaptcha(self):
        self.logDebug('Trying to solve captcha')
        captcha_key = re.search(self.CAPTCHA_KEY_PATTERN, self.html).group(1)
        shortencode = re.search(self.CAPTCHA_SHORTENCODE_PATTERN, self.html).group(1)
        url = re.search(self.CAPTCHA_DOWNLOAD_PATTERN, self.html).group(1)

        recaptcha = ReCaptcha(self)

        for i in range(5):
            challenge, code = recaptcha.challenge(captcha_key)

            response = json_loads(self.load(self.file_info['HOST'] + '/rest/captcha/test',
                                            post={'challenge': challenge,
                                                  'response': code,
                                                  'shortencode': shortencode}))
            self.logDebug("reCaptcha response : %s" % response)
            if response == True:
                self.correctCaptcha()
                break
            else:
                self.invalidCaptcha()
        else:
            self.fail("Invalid captcha")

        return url


getInfo = create_getInfo(ZippyshareCom)
예제 #19
0
        self.wantReconnect = False
        self.multiDL = True
        self.chunkLimit = -1
        self.resumeDownload = True

    def handleFree(self):
        tokenlink = re.search(self.FILE_TOKEN_PATTERN, self.html)
        continuelink = re.search(self.FILE_CONTINUE_PATTERN, self.html)
        if (not tokenlink) or (not continuelink):
            self.fail('Plugin out of Date')

        wait = 60
        found = re.search(self.FILE_WAIT_PATTERN, self.html)
        if found: wait = int(found.group(1))

        self.html = self.load("http://www.nowdownload.eu" +
                              str(tokenlink.group(1)))
        self.setWait(wait)
        self.wait()

        self.html = self.load("http://www.nowdownload.eu" +
                              str(continuelink.group(1)))

        url = re.search(self.FILE_DOWNLOAD_LINK, self.html)
        if not url: self.fail('Download Link not Found (Plugin out of Date?)')
        self.logDebug('Download link: ' + str(url.group(1)))
        self.download(str(url.group(1)))


getInfo = create_getInfo(NowDownloadEu)
예제 #20
0
        self.wait()


    def check_file(self):
        #: Check download
        check = self.check_download({
            "temp offline" : re.compile(r"^Soubor je do.*asn.* nedostupn.*$"),
            'credit'       : re.compile(r"^Nem.*te dostate.*n.* kredit.$"),
            "multi-dl"     : re.compile(self.MULTIDL_PATTERN),
            'captcha'      : "<li>Zadaný ověřovací kód nesouhlasí!</li>"
        })

        if check == "temp offline":
            self.fail(_("File not available - try later"))

        elif check == "credit":
            self.restart(nopremium=True)

        elif check == "multi-dl":
            self.wait(5 * 60, 12, _("Download limit reached"))

        elif check == "captcha":
            self.captcha.invalid()
            self.retry()

        return super(CzshareCom, self).check_file()


getInfo = create_getInfo(CzshareCom)
예제 #21
0
                out = self.js.eval(self.jscode)
                self.logDebug("URL", self.js.engine, out)
                if out.startswith('/download/'):
                    return "http://turbobit.net%s" % out.strip()

            except Exception, e:
                self.logError(e)
        else:
            if self.retries >= 2:
                # retry with updated js
                self.delStorage("rtUpdate")
            else:
                self.retry()

        self.wait()

    def decrypt(self, data):
        cipher = ARC4.new(
            binascii.hexlify(
                'E\x15\xa1\x9e\xa3M\xa0\xc6\xa0\x84\xb6H\x83\xa8o\xa0'))
        return binascii.unhexlify(cipher.encrypt(binascii.unhexlify(data)))

    def getLocalTimeString(self):
        lt = time.localtime()
        tz = time.altzone if lt.tm_isdst else time.timezone
        return "%s GMT%+03d%02d" % (time.strftime("%a %b %d %Y %H:%M:%S",
                                                  lt), -tz // 3600, tz % 3600)


getInfo = create_getInfo(TurbobitNet)
예제 #22
0
    def handle_free(self, pyfile):
        m = re.search(self.CAPTCHA_PATTERN, self.html)
        if m is None:
            self.error(_("Captcha not found"))

        captcha = self.captcha.decrypt(urlparse.urljoin("http://uploadhero.co", m.group(1)))

        self.html = self.load(pyfile.url,
                              get={'code': captcha})

        m = re.search(self.LINK_FREE_PATTERN, self.html)
        if m:
            self.link = m.group(1) or m.group(2)
            self.wait(50)


    def check_errors(self):
        m = re.search(self.IP_BLOCKED_PATTERN, self.html)
        if m:
            self.html = self.load(urlparse.urljoin("http://uploadhero.co", m.group(1)))

            m = re.search(self.IP_WAIT_PATTERN, self.html)
            wait_time = (int(m.group(1)) * 60 + int(m.group(2))) if m else 5 * 60
            self.wait(wait_time, True)
            self.retry()

        return super(UploadheroCom, self).check_errors()


getInfo = create_getInfo(UploadheroCom)
예제 #23
0
                get_data = {"type": "recaptcha"}
                get_data["challenge"], get_data[
                    "capture"] = recaptcha.challenge(captcha_key)
                response = json_loads(
                    self.load("http://extabit.com/file/%s/" % fileID,
                              get=get_data))
                if "ok" in response:
                    self.correctCaptcha()
                    break
                else:
                    self.invalidCaptcha()
            else:
                self.fail("Invalid captcha")
        else:
            self.parseError('Captcha')

        if not "href" in response:
            self.parseError('JSON')

        self.html = self.load("http://extabit.com/file/%s%s" %
                              (fileID, response['href']))
        m = re.search(self.DOWNLOAD_LINK_PATTERN, self.html)
        if not m:
            self.parseError('Download URL')
        url = m.group(1)
        self.logDebug("Download URL: " + url)
        self.download(url)


getInfo = create_getInfo(ExtabitCom)
예제 #24
0
                    return "http://turbobit.net%s" % out.strip()
            except Exception, e:
                self.logError(e)
        else:
            if self.retries >= 2:
                # retry with updated js
                self.delStorage("rtUpdate")
            self.retry()

    def decrypt(self, data):
        cipher = ARC4.new(hexlify('E\x15\xa1\x9e\xa3M\xa0\xc6\xa0\x84\xb6H\x83\xa8o\xa0'))
        return unhexlify(cipher.encrypt(unhexlify(data)))
    
    def getLocalTimeString(self):
        lt = time.localtime()
        tz = time.altzone if lt.tm_isdst else time.timezone 
        return "%s GMT%+03d%02d" % (time.strftime("%a %b %d %Y %H:%M:%S", lt), -tz // 3600, tz % 3600)        

    def handlePremium(self):
        self.logDebug("Premium download as user %s" % self.user)
        self.downloadFile()

    def downloadFile(self):
        found = re.search(self.DOWNLOAD_URL_PATTERN, self.html)
        if not found: self.parseError("download link")
        self.url = "http://turbobit.net" + found.group('url')
        self.logDebug(self.url)
        self.download(self.url)

getInfo = create_getInfo(TurbobitNet)
예제 #25
0
            elif hasattr(m, 'group'):
                downloadURL = m.group('link')
                self.correctCaptcha()
                break
            else:
                self.fail('Unknown error - Plugin may be out of date')

        if not downloadURL:
            self.fail("No Download url retrieved/all captcha attempts failed")

        self.download(downloadURL, disposition=True)

    def handlePremium(self):
        header = self.load(self.pyfile.url, just_header=True)
        if header.has_key('location'):
            self.logDebug('DIRECT LINK from header: ' + header['location'])
            self.download(header['location'])
        else:
            self.html = self.load(self.pyfile.url, decode=True)
            self.getFileInfo()
            m = re.search(r'<a href="(?P<link>[^"]+)">Download ></a>',
                          self.html)
            if not m:
                self.parseError('Unable to detect direct download url')
            else:
                self.logDebug('DIRECT URL from html: ' + m.group('link'))
                self.download(m.group('link'), disposition=True)


getInfo = create_getInfo(EgoFilesCom)
예제 #26
0
        self.header = self.req.http.header
        self.req.http.c.setopt(FOLLOWLOCATION, 1)

        m = re.search(r'Location\s*:\s*(.+)', self.header, re.I)
        if m is None:
            self.fail(_("File not found"))
        download_url = m.group(1).rstrip()  #@TODO: Remove .rstrip() in 0.4.10
        self.logDebug("FREE URL2:" + download_url)

        # check errors
        m = re.search(r'/chyba/(\d+)', download_url)
        if m:
            if m.group(1) == '1':
                self.retry(60, 2 * 60, "This IP is already downloading")
            elif m.group(1) == '2':
                self.retry(60, 60, "No free slots available")
            else:
                self.fail(_("Error %d") % m.group(1))

        # download file
        self.download(download_url)


    def handlePremium(self, pyfile):
        download_url = '%s/download_premium.php' % self.jsvars['server']
        data = dict((x, self.jsvars[x]) for x in self.jsvars if x in ("ID1", "ID2", "ID4", "ID5"))
        self.download(download_url, get=data)


getInfo = create_getInfo(QuickshareCz)
    NAME_PATTERN    = r'(?:<title>|class="uc-name-size".*>)(?P<N>.+?)(?: - Google Drive</title>|</a> \()'
    OFFLINE_PATTERN = r'align="center"><p class="errorMessage"'

    LINK_FREE_PATTERN = r'"([^"]+uc\?.*?)"'


    def setup(self):
        self.multiDL        = True
        self.resume_download = True
        self.chunk_limit     = 1


    def handle_free(self, pyfile):
        for _i in xrange(2):
            m = re.search(self.LINK_FREE_PATTERN, self.data)

            if m is None:
                return

            link = self.fixurl(link, "https://docs.google.com/")
            dl   = self.isdownload(link, redirect=False)

            if not dl:
                self.data = self.load(link)
            else:
                self.link = dl
                break


getInfo = create_getInfo(GoogledriveCom)
예제 #28
0
        else:
            self.fail("No valid captcha code entered")

        #download url
        self.html = self.load("http://bezvadata.cz%s" % action, post=inputs)
        self.checkErrors()
        found = re.search(r'<a class="stahnoutSoubor2" href="(.*?)">', self.html)
        if not found:
            self.parseError("page2 URL")
        url = "http://bezvadata.cz%s" % found.group(1)
        self.logDebug("DL URL %s" % url)

        #countdown
        found = re.search(r'id="countdown">(\d\d):(\d\d)<', self.html)
        wait_time = (int(found.group(1)) * 60 + int(found.group(2)) + 1) if found else 120
        self.wait(wait_time, False)

        self.download(url)

    def checkErrors(self):
        if 'images/button-download-disable.png' in self.html:
            self.longWait(5 * 60, 24)  # parallel dl limit
        elif '<div class="infobox' in self.html:
            self.tempOffline()

    def loadcaptcha(self, data, *args, **kwargs):
        return data.decode("base64")


getInfo = create_getInfo(BezvadataCz)
예제 #29
0
                   ("chk_filesize", "bool", "Check file size"                                  , True),
                   ("max_wait"    , "int" , "Reconnect if waiting time is greater than minutes", 10  )]

    __description__ = """Filepup.net hoster plugin"""
    __license__     = "GPLv3"
    __authors__     = [("zapp-brannigan", "*****@*****.**"),
                       ("Walter Purcaro", "*****@*****.**")]


    NAME_PATTERN = r'>(?P<N>.+?)</h1>'
    SIZE_PATTERN = r'class="fa fa-archive"></i> \((?P<S>[\d.,]+) (?P<U>[\w^_]+)'

    OFFLINE_PATTERN = r'>This file has been deleted'

    LINK_FREE_PATTERN = r'(http://www\.filepup\.net/get/.+?)\''


    def setup(self):
        self.multiDL = False
        self.chunk_limit = 1


    def handle_free(self, pyfile):
        m = re.search(self.LINK_FREE_PATTERN, self.data)
        if m is not None:
            dl_link = m.group(1)
            self.download(dl_link, post={'task': "download"})


getInfo = create_getInfo(FilepupNet)
예제 #30
0
    FILE_INFO_PATTERN = r'<span style="[^"]*" title="[^"]*">(?P<N>.*?) \((?P<S>[\d.]+) (?P<U>\w+)\)</span>'
    FILE_OFFLINE_PATTERN = r'<span style="[^"]*" title="File Not Found">File Not Found</span>'

    CHASH_PATTERN = r'<input type="hidden" name="chash" value="([^"]*)" />'
    DIRECT_LINK_PATTERN = r"clip: {\s*url: '(https?://(?:www\.)promptfile[^']*)',"

    def handleFree(self):
        # STAGE 1: get link to continue
        m = re.search(self.CHASH_PATTERN, self.html)
        if not m:
            self.parseError("Unable to detect chash")
        chash = m.group(1)
        self.logDebug("read chash %s" % chash)
        # continue to stage2
        self.html = self.load(self.pyfile.url,
                              decode=True,
                              post={'chash': chash})

        # STAGE 2: get the direct link
        m = re.search(self.DIRECT_LINK_PATTERN, self.html,
                      re.MULTILINE | re.DOTALL)
        if not m:
            self.parseError("Unable to detect direct link")
        direct = m.group(1)
        self.logDebug('found direct link: ' + direct)
        self.download(direct, disposition=True)


getInfo = create_getInfo(PromptfileCom)
예제 #31
0
    def handle_captcha(self):
        post_data = {'free'               : 1,
                     'freeDownloadRequest': 1,
                     'uniqueId'           : self.fid,
                     'yt0'                : ''}

        m = re.search(r'id="(captcha\-form)"', self.html)
        self.log_debug("captcha-form found %s" % m)

        m = re.search(self.CAPTCHA_PATTERN, self.html)
        self.log_debug("CAPTCHA_PATTERN found %s" % m)
        if m:
            captcha_url = urlparse.urljoin("http://keep2s.cc/", m.group(1))
            post_data['CaptchaForm[code]'] = self.captcha.decrypt(captcha_url)
        else:
            recaptcha = ReCaptcha(self)
            response, challenge = recaptcha.challenge()
            post_data.update({'recaptcha_challenge_field': challenge,
                              'recaptcha_response_field' : response})

        self.html = self.load(self.pyfile.url, post=post_data)

        if 'verification code is incorrect' not in self.html:
            self.captcha.correct()
        else:
            self.captcha.invalid()


getInfo = create_getInfo(Keep2ShareCc)
예제 #32
0
        else:
            self.parseError("FORM: %s" % (inputs["op"] if "op" in inputs else "UNKNOWN"))

    def handleCaptcha(self, inputs):
        found = re.search(self.RECAPTCHA_URL_PATTERN, self.html)
        if found:
            recaptcha_key = unquote(found.group(1))
            self.logDebug("RECAPTCHA KEY: %s" % recaptcha_key)
            recaptcha = ReCaptcha(self)
            inputs["recaptcha_challenge_field"], inputs["recaptcha_response_field"] = recaptcha.challenge(recaptcha_key)
            return 1
        else:
            found = re.search(self.CAPTCHA_URL_PATTERN, self.html)
            if found:
                captcha_url = found.group(1)
                inputs["code"] = self.decryptCaptcha(captcha_url)
                return 2
            else:
                found = re.search(self.CAPTCHA_DIV_PATTERN, self.html, re.S)
                if found:
                    captcha_div = found.group(1)
                    self.logDebug(captcha_div)
                    numerals = re.findall("<span.*?padding-left\s*:\s*(\d+).*?>(\d)</span>", html_unescape(captcha_div))
                    inputs["code"] = "".join([a[1] for a in sorted(numerals, key=lambda num: int(num[0]))])
                    self.logDebug("CAPTCHA", inputs["code"], numerals)
                    return 3
        return 0


getInfo = create_getInfo(XFileSharingPro)
        if m is None:
            self.error(_("LINK_FREE_PATTERN not found"))

        url = m.group(1)

        self.log_debug(('FREEUSER' if m.group(2) == "download" else 'GUEST') + ' URL', url)

        res = json.loads(self.load(urlparse.urljoin("http://115.com/", url), decode=False))
        if "urls" in res:
            mirrors = res['urls']

        elif "data" in res:
            mirrors = res['data']

        else:
            mirrors = None

        for mr in mirrors:
            try:
                self.link = mr['url'].replace("\\", "")
                self.log_debug("Trying URL: " + self.link)
                break

            except Exception:
                pass
        else:
            self.fail(_("No working link found"))


getInfo = create_getInfo(YibaishiwuCom)
예제 #34
0
        download_url = found.group(1)
        self.logDebug(download_url)
        self.download(download_url)

    def checkWait(self):
        found = re.search(r"(?:Delay between downloads must be not less than|Try again in)\s*(\d+)\s*(hour|min)",
                          self.html)
        if found:
            wait_time = int(found.group(1)) * {"hour": 60, "min": 1}[found.group(2)]
        else:
            found = re.search(r"You have reached your (daily|hourly) downloads limit", self.html)
            if found:
                wait_time = 60
            else:
                return

        self.logDebug("Waiting %d minutes" % wait_time)
        self.setWait(wait_time * 60, True)
        self.wait()
        self.retry(max_tries=24)

    def getJsonResponse(self, url):
        response = self.load(url, decode=True)
        if not response.startswith('{'):
            self.retry()
        self.logDebug(url, response)
        return json_loads(response)


getInfo = create_getInfo(RapidgatorNet)
예제 #35
0
    INFO_PATTERN = r'<title>(?P<N>.+) \((?P<S>[\d.,]+) (?P<U>[\w^_]+)\)<'
    OFFLINE_PATTERN = r'<div class="alert alert-error"'

    IP_BLOCKED_PATTERN = ur'>Nasz serwis wykrył że Twój adres IP nie pochodzi z Polski.<'
    WAIT_PATTERN       = r'var\scount\s=\s(\d+);'

    LINK_FREE_PATTERN    = r'<form action="(.+?)" method="GET">'
    LINK_PREMIUM_PATTERN = r'<form action="(.+?)" method="GET">'


    def setup(self):
        self.multiDL        = self.premium
        self.resume_download = True


    def handle_free(self, pyfile):
        recaptcha = ReCaptcha(self)

        response, challenge = recaptcha.challenge()
        self.data = self.load(pyfile.url,
                              post={'recaptcha_challenge_field': challenge,
                                    'recaptcha_response_field' : response})

        m = re.search(self.LINK_FREE_PATTERN, self.data)
        if m is not None:
            self.link = m.group(1)


getInfo = create_getInfo(CatShareNet)
예제 #36
0
            self.account.relogin()
            self.retry(msg=_("User not logged in"))

        self.link = pyfile.url.rstrip('/') + "/download/"

        check = self.check_file({
            'login': re.compile(self.ERROR_PATTERN),
            'json' : re.compile(r'\{"status":"error".*?"message":"(.*?)"')
        })

        if check == "login" or (check == "json" and self.last_check.group(1) == "Access token expired"):
            self.account.relogin()
            self.retry(msg=_("Access token expired"))

        elif check == "json":
            self.fail(self.last_check.group(1))


    def handle_free(self, pyfile):
        if re.search(self.DL_LIMIT_PATTERN, self.data):
            self.wait(5 * 60, 12, _("Download limit reached"))

        m = re.search(self.LINK_FREE_PATTERN, self.data)
        if m is None:
            self.error(_("LINK_FREE_PATTERN not found"))

        self.link = m.group(1)


getInfo = create_getInfo(EuroshareEu)
예제 #37
0
class DataHu(SimpleHoster):
    __name__    = "DataHu"
    __type__    = "hoster"
    __version__ = "0.06"
    __status__  = "testing"

    __pattern__ = r'http://(?:www\.)?data\.hu/get/\w+'
    __config__  = [("activated"   , "bool", "Activated"                                        , True),
                   ("use_premium" , "bool", "Use premium account if available"                 , True),
                   ("fallback"    , "bool", "Fallback to free download if premium fails"       , True),
                   ("chk_filesize", "bool", "Check file size"                                  , True),
                   ("max_wait"    , "int" , "Reconnect if waiting time is greater than minutes", 10  )]

    __description__ = """Data.hu hoster plugin"""
    __license__     = "GPLv3"
    __authors__     = [("crash", None),
                       ("stickell", "*****@*****.**")]


    INFO_PATTERN = ur'<title>(?P<N>.*) \((?P<S>[^)]+)\) let\xf6lt\xe9se</title>'
    OFFLINE_PATTERN = ur'Az adott f\xe1jl nem l\xe9tezik'
    LINK_FREE_PATTERN = r'<div class="download_box_button"><a href="(.+?)">'


    def setup(self):
        self.resume_download = True
        self.multiDL        = self.premium


getInfo = create_getInfo(DataHu)
예제 #38
0
                if 'response' in params:
                    self.correctCaptcha()
                link = unquote(found.group(1))
                self.logDebug("LINK: %s" % link)
                break
            else:
                self.parseError('Download link')
        else:
            self.fail('No valid captcha response received')

        try:
            self.download(link, disposition=True)
        except:
            self.retry(wait_time=60)

    def handlePremium(self):
        if '<span class="html_download_api-gold_traffic_limit">' in self.html:
            self.logWarning("Download limit reached")
            self.retry(25, 60 * 60, "Download limit reached")
        elif 'onClick="show_gold_offer' in self.html:
            self.account.relogin(self.user)
            self.retry()
        link = unquote(
            re.search(
                '<div id="download_url">\s*<a href="(http://.+?\.depositfiles.com/.+?)"',
                self.html).group(1))
        self.download(link, disposition=True)


getInfo = create_getInfo(DepositfilesCom)
예제 #39
0
            found = re.search(self.DOWNLOAD_URL_PATTERN, self.html)
            if found:
                if 'captcha_hash' in params:
                    self.correctCaptcha()
                download_url = found.group(1)
                break

            found = re.search(self.CAPTCHA_PATTERN, self.html)
            if found:
                if 'captcha_hash' in params:
                    self.invalidCaptcha()
                captcha_url1 = "http://www.sendspace.com/" + found.group(1)
                found = re.search(self.USER_CAPTCHA_PATTERN, self.html)
                captcha_url2 = "http://www.sendspace.com/" + found.group(1)
                params = {'captcha_hash': found.group(2),
                          'captcha_submit': 'Verify',
                          'captcha_answer': self.decryptCaptcha(captcha_url1) + " " + self.decryptCaptcha(captcha_url2)}
            else:
                params = {'download': "Regular Download"}

            self.logDebug(params)
            self.html = self.load(self.pyfile.url, post=params)
        else:
            self.fail("Download link not found")

        self.logDebug("Download URL: %s" % download_url)
        self.download(download_url)


create_getInfo(SendspaceCom)
                        'error'  : e.message}

        else:
            info = {'status' : 8,
                    'error'  : _("Too many redirects")}

        return info


    def handle_free(self, pyfile):
        self.check_errors()

        url, inputs = self.parse_html_form('action="https://1fichier.com/\?[\w^_]+')

        if not url:
            return

        if "pass" in inputs:
            inputs['pass'] = self.get_password()

        inputs['submit'] = "Download"

        self.download(url, post=inputs)


    def handle_premium(self, pyfile):
        self.download(pyfile.url, post={'did': 0, 'dl_no_ssl': "on"})


getInfo = create_getInfo(OneFichierCom)
예제 #41
0
파일: VeohCom.py 프로젝트: sraedler/pyload
    __description__ = """Veoh.com hoster plugin"""
    __author_name__ = "Walter Purcaro"
    __author_mail__ = "*****@*****.**"

    FILE_NAME_PATTERN = r'<meta name="title" content="(?P<N>.*?)"'
    FILE_OFFLINE_PATTERN = r'>Sorry, we couldn\'t find the video you were looking for'

    FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.veoh.com/watch/\g<ID>')
                             ]

    SH_COOKIES = [(".veoh.com", "lassieLocale", "en")]

    def setup(self):
        self.resumeDownload = self.multiDL = True
        self.chunkLimit = -1

    def handleFree(self):
        q = self.getConfig("quality")
        pattern = r'"fullPreviewHash%sPath":"(.+?)"' % q
        found = re.search(pattern, self.html)
        if found:
            self.pyfile.name += ".mp4"
            link = found.group(1).replace("\\", "")
            self.logDebug("Download link: " + link)
            self.download(link)
        else:
            self.fail("No %s quality video found" % q.lower())


getInfo = create_getInfo(VeohCom)
예제 #42
0
            if found:
                if 'response' in params:
                    self.correctCaptcha()
                link = unquote(found.group(1))
                self.logDebug("LINK: %s" % link)
                break
            else:
                self.parseError('Download link')
        else:
            self.fail('No valid captcha response received')

        try:
            self.download(link, disposition=True)
        except:
            self.retry(wait_time=60)

    def handlePremium(self):
        if '<span class="html_download_api-gold_traffic_limit">' in self.html:
            self.logWarning("Download limit reached")
            self.retry(25, 3600, "Download limit reached")
        elif 'onClick="show_gold_offer' in self.html:
            self.account.relogin(self.user)
            self.retry()
        link = unquote(
            re.search('<div id="download_url">\s*<a href="(http://.+?\.depositfiles.com/.+?)"', self.html).group(1))
        self.multiDL = True
        self.download(link, disposition=True)


getInfo = create_getInfo(DepositfilesCom)
예제 #43
0
파일: FilerNet.py 프로젝트: jmcabgam/pyload
            if 'location' in self.req.http.header:
                location = re.search(r'location: (\S+)', self.req.http.header).group(1)
                downloadURL = 'http://filer.net' + location
                self.correctCaptcha()
                break
            else:
                self.logInfo('Wrong captcha')
                self.invalidCaptcha()

        if not downloadURL:
            self.fail("No Download url retrieved/all captcha attempts failed")

        self.download(downloadURL, disposition=True)

    def handlePremium(self):
        header = self.load(self.pyfile.url, just_header=True)
        if 'location' in header:  # Direct Download ON
            dl = self.pyfile.url
        else:  # Direct Download OFF
            html = self.load(self.pyfile.url)
            m = re.search(self.DIRECT_LINK_PATTERN, html)
            if not m:
                self.parseError("Unable to detect direct link, try to enable 'Direct download' in your user settings")
            dl = 'http://filer.net' + m.group(1)

        self.logDebug('Direct link: ' + dl)
        self.download(dl, disposition=True)


getInfo = create_getInfo(FilerNet)
예제 #44
0
        for i in xrange(5):
            challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY)
            post_data = {
                'recaptcha_challenge_field': challenge,
                'recaptcha_response_field': response,
                'hash': hash_data
            }

            # Workaround for 0.4.9 just_header issue. In 0.5 clean the code using just_header
            self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0)
            self.load(self.pyfile.url, post=post_data)
            self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1)

            if 'location' in self.req.http.header:
                location = re.search(r'location: (\S+)',
                                     self.req.http.header).group(1)
                downloadURL = 'http://filer.net' + location
                self.correctCaptcha()
                break
            else:
                self.logInfo('Wrong captcha')
                self.invalidCaptcha()

        if not downloadURL:
            self.fail("No Download url retrieved/all captcha attempts failed")

        self.download(downloadURL, disposition=True)


getInfo = create_getInfo(FilerNet)
예제 #45
0
파일: DateiTo.py 프로젝트: keat01/pyLoad
                    1) if found else "6LdBbL8SAAAAAI0vKUo58XRwDd5Tu_Ze1DA7qTao"

                data['recaptcha_challenge_field'], data[
                    'recaptcha_response_field'] = recaptcha.challenge(
                        recaptcha_key)

        else:
            self.fail('Too bad...')

        download_url = self.html
        self.logDebug('Download URL', download_url)
        self.download(download_url)

    def checkErrors(self):
        found = re.search(self.PARALELL_PATTERN, self.html)
        if found:
            self.setWait(wait_time + 1, False)
            self.wait(300)
            self.retry()

    def doWait(self):
        found = re.search(self.WAIT_PATTERN, self.html)
        wait_time = int(found.group(1)) if found else 30
        self.setWait(wait_time + 1, False)

        self.load('http://datei.to/ajax/download.php', post={'P': 'Ads'})
        self.wait()


getInfo = create_getInfo(DateiTo)
예제 #46
0
            self.retry(max_tries=5, reason="Wrong captcha")

    def handlePremium(self):
        header = self.load(self.pyfile.url, just_header=True)
        if "location" in header:
            url = header["location"]
        else:
            self.html = self.load(self.pyfile.url)

            self.getFileInfo()  #

            if self.CREDIT_PATTERN in self.html:
                self.logWarning("Not enough traffic left")
                self.resetAccount()
            else:
                found = re.search(self.PREMIUM_URL_PATTERN, self.html)
                if found:
                    url = found.group(1)
                else:
                    self.parseError("Premium URL")

        self.logDebug("PREMIUM URL: " + url)
        self.download(url, disposition=True)

        check = self.checkDownload({"credit": re.compile(self.CREDIT_PATTERN)})
        if check == "credit":
            self.resetAccount()


getInfo = create_getInfo(FastshareCz)
예제 #47
0
                             'wst'  : ""})

        if not re.search(r'<status>OK', api):
            info['status'] = 1
        else:
            info['status'] = 2
            info['name']   = re.search(r'<name>(.+?)<', api).group(1)
            info['size']   = re.search(r'<size>(.+?)<', api).group(1)

        return info


    def handle_free(self, pyfile):
        wst = self.account.get_data('wst') if self.account else None

        api_data = get_url("https://webshare.cz/api/file_link/",
                           post={'ident': self.info['pattern']['ID'], 'wst': wst})

        self.log_debug("API data: " + api_data)

        m = re.search('<link>(.+)</link>', api_data)
        if m is not None:
            self.link = m.group(1)


    def handle_premium(self, pyfile):
        return self.handle_free(pyfile)


getInfo = create_getInfo(WebshareCz)
예제 #48
0
    URL_REPLACEMENTS = [(__pattern__ + ".*", r'http://www.veoh.com/watch/\g<ID>')]

    COOKIES = [("veoh.com", "lassieLocale", "en")]


    def setup(self):
        self.resume_download = True
        self.multiDL        = True
        self.chunk_limit     = -1


    def handle_free(self, pyfile):
        quality = self.get_config('quality')
        if quality == "Auto":
            quality = ("High", "Low")

        for q in quality:
            pattern = r'"fullPreviewHash%sPath":"(.+?)"' % q
            m = re.search(pattern, self.html)
            if m:
                pyfile.name += ".mp4"
                self.link = m.group(1).replace("\\", "")
                return
            else:
                self.log_info(_("No %s quality video found") % q.upper())
        else:
            self.fail(_("No video found!"))


getInfo = create_getInfo(VeohCom)
예제 #49
0
        self.handle_errors(res, '#')

        url = res.split("#")[-1]

        return url


    def handle_errors(self, res, separator):
        self.log_debug("Checking response [%s]" % res)
        if "ERROR:Session timed out" in res:
            self.retry()

        elif "ERROR" in res:
            msg = res.split(separator)[-1]
            self.fail(msg)


    def handle_captcha_errors(self, res):
        self.log_debug("Result of captcha resolving [%s]" % res)
        if "SUCCESS" in res:
            self.captcha.correct()

        elif "ERROR:SESSION ERROR" in res:
            self.retry()

        else:
            self.retry_captcha()


getInfo = create_getInfo(BitshareCom)
예제 #50
0
        if response["dl"]:
            self.html = self.load('http://filecloud.io/download.html')
            found = re.search(self.DOWNLOAD_LINK_PATTERN % self.file_info['ID'], self.html)
            if not found:
                raise PluginParseError("Download URL")
            download_url = found.group(1)
            self.logDebug("Download URL: %s" % download_url)

            if "size" in self.file_info and self.file_info['size']:
                self.check_data = {"size": int(self.file_info['size'])}
            self.download(download_url)
        else:
            self.fail("Unexpected server response")

    def handlePremium(self):
        akey = self.account.getAccountData(self.user)['akey']
        ukey = self.file_info['ID']
        self.logDebug("Akey: %s | Ukey: %s" % (akey, ukey))
        rep = self.load("http://api.filecloud.io/api-fetch_download_url.api",
                        post={"akey": akey, "ukey": ukey})
        self.logDebug("FetchDownloadUrl: " + rep)
        rep = json_loads(rep)
        if rep['status'] == 'ok':
            self.download(rep['download_url'], disposition=True)
        else:
            self.fail(rep['message'])


getInfo = create_getInfo(FilecloudIo)
예제 #51
0
    __author_name__ = ("zoidberg")

    FILE_NAME_PATTERN = r'<h1 id="filename"[^>]*>(?P<N>[^<]+)</h1>'
    FILE_SIZE_PATTERN = r'<strong id="FileSize_master">(?P<S>[0-9.]*)&nbsp;(?P<U>[kKMG])i?B</strong>'
    FILE_OFFLINE_PATTERN = r'<h1>File not found.</h1>'
    SHOW_WINDOW_PATTERN = r'<a href="([^?]+/(\d+)/\?do=(fileDownloadButton|relatedFileDownloadButton-\2)-showDownloadWindow)"'

    def setup(self):
        self.resumeDownload = self.multiDL = True if self.account else False
        self.chunkLimit = 1

    def process(self, pyfile):
        if not self.account:
            self.fail("User not logged in")
        pyfile.url = re.search(self.__pattern__, pyfile.url).group(1)
        self.html = self.load(pyfile.url, decode=True)
        self.getFileInfo()
        if not self.checkTrafficLeft():
            self.fail("Not enough traffic left for user %s." % self.user)

        found = re.search(self.SHOW_WINDOW_PATTERN, self.html)
        if not found:
            self.parseError('SHOW WINDOW')
        self.url = "http://www.hellshare.com" + found.group(1)
        self.logDebug("DOWNLOAD URL: " + self.url)

        self.download(self.url)


getInfo = create_getInfo(HellshareCz)
예제 #52
0
                    self.correctCaptcha()
                self.link = m.group(1)
                break

            m = re.search(self.CAPTCHA_PATTERN, self.html)
            if m:
                if 'captcha_hash' in params:
                    self.invalidCaptcha()
                captcha_url1 = "http://www.sendspace.com/" + m.group(1)
                m = re.search(self.USER_CAPTCHA_PATTERN, self.html)
                captcha_url2 = "http://www.sendspace.com/" + m.group(1)
                params = {
                    'captcha_hash':
                    m.group(2),
                    'captcha_submit':
                    'Verify',
                    'captcha_answer':
                    self.decryptCaptcha(captcha_url1) + " " +
                    self.decryptCaptcha(captcha_url2)
                }
            else:
                params = {'download': "Regular Download"}

            self.logDebug(params)
            self.html = self.load(pyfile.url, post=params)
        else:
            self.fail(_("Download link not found"))


getInfo = create_getInfo(SendspaceCom)
예제 #53
0
    __name__    = "TwoSharedCom"
    __type__    = "hoster"
    __version__ = "0.17"
    __status__  = "testing"

    __pattern__ = r'http://(?:www\.)?2shared\.com/(account/)?(download|get|file|document|photo|video|audio)/.+'
    __config__  = [("activated"   , "bool", "Activated"                                        , True),
                   ("use_premium" , "bool", "Use premium account if available"                 , True),
                   ("fallback"    , "bool", "Fallback to free download if premium fails"       , True),
                   ("chk_filesize", "bool", "Check file size"                                  , True),
                   ("max_wait"    , "int" , "Reconnect if waiting time is greater than minutes", 10  )]

    __description__ = """2Shared.com hoster plugin"""
    __license__     = "GPLv3"
    __authors__     = [("zoidberg", "*****@*****.**")]


    NAME_PATTERN    = r'<h1>(?P<N>.*)</h1>'
    SIZE_PATTERN    = r'<span class="dtitle">File size:</span>\s*(?P<S>[\d.,]+) (?P<U>[\w^_]+)'
    OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted\.'

    LINK_FREE_PATTERN = r'window.location =\'(.+?)\';'


    def setup(self):
        self.resume_download = True
        self.multiDL        = True


getInfo = create_getInfo(TwoSharedCom)
예제 #54
0
파일: UlozTo.py 프로젝트: keat01/pyLoad
            "offline":
            re.compile(self.FILE_OFFLINE_PATTERN),
            "passwd":
            self.PASSWD_PATTERN,
            "server_error":
            'src="http://img.ulozto.cz/error403/vykricnik.jpg"',  #paralell dl, server overload etc.
            "not_found":
            "<title>Ulož.to</title>"
        })

        if check == "wrong_captcha":
            self.delStorage("captcha_id")
            self.delStorage("captcha_text")
            self.invalidCaptcha()
            self.retry(reason="Wrong captcha code")
        elif check == "offline":
            self.offline()
        elif check == "passwd":
            self.fail("Wrong password")
        elif check == "server_error":
            self.logError("Server error, try downloading later")
            self.multiDL = False
            self.setWait(3600, True)
            self.wait()
            self.retry()
        elif check == "not_found":
            self.fail("Server error - file not downloadable")


getInfo = create_getInfo(UlozTo)
예제 #55
0
    NAME_PATTERN = r'<input type="hidden" name="name" value="(?P<N>.+?)">'
    SIZE_PATTERN = r'<b>Rozmiar:</b> (?P<S>[\d.,]+) (?P<U>[\w^_]+)<br>'
    OFFLINE_PATTERN = ur'Podany plik nie został odnaleziony\.\.\.'

    def setup(self):
        self.multiDL = True
        self.chunkLimit = 1

    def handleFree(self, pyfile):
        m = re.search(r'<script src="([\w^_]+.php)"></script>', self.html)
        if m:
            jscript = self.load("http://hostuje.net/" + m.group(1))
            m = re.search(r"\('(\w+\.php\?i=\w+)'\);", jscript)
            if m:
                self.load("http://hostuje.net/" + m.group(1))
            else:
                self.error(_("unexpected javascript format"))
        else:
            self.error(_("script not found"))

        action, inputs = self.parseHtmlForm(
            pyfile.url.replace(".", "\.").replace("?", "\?"))
        if not action:
            self.error(_("form not found"))

        self.download(action, post=inputs)


getInfo = create_getInfo(HostujeNet)