本文整理汇总了Python中t0mm0.common.addon.Addon.show_countdown方法的典型用法代码示例。如果您正苦于以下问题:Python Addon.show_countdown方法的具体用法?Python Addon.show_countdown怎么用?Python Addon.show_countdown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t0mm0.common.addon.Addon
的用法示例。
在下文中一共展示了Addon.show_countdown方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: resolve_videto
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import show_countdown [as 别名]
def resolve_videto(url,referer):
user_agent='Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
from resources.libs import jsunpack
from t0mm0.common.addon import Addon
addon = Addon('plugin.video.movie25', sys.argv)
try:
from t0mm0.common.net import Net as net
html = net(user_agent).http_GET(url).content
addon.log_error('Mash Up: Resolve Vidto - Requesting GET URL: '+url)
r = re.findall(r'<font class="err">File was removed</font>',html,re.I)
if r:
addon.log_error('Mash Up: Resolve Vidto - File Was Removed')
xbmc.executebuiltin("XBMC.Notification(File Not Found,Vidto,2000)")
return False
if not r:
r = re.findall(r'(eval\(function\(p,a,c,k,e,d\)\{while.+?flvplayer.+?)</script>'
,html,re.M|re.DOTALL)
if r:
unpacked = jsunpack.unpack(r[0])#this is where it will error, not sure if resources,libs added to os path
r = re.findall(r'label:"\d+p",file:"(.+?)"}',unpacked)
if not r:
r = re.findall('type="hidden" name="(.+?)" value="(.+?)">',html)
post_data = {}
for name, value in r:
post_data[name] = value
post_data['usr_login'] = ''
post_data['referer'] = referer
addon.show_countdown(7, 'Please Wait', 'Resolving')
headers={'Referer':referer}
html = net(user_agent).http_POST(url,post_data,headers).content
r = re.findall(r'(eval\(function\(p,a,c,k,e,d\)\{while.+?flvplayer.+?)</script>'
,html,re.M|re.DOTALL)
if r:
unpacked = jsunpack.unpack(r[0])
r = re.findall(r'label:"\d+p",file:"(.+?)"}',unpacked)
if not r:
r = re.findall(r"var file_link = '(.+?)';",html)
return r[0]
except Exception, e:
print 'Mash Up: Resolve Vidto Error - '+str(e)
addon.show_small_popup('[B][COLOR green]Mash Up: Vidto Resolver[/COLOR][/B]','Error, Check XBMC.log for Details',
5000, elogo)