本文整理汇总了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
示例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("\/", "/"))