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

Python client.request函数代码示例

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

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



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

示例1: resolve

def resolve(url):
    try:
        result = client.request(url)

        post = {}
        f = client.parseDOM(result, "Form", attrs = { "action": "" })
        k = client.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
        for i in k: post.update({i: client.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
        post.update({'method_free': 'Watch Free!'})
        post = urllib.urlencode(post)

        result = client.request(url, post=post)
        result = result.replace('\\/', '/').replace('\n', '').replace('\'', '"').replace(' ', '')

        swfUrl = re.compile('\.embedSWF\("(.+?)"').findall(result)[0]
        swfUrl = urlparse.urljoin(url, swfUrl)

        streamer = re.compile('flashvars=.+?"file":"(.+?)"').findall(result)[0]

        playpath = re.compile('flashvars=.+?p2pkey:"(.+?)"').findall(result)[0]

        url = '%s playpath=%s conn=S:%s pageUrl=%s swfUrl=%s swfVfy=true timeout=20' % (streamer, playpath, playpath, url, swfUrl)

        return url
    except:
        return
开发者ID:djjohnnyb15,项目名称:BlackKodi,代码行数:26,代码来源:videopremium.py


示例2: resolve

def resolve(url):
    try:
        result = client.request(url)

        post = {}
        f = client.parseDOM(result, "Form", attrs = { "action": "" })
        k = client.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
        for i in k: post.update({i: client.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
        post.update({'method_free': 'Free Download'})
        post = urllib.urlencode(post)

        result = client.request(url, post=post)

        post = {}
        f = client.parseDOM(result, "Form", attrs = { "action": "" })
        k = client.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
        for i in k: post.update({i: client.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
        post.update({'method_free': 'Free Download'})
        try: post.update(captcha.request(result))
        except: pass
        post = urllib.urlencode(post)

        result = client.request(url, post=post)

        url = client.parseDOM(result, "a", ret="onClick")
        url = [i for i in url if i.startswith('window.open')][0]
        url = re.compile('[\'|\"](.+?)[\'|\"]').findall(url)[0]
        return url
    except:
        return
开发者ID:MrChuco213,项目名称:team.expat,代码行数:30,代码来源:clicknupload.py


示例3: resolve

    def resolve(self, url):
        try:
            result = client.request(url)
            result = result.decode('iso-8859-1').encode('utf-8')

            url = client.parseDOM(result, "div", attrs = { "class": "player-embed" })[0]
            url = client.parseDOM(url, "iframe", ret="src")[0]

            if not 'auengine.com' in url:
                url = client.parseDOM(result, "div", attrs = { "class": "generic-video-item" })
                url = [i for i in url if 'auengine video' in i.lower()][0]
                url = client.parseDOM(url, "a", ret="href")[0]
                url = urlparse.urljoin(self.base_link, url)

                result = client.request(url)
                result = result.decode('iso-8859-1').encode('utf-8')

                url = client.parseDOM(result, "div", attrs = { "class": "player-embed" })[0]
                url = client.parseDOM(url, "iframe", ret="src")[0]

            result = client.request(url)

            url = re.compile("video_link *= *'(.+?)'").findall(result)[0]
            url = urllib.unquote_plus(url)
            return url
        except:
            return
开发者ID:Mendim,项目名称:tdbaddon,代码行数:27,代码来源:animeultima_tv.py


示例4: resolve

def resolve(url):
    try:
        channel = urlparse.urlparse(url).path
        channel = re.compile('/([\w]+)').findall(channel)[-1]
        domain = urlparse.urlparse(url).netloc


        pageUrl = urlparse.urljoin('http://%s' % domain, channel)

        if 'instagib' in domain: playpath = 'instagib_%s' % channel
        elif 'breakers' in domain: playpath = 'btv_%s' % channel
        elif 'vapers' in domain: playpath = 'vtv_%s' % channel
        else: playpath = 'live_%s' % channel


        result = client.request(pageUrl, referer=pageUrl)

        swfUrl = re.compile('"(/\d+/swf/[0-9A-Za-z]+\.swf)').findall(result)[0]
        swfUrl = urlparse.urljoin(pageUrl, swfUrl)


        infoUrl = 'http://mvn.vaughnsoft.net/video/edge/%s_%s' % (domain, channel)
        result = client.request(infoUrl)

        streamer = re.compile('(.+?);').findall(result)[0]
        streamer = 'rtmp://%s/live' % streamer

        app = re.compile('mvnkey-(.+)').findall(result)[0]
        app = 'live?%s' % app

        url = '%s app=%s playpath=%s pageUrl=%s swfUrl=%s swfVfy=true live=true timeout=20' % (streamer, app, playpath, pageUrl, swfUrl)

        return url
    except:
        return
开发者ID:keeganmccallum,项目名称:lambda-addons,代码行数:35,代码来源:vaughnlive.py


示例5: resolve

def resolve(url):
    try:
        if '/vod/' in url:
            url = re.compile('/(\d+)').findall(url)[-1]
            url = 'http://www.filmon.com/vod/info/%s' % url
        elif '/tv/' in url:
            url = url.replace('/tv/', '/channel/')
        elif not '/channel/' in url:
            raise Exception()


        headers = {'X-Requested-With': 'XMLHttpRequest'}

        result = client.request(url, headers=headers)
        result = json.loads(result)

        try:
            result = result['streams']
        except:
            result = result['data']['streams']
            result = [i[1] for i in result.iteritems()]

        strm = [(i['url'], int(i['watch-timeout'])) for i in result]
        strm = [i for i in strm if '.m3u8' in i[0]]
        strm.sort()
        strm = strm[-1][0]

        url = client.request(strm).splitlines()
        url = [i for i in url if '.m3u8' in i]
        if len(url) == 0: return strm
        url = urlparse.urljoin(strm, url[0])

        return url
    except:
        return
开发者ID:MrChuco213,项目名称:team.expat,代码行数:35,代码来源:filmon.py


示例6: resolve

def resolve(url):
    try:
        url = url.replace('/embed-', '/')
        url = re.compile('//.+?/([\w]+)').findall(url)[0]
        url = 'http://grifthost.com/embed-%s.html' % url

        result = client.request(url)

        try:
            post = {}
            f = client.parseDOM(result, "Form", attrs = { "method": "POST" })[0]
            f = f.replace('"submit"', '"hidden"')
            k = client.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
            for i in k: post.update({i: client.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
            post = urllib.urlencode(post)
            result = client.request(url, post=post)
        except:
            pass

        result = re.compile('(eval.*?\)\)\))').findall(result)[-1]
        result = jsunpack.unpack(result)

        url = client.parseDOM(result, "embed", ret="src")
        url += re.compile("file *: *[\'|\"](.+?)[\'|\"]").findall(result)
        url = [i for i in url if not i.endswith('.srt')]
        url = 'http://' + url[0].split('://', 1)[-1]

        return url
    except:
        return
开发者ID:djjohnnyb15,项目名称:BlackKodi,代码行数:30,代码来源:grifthost.py


示例7: resolve

def resolve(url):
    try:
        result = client.request(url)

        post = {}
        f = client.parseDOM(result, "Form", attrs = { "action": "" })[0]
        k = client.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
        for i in k: post.update({i: client.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
        post.update({'method_free': ' '})
        post = urllib.urlencode(post)

        result = client.request(url, post=post)

        post = {}
        f = client.parseDOM(result, "Form", attrs = { "action": "" })[0]
        k = client.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
        for i in k: post.update({i: client.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
        post.update({'method_free': ' '})
        post.update(captcha.request(result))
        post = urllib.urlencode(post)

        result = client.request(url, post=post)

        url = re.compile("var\s+download_url *= *'(.+?)'").findall(result)[0]
        return url
    except:
        return
开发者ID:MrChuco213,项目名称:team.expat,代码行数:27,代码来源:kingfiles.py


示例8: resolve

def resolve(url):
    try:
        url = re.compile('//.+?/([\w]+)').findall(url)[0]
        url = 'http://www.movdivx.com/%s' % url
 
        result = client.request(url)

        post = {}
        f = client.parseDOM(result, "Form", attrs = { "action": "" })[0]
        k = client.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
        for i in k: post.update({i: client.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
        post.update({'method_free': 'Free Download'})
        post = urllib.urlencode(post)

        result = client.request(url, post=post)

        result = re.compile('(eval.*?\)\)\))').findall(result)[-1]
        result = jsunpack.unpack(result)

        url = client.parseDOM(result, "embed", ret="src")
        url += re.compile("file *: *[\'|\"](.+?)[\'|\"]").findall(result)
        url = [i for i in url if not i.endswith('.srt')]
        url = 'http://' + url[0].split('://', 1)[-1]

        return url
    except:
        return
开发者ID:djjohnnyb15,项目名称:BlackKodi,代码行数:27,代码来源:movdivx.py


示例9: resolve

def resolve(url):
    try:
        user = control.setting('movreel_user')
        password = control.setting('movreel_password')

        login = 'http://movreel.com/login.html'
        post = {'op': 'login', 'login': user, 'password': password, 'redirect': url}
        post = urllib.urlencode(post)
        result = client.request(url, close=False)
        result += client.request(login, post=post, close=False)

        post = {}
        f = client.parseDOM(result, "Form", attrs = { "name": "F1" })[-1]
        k = client.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
        for i in k: post.update({i: client.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
        post.update({'method_free': '', 'method_premium': ''})
        post = urllib.urlencode(post)

        request = urllib2.Request(url, post)

        for i in range(0, 3):
            try:
                response = urllib2.urlopen(request, timeout=10)
                result = response.read()
                response.close()
                url = re.compile('(<a .+?</a>)').findall(result)
                url = [i for i in url if 'Download Link' in i][-1]
                url = client.parseDOM(url, "a", ret="href")[0]
                return url
            except:
                time.sleep(1)
    except:
        return
开发者ID:keeganmccallum,项目名称:lambda-addons,代码行数:33,代码来源:movreel.py


示例10: resolve

def resolve(url):
    try:
        result = client.request(url, mobile=True, close=False)

        try:
            post = {}
            f = client.parseDOM(result, "Form", attrs = { "method": "POST" })[0]
            f = f.replace('"submit"', '"hidden"')
            k = client.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
            for i in k: post.update({i: client.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
            post = urllib.urlencode(post)
        except:
            post=None

        for i in range(0, 10):
            try:
                result = client.request(url, post=post, mobile=True, close=False)
                result = result.replace('\n','')

                result = re.compile('sources *: *\[.+?\]').findall(result)[-1]
                result = re.compile('file *: *"(http.+?)"').findall(result)

                url = [i for i in result if '.m3u8' in i]
                if len(url) > 0: return url[0]
                url = [i for i in result if not '.m3u8' in i]
                if len(url) > 0: return url[0]
            except:
                time.sleep(1)
    except:
        return
开发者ID:MrChuco213,项目名称:team.expat,代码行数:30,代码来源:vidzi.py


示例11: resolve

def resolve(url):
    try:
        url = re.compile('//.+?/([\w]+)').findall(url)[0]
        url = 'http://180upload.com/embed-%s.html' % url

        result = client.request(url)

        post = {}
        f = client.parseDOM(result, "form", attrs = { "id": "captchaForm" })[0]
        k = client.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
        for i in k: post.update({i: client.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
        post = urllib.urlencode(post)

        result = client.request(url, post=post)

        result = re.compile('(eval.*?\)\)\))').findall(result)[-1]
        result = jsunpack.unpack(result)

        url = client.parseDOM(result, "embed", ret="src")
        url += re.compile("'file' *, *'(.+?)'").findall(result)
        url = [i for i in url if not i.endswith('.srt')]
        url = 'http://' + url[0].split('://', 1)[-1]

        return url
    except:
        return
开发者ID:djjohnnyb15,项目名称:BlackKodi,代码行数:26,代码来源:_180upload.py


示例12: resolve

    def resolve(self, url):
        try:
            result = client.request(url)
            if not "my_video" in result:
                cookie = client.request(self.sign_link, post=self.key_link, output="cookie")
                result = client.request(url, cookie=cookie)

            url = None
            try:
                url = client.parseDOM(result, "source", ret="src", attrs={"type": "video/webm"})[0]
            except:
                pass
            try:
                url = client.parseDOM(result, "source", ret="src", attrs={"type": "video/mp4"})[0]
            except:
                pass

            if url == None:
                return
            url = urlparse.urljoin(self.base_link, url)
            url = "%s|Cookie=%s" % (url, urllib.quote_plus("video=true"))

            return url
        except:
            return
开发者ID:Mendim,项目名称:tdbaddon,代码行数:25,代码来源:ororo_tv.py


示例13: resolve

    def resolve(self, url):
        try:
            query = urlparse.urljoin(self.base_link, self.login_link)
            post = urllib.urlencode({'login': self.user, 'pwd': self.password})
            cookie = client.request(query, post=post, output='cookie')

            result = client.request(url, cookie=cookie)
            url = client.parseDOM(result, "location")[0]
            return url
        except:
            return
开发者ID:keeganmccallum,项目名称:lambda-addons,代码行数:11,代码来源:furk_mv_tv.py


示例14: resolve

def resolve(url):
    try:
        result = client.request(url, close=False)

        f = client.parseDOM(result, "a", ret="href", attrs = { "id": "go-next" })[0]
        f = urlparse.urljoin(url, f)

        result = client.request(f)

        url = re.compile("var\s+lnk\d* *= *'(http.+?)'").findall(result)[0]
        return url
    except:
        return
开发者ID:MrChuco213,项目名称:team.expat,代码行数:13,代码来源:filenuke.py


示例15: resolve

    def resolve(self, url):
        try:
            if urlparse.urlparse(url).netloc in self.base_link:
                return self.__resolve(client.request(url))

            if url.startswith('stack://'): return url

            url = client.request(url, output='geturl')
            if 'requiressl=yes' in url: url = url.replace('http://', 'https://')
            else: url = url.replace('https://', 'http://')
            return url
        except:
            return
开发者ID:djjohnnyb15,项目名称:BlackKodi,代码行数:13,代码来源:tunemovie_mv_tv.py


示例16: resolve

def resolve(url):
    try:
        base = url.replace('https://', 'http://')
        result = str(client.request(base))

        u = re.compile('url(720|540|480|360|240)=(.+?)&').findall(result)

        url = []
        try: url += [[{'quality': 'HD', 'url': i[1]} for i in u if i[0] == '720'][0]]
        except: pass
        try: url += [[{'quality': 'SD', 'url': i[1]} for i in u if i[0] == '540'][0]]
        except: pass
        try: url += [[{'quality': 'SD', 'url': i[1]} for i in u if i[0] == '480'][0]]
        except: pass
        if not url == []: return url
        try: url += [[{'quality': 'SD', 'url': i[1]} for i in u if i[0] == '360'][0]]
        except: pass
        if not url == []: return url
        try: url += [[{'quality': 'SD', 'url': i[1]} for i in u if i[0] == '240'][0]]
        except: pass

        if not url == []: return url


        try: s = 'http://www.vkvideosearch.com/video.php?v=%s' % re.compile('video(.+_.+)').findall(base)[0]
        except: pass
        try: s = 'http://www.vkvideosearch.com/video.php?v=%s_%s' % (urlparse.parse_qs(urlparse.urlparse(base).query)['oid'][0], urlparse.parse_qs(urlparse.urlparse(base).query)['id'][0])
        except: pass
        result = str(client.request(s))

        u = re.compile('<a href="(.+?)">(720|540|480|360|240)p</a>').findall(result)

        url = []
        try: url += [[{'quality': 'HD', 'url': i[0]} for i in u if i[1] == '720'][0]]
        except: pass
        try: url += [[{'quality': 'SD', 'url': i[0]} for i in u if i[1] == '540'][0]]
        except: pass
        try: url += [[{'quality': 'SD', 'url': i[0]} for i in u if i[1] == '480'][0]]
        except: pass
        if not url == []: return url
        try: url += [[{'quality': 'SD', 'url': i[0]} for i in u if i[1] == '360'][0]]
        except: pass
        if not url == []: return url
        try: url += [[{'quality': 'SD', 'url': i[0]} for i in u if i[1] == '240'][0]]
        except: pass

        if not url == []: return url

    except:
        return
开发者ID:marnnie,项目名称:Cable-buenaventura,代码行数:50,代码来源:vk.py


示例17: resolve

def resolve(url):
    try:
        result = client.request(url, mobile=True)
        url = client.parseDOM(result, "source", ret="src", attrs={"type": "video.+?"})[0]
        return url
    except:
        return
开发者ID:johnnieko,项目名称:marnnie-wizard-tv,代码行数:7,代码来源:vidbull.py


示例18: resolve

def resolve(url):
    try:
        result = client.request(url)
        post = {}
        try: f = client.parseDOM(result, "form", attrs = { "method": "POST" })[0]
        except: f = ''
        k = client.parseDOM(f, "input", ret="name")
        for i in k: post.update({i: client.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
        post = urllib.urlencode(post)

        result = client.request(url, post=post)

        url = re.compile("var\s+lnk\d* *= *'(http.+?)'").findall(result)[0]
        return url
    except:
        return
开发者ID:Mendim,项目名称:tdbaddon,代码行数:16,代码来源:filenuke.py


示例19: resolve

def resolve(url):
    try:
        result = client.request(url)
        url = re.compile("file *: *'(http.+?)'").findall(result)[-1]
        return url
    except:
        return
开发者ID:Mendim,项目名称:tdbaddon,代码行数:7,代码来源:sharerepo.py


示例20: resolve

def resolve(url):
    try:
        result = client.request(url, close=False)

        post = {}
        f = client.parseDOM(result, "Form", attrs={"action": ""})
        k = client.parseDOM(f, "input", ret="name", attrs={"type": "hidden"})
        for i in k:
            post.update({i: client.parseDOM(f, "input", ret="value", attrs={"name": i})[0]})
        post.update(captcha.request(result))
        post = urllib.urlencode(post)

        request = urllib2.Request(url, post)

        for i in range(0, 5):
            try:
                response = urllib2.urlopen(request, timeout=10)
                result = response.read()
                response.close()
                if "download2" in result:
                    raise Exception()
                url = client.parseDOM(result, "a", ret="href", attrs={"target": ""})[0]
                return url
            except:
                time.sleep(1)
    except:
        return
开发者ID:johnnieko,项目名称:marnnie-wizard-tv,代码行数:27,代码来源:xfileload.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python client.source函数代码示例发布时间:2022-05-27
下一篇:
Python client.replaceHTMLCodes函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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