本文整理汇总了Python中t0mm0.common.addon.Addon.log_debug方法的典型用法代码示例。如果您正苦于以下问题:Python Addon.log_debug方法的具体用法?Python Addon.log_debug怎么用?Python Addon.log_debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t0mm0.common.addon.Addon
的用法示例。
在下文中一共展示了Addon.log_debug方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Addon
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import log_debug [as 别名]
from t0mm0.common.addon import Addon
from t0mm0.common.net import Net
import urlresolver
import xbmcgui
addon = Addon('plugin.video.letmewatchthis', sys.argv)
net = Net()
base_url = 'http://www.letmewatchthis.ch'
mode = addon.queries['mode']
play = addon.queries.get('play', None)
if play:
try:
addon.log_debug('fetching %s' % play)
html = net.http_GET(play).content
except urllib2.URLError, e:
html = ''
addon.log_error('got http error %d fetching %s' %
(e.code, web_url))
links = {}
for l in re.finditer('class="movie_version".+?quality_(.+?)>.+?url=(.+?)&domain=(.+?)&.+?"version_veiws">(.+?)</', html, re.DOTALL):
q, url, host, views = l.groups()
verified = l.group(0).find('star.gif') > -1
link = host.decode('base-64')
if verified:
link += ' [verified]'
link += ' (%s)' % views.strip()
links[url.decode('base-64')] = link
示例2: Addon
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import log_debug [as 别名]
#Indexes
import os
import sys
import xbmc
from utils import *
# from utils import _update_settings_xml
from t0mm0.common.addon import Addon
addon = Addon('plugin.video.waldo', sys.argv)
index_list = []
for module in os.listdir(os.path.dirname(__file__)):
if (module == '__init__.py') or (module[-3:] != '.py'):
continue
mod = __import__(module[:-3], locals(), globals())
if has_requirements(mod.required_addons):
addon.log_debug('Waldo: importing %s as index' %module)
index_list.append(mod)
else:
addon.log_debug('Waldo: Requirements not met for %s' %mod.display_name)
del mod
del module
addons_dir = xbmc.translatePath(os.path.join('special://home','addons'))
addon.log_debug('Addons directory: %s' %addons_dir)
for node in os.listdir(addons_dir):
node = os.path.join(addons_dir, node)
if os.path.isdir(node):
index_dir = os.path.join(node, 'waldo', 'indexes')
addon.log_debug('Looking for %s' %index_dir)
if os.path.exists(index_dir):
for module in os.listdir(index_dir):
示例3: FindIframeLink
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import log_debug [as 别名]
if play:
html = net.http_GET(play).content
mydict = addon.parse_query(sys.argv[2])
count = 0
sources = {}
expr = re.compile('[a|;"]\s\shref="/link/.+/(\d+)/">(.+)</a>\n.*</td>\n.*verionFavoriteCell.*\n.*</td>\n\n.*oddCell">\n.*centered">(.+?)&.*title="(.+?)" />')
match = expr.findall(html)
if match:
for linkid, title, rating, votes in match:
url = base_url + '/movie/playlink/id/' + linkid + '/part/1/'
hosting_url = FindIframeLink(url)
if hosting_url:
mymsg = 'Trying to resolve' + hosting_url
addon.log_debug(mymsg)
title = addon.decode(title)
displayname = '%s %s (%s)' % (title, votes, rating)
sources[hosting_url] = displayname
count += 1
if count == maxlinks:
break
stream_url = urlresolver.choose_source(sources)
addon.resolve_url(stream_url)
else:
addon.show_small_popup('SolarMovie','No sources available',3000,
smallimage)
elif mode == 'findsolarmovies':
cm.add_context('Jump to favorites', { 'mode' : 'showfavorites' }, True)