当前位置: 首页>>代码示例>>Python>>正文


Python Net._cached方法代码示例

本文整理汇总了Python中entertainment.net.Net._cached方法的典型用法代码示例。如果您正苦于以下问题:Python Net._cached方法的具体用法?Python Net._cached怎么用?Python Net._cached使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在entertainment.net.Net的用法示例。


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

示例1: Resolve

# 需要导入模块: from entertainment.net import Net [as 别名]
# 或者: from entertainment.net.Net import _cached [as 别名]
 def Resolve(self, url):
     
     from entertainment.net import Net
     net = Net()
     
     if 'playsominaltv.com' in url:
         
         net._cached = False
         
         premium_url = 'http://www.playsominaltv.com/login/?redirect_to=' + url
         content = net.http_GET(premium_url, headers={'Referer':url}).content
         params={'log':self.Settings().get_setting('user'), 'pwd':self.Settings().get_setting('pass'), 'wp-submit':'1'}
         for hidden_param in re.finditer('(<input.+?type=[\'"]{1}hidden[\'"]{1}.+?/>)', content):
             hidden_param_input = hidden_param.group(1)
             param_name = re.search('name=[\'"]{1}(.+?)[\'"]{1}', hidden_param_input).group(1)
             param_value = re.search('value=[\'"]{1}(.+?)[\'"]{1}', hidden_param_input).group(1)
             params.update( { param_name : param_value } )
         content = net.http_POST('http://www.playsominaltv.com/login/',params,headers={'Referer':premium_url}).content
     
     if 'playsominaltv.com' in url or 'sominaltvfilms.com' in url or 'desionlinetheater.com' in url:
         content = net.http_GET(url).content
         content=dekode(content)
         if content:
             source_url=re.search('<iframe.+?src.+?(http.+?)[\'"\\\\]{1}', content)
             if source_url:
                 return MovieSource.Resolve(self, source_url.group(1))
     else:
         return MovieSource.Resolve(self, url)
         
     return url
开发者ID:bialagary,项目名称:mw,代码行数:32,代码来源:sominaltv_mvi_mvs_cst.py

示例2: GetFileHosts

# 需要导入模块: from entertainment.net import Net [as 别名]
# 或者: from entertainment.net.Net import _cached [as 别名]
    def GetFileHosts(self, url, list, lock, message_queue):

        import re

        from entertainment.net import Net

        net = Net(do_not_cache_if_any=do_no_cache_keywords_list)
        net._cached = False
        tv_user = self.Settings().get_setting("tv_user")
        tv_pwd = self.Settings().get_setting("tv_pwd")
        loginurl = "https://directdownload.tv"
        data = {"password": tv_pwd, "username": tv_user, "Login": "Login", "mode": "normal"}
        headers = {
            "Referer": "https://directdownload.tv",
            "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
            "Connection": "keep-alive",
            "Content-Type": "application/x-www-form-urlencoded",
            "Host": "directdownload.tv",
            "Origin": "http://directdownload.tv",
            "User-Agent": "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36",
        }
        net.http_POST(loginurl, data, headers).content
        net.save_cookies(self.cookie_file)
        net.set_cookies(self.cookie_file)

        content = net.http_GET(url).content

        r = '{"url":"(.+?)","hostname":".+?"}'
        match = re.compile(r).findall(content)

        urlselect = []

        for url in match:
            print url
            if url not in urlselect:
                urlselect.append(url)

                quality = "SD"
                url_lower = "." + url.lower() + "."
                for quality_key, quality_value in common.quality_dict.items():
                    if re.search("[^a-zA-Z0-0]" + quality_key + "[^a-zA-Z0-0]", url_lower):
                        quality = quality_value
                        break

                self.AddFileHost(list, quality, url.replace("\/", "/"))
开发者ID:bialagary,项目名称:mw,代码行数:47,代码来源:Directdownload_tvs_cst.py


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