• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python RequestFactory.getURL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyload.network.RequestFactory.getURL函数的典型用法代码示例。如果您正苦于以下问题:Python getURL函数的具体用法?Python getURL怎么用?Python getURL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getURL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: notify

    def notify(self,
               event,
               msg="",
               key=self.getConfig('apikey')):

        if not key:
            return

        if self.core.isClientConnected() and not self.getConfig('ignoreclient'):
            return

        elapsed_time = time.time() - self.last_notify

        if elapsed_time < self.getConf("sendtimewait"):
            return

        if elapsed_time > 60:
            self.notifications = 0

        elif self.notifications >= self.getConf("sendpermin"):
            return


        getURL("http://www.notifymyandroid.com/publicapi/notify",
               get={'apikey'     : key,
                    'application': "pyLoad",
                    'event'      : event,
                    'description': msg})

        self.last_notify    = time.time()
        self.notifications += 1
开发者ID:Bobbaone,项目名称:pyload,代码行数:31,代码来源:AndroidPhoneNotify.py


示例2: getInfo

def getInfo(urls):
    for url in urls:
        h = getURL(url, just_header=True)
        m = re.search(r'Location: (.+)\r\n', h)
        if m and not re.match(m.group(1), FilefactoryCom.__pattern):  #: It's a direct link! Skipping
            yield (url, 0, 3, url)
        else:  #: It's a standard html page
            yield parseFileInfo(FilefactoryCom, url, getURL(url))
开发者ID:reissdorf,项目名称:pyload,代码行数:8,代码来源:FilefactoryCom.py


示例3: respond

def respond(ticket, value):
    conf = join(expanduser("~"), "ct.conf")
    f = open(conf, "rb")
    try:
        getURL("http://captchatrader.com/api/respond",
            post={"is_correct": value,
                  "username": f.readline().strip(),
                  "password": f.readline().strip(),
                  "ticket": ticket})
    except Exception, e :
        print "CT Exception:", e
        log(DEBUG, str(e))
开发者ID:Dinawhk,项目名称:pyload,代码行数:12,代码来源:PluginTester.py


示例4: respond

 def respond(self, ticket, success):
     try:
         res = getURL(
             self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig("passkey"), "cv": 1 if success else 0}
         )
     except BadHeader, e:
         self.logError(_("Could not send response"), e)
开发者ID:toroettg,项目名称:pyload,代码行数:7,代码来源:BypassCaptcha.py


示例5: getInfo

def getInfo(urls):
    result  = []
    regex   = re.compile(DailymotionCom.__pattern)
    apiurl  = "https://api.dailymotion.com/video/%s"
    request = {"fields": "access_error,status,title"}

    for url in urls:
        id   = regex.match(url).group('ID')
        html = getURL(apiurl % id, get=request)
        info = json_loads(html)

        name = info['title'] + ".mp4" if "title" in info else url

        if "error" in info or info['access_error']:
            status = "offline"
        else:
            status = info['status']
            if status in ("ready", "published"):
                status = "online"
            elif status in ("waiting", "processing"):
                status = "temp. offline"
            else:
                status = "offline"

        result.append((name, 0, statusMap[status], url))

    return result
开发者ID:Burnout5151,项目名称:pyload,代码行数:27,代码来源:DailymotionCom.py


示例6: _captchaResponse

    def _captchaResponse(self, task, correct):
        type = "correct" if correct else "refund"

        if 'ticket' not in task.data:
            self.logDebug("No CaptchaID for %s request (task: %s)" % (type, task))
            return

        passkey = self.getConfig('passkey')

        for _i in xrange(3):
            res = getURL(self.API_URL,
                         get={'action' : "usercaptchacorrectback",
                              'apikey' : passkey,
                              'api_key': passkey,
                              'correct': "1" if correct else "2",
                              'pyload' : "1",
                              'source' : "pyload",
                              'id'     : task.data['ticket']})

            self.logDebug("Request %s: %s" % (type, res))

            if res == "OK":
                break

            time.sleep(5)
        else:
            self.logDebug("Could not send %s request: %s" % (type, res))
开发者ID:PaddyPat,项目名称:pyload,代码行数:27,代码来源:Captcha9Kw.py


示例7: getInfo

def getInfo(urls):
    for url in urls:
        html = getURL("http://www.fshare.vn/check_link.php",
                      post={'action': "check_link", 'arrlinks': url},
                      decode=True)

        yield parseFileInfo(FshareVn, url, html)
开发者ID:PaddyPat,项目名称:pyload,代码行数:7,代码来源:FshareVn.py


示例8: getInfo

    def getInfo(cls, url="", html=""):
        info   = cls.apiInfo(url)
        online = info['status'] == 2

        try:
            info['pattern'] = re.match(cls.__pattern, url).groupdict()  #: pattern groups will be saved here

        except Exception:
            info['pattern'] = {}

        if not html and not online:
            if not url:
                info['error']  = "missing url"
                info['status'] = 1

            elif info['status'] is 3 and not getFileURL(None, url):
                try:
                    html = getURL(url, cookies=cls.COOKIES, decode=not cls.TEXT_ENCODING)

                    if isinstance(cls.TEXT_ENCODING, basestring):
                        html = unicode(html, cls.TEXT_ENCODING)

                except BadHeader, e:
                    info['error'] = "%d: %s" % (e.code, e.content)

                    if e.code is 404:
                        info['status'] = 1

                    elif e.code is 503:
                        info['status'] = 6
开发者ID:reissdorf,项目名称:pyload,代码行数:30,代码来源:SimpleHoster.py


示例9: getInfo

    def getInfo(cls, url="", html=""):
        info = {
            "name": urlparse.urlparse(urllib.unquote(url)).path.split("/")[-1] or _("Unknown"),
            "size": 0,
            "status": 3 if url else 1,
            "url": url,
        }

        if url:
            info["pattern"] = re.match(cls.__pattern, url).groupdict()

            field = getURL(
                "http://api.share-online.biz/linkcheck.php",
                get={"md5": "1"},
                post={"links": info["pattern"]["ID"]},
                decode=True,
            ).split(";")

            if field[1] == "OK":
                info["fileid"] = field[0]
                info["status"] = 2
                info["name"] = field[2]
                info["size"] = field[3]  #: in bytes
                info["md5"] = field[4].strip().lower().replace("\n\n", "")  #: md5

            elif field[1] in ("DELETED", "NOT FOUND"):
                info["status"] = 1

        return info
开发者ID:toroettg,项目名称:pyload,代码行数:29,代码来源:ShareonlineBiz.py


示例10: api_response

    def api_response(self, api, ticket):
        res = getURL("%s%s.aspx" % (self.API_URL, api),
                     get={"username": self.getConfig('username'),
                          "password": self.getConfig('passkey'),
                          "captchaID": ticket})
        if not res.startswith("OK"):
            raise CaptchaBrotherhoodException("Unknown response: %s" % res)

        return res
开发者ID:PaddyPat,项目名称:pyload,代码行数:9,代码来源:CaptchaBrotherhood.py


示例11: captchaInvalid

    def captchaInvalid(self, task):
        if "ticket" in task.data:

            try:
                res = getURL(self.API_URL,
                             post={'action': "refund", 'key': self.getConfig('passkey'), 'gen_task_id': task.data['ticket']})
                self.logInfo(_("Request refund"), res)

            except BadHeader, e:
                self.logError(_("Could not send refund request"), e)
开发者ID:Bobbaone,项目名称:pyload,代码行数:10,代码来源:ExpertDecoders.py


示例12: getCredits

    def getCredits(self):
        res = getURL(self.API_URL, post={"key": self.getConfig('passkey'), "action": "balance"})

        if res.isdigit():
            self.logInfo(_("%s credits left") % res)
            self.info['credits'] = credits = int(res)
            return credits
        else:
            self.logError(res)
            return 0
开发者ID:Bobbaone,项目名称:pyload,代码行数:10,代码来源:ExpertDecoders.py


示例13: getCredits

 def getCredits(self):
     res = getURL(self.API_URL + "askCredits.aspx",
                  get={"username": self.getConfig('username'), "password": self.getConfig('passkey')})
     if not res.startswith("OK"):
         raise CaptchaBrotherhoodException(res)
     else:
         credits = int(res[3:])
         self.logInfo(_("%d credits left") % credits)
         self.info['credits'] = credits
         return credits
开发者ID:PaddyPat,项目名称:pyload,代码行数:10,代码来源:CaptchaBrotherhood.py


示例14: captchaTask

    def captchaTask(self, task):
        if self.getConfig('captcha') and task.isTextual():
            task.handler.append(self)
            task.setWaiting(60)

            html = getURL("http://www.freeimagehosting.net/upload.php",
                          post={"attached": (pycurl.FORM_FILE, task.captchaFile)}, multipart=True)

            url = re.search(r"\[img\]([^\[]+)\[/img\]\[/url\]", html).group(1)
            self.response(_("New Captcha Request: %s") % url)
            self.response(_("Answer with 'c %s text on the captcha'") % task.id)
开发者ID:Bobbaone,项目名称:pyload,代码行数:11,代码来源:IRCInterface.py


示例15: getInfo

def getInfo(urls):
    result = []

    for url in urls:

        html = getURL(url)
        if re.search(StreamCz.OFFLINE_PATTERN, html):
            # File offline
            result.append((url, 0, 1, url))
        else:
            result.append((url, 0, 2, url))
    yield result
开发者ID:Bobbaone,项目名称:pyload,代码行数:12,代码来源:StreamCz.py


示例16: captchaInvalid

    def captchaInvalid(self, task):
        if task.data['service'] == self.__class__.__name__ and "ticket" in task.data:
            res = getURL(self.RESPOND_URL,
                         post={'action': "SETBADIMAGE",
                               'username': self.getConfig('username'),
                               'password': self.getConfig('passkey'),
                               'imageid': task.data['ticket']})

            if res == "SUCCESS":
                self.logInfo(_("Bad captcha solution received, requested refund"))
            else:
                self.logError(_("Bad captcha solution received, refund request failed"), res)
开发者ID:achimschneider,项目名称:pyload,代码行数:12,代码来源:ImageTyperz.py


示例17: handleFree

    def handleFree(self, pyfile):
        wst = self.account.infos['wst'] if self.account and 'wst' in self.account.infos else ""

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

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

        m = re.search('<link>(.+)</link>', api_data)
        if m is None:
            self.error(_("Unable to detect direct link"))

        self.link = m.group(1)
开发者ID:torrero007,项目名称:pyload,代码行数:14,代码来源:WebshareCz.py


示例18: checkHTML

    def checkHTML(self, html, url):
        """Parses html content or any arbitrary text for links and returns result of `checkURLs`

        :param html: html source
        :return:
        """
        urls = []
        if html:
            urls += [x[0] for x in urlmatcher.findall(html)]
        if url:
            page = getURL(url)
            urls += [x[0] for x in urlmatcher.findall(page)]

        return self.checkLinks(uniqify(urls))
开发者ID:ASCIIteapot,项目名称:pyload,代码行数:14,代码来源:DownloadPreparingApi.py


示例19: captchaTask

    def captchaTask(self, task):
        if not task.isTextual() and not task.isPositional():
            return

        if not self.getConfig('passkey'):
            return

        if self.core.isClientConnected() and not self.getConfig('force'):
            return

        credits = self.getCredits()

        if not credits:
            self.logError(_("Your captcha 9kw.eu account has not enough credits"))
            return

        queue = min(self.getConfig('queue'), 999)
        timeout = min(max(self.getConfig('timeout'), 300), 3999)
        pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1)

        for _i in xrange(5):
            servercheck = getURL("http://www.9kw.eu/grafik/servercheck.txt")
            if queue < re.search(r'queue=(\d+)', servercheck).group(1):
                break

            time.sleep(10)
        else:
            self.fail(_("Too many captchas in queue"))

        for opt in str(self.getConfig('hoster_options').split('|')):
            details = map(str.strip, opt.split(':'))

            if not details or details[0].lower() != pluginname.lower():
                continue

            for d in details:
                hosteroption = d.split("=")

                if len(hosteroption) > 1 \
                   and hosteroption[0].lower() == 'timeout' \
                   and hosteroption[1].isdigit():
                    timeout = int(hosteroption[1])

            break

        task.handler.append(self)

        task.setWaiting(timeout)

        self._processCaptcha(task)
开发者ID:PaddyPat,项目名称:pyload,代码行数:50,代码来源:Captcha9Kw.py


示例20: getCredits

    def getCredits(self):
        res = getURL(self.API_URL,
                     get={'apikey': self.getConfig('passkey'),
                          'pyload': "1",
                          'source': "pyload",
                          'action': "usercaptchaguthaben"})

        if res.isdigit():
            self.logInfo(_("%s credits left") % res)
            credits = self.info['credits'] = int(res)
            return credits
        else:
            self.logError(res)
            return 0
开发者ID:PaddyPat,项目名称:pyload,代码行数:14,代码来源:Captcha9Kw.py



注:本文中的pyload.network.RequestFactory.getURL函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python ReCaptcha.ReCaptcha类代码示例发布时间:2022-05-25
下一篇:
Python core.DomObject类代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap