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


Python Addon.log_error方法代码示例

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


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

示例1: resolve_videto

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import log_error [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)
开发者ID:charlesjackson261,项目名称:yolo-boo,代码行数:44,代码来源:movieplaylist.py

示例2: resolve_mightyupload

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import log_error [as 别名]
def resolve_mightyupload(url,referer):
    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().http_GET(url).content
        addon.log_error('Mash Up: Resolve MightyUpload - Requesting GET URL: '+url)
        r = re.findall(r'name="(.+?)" value="?(.+?)"', html, re.I|re.M)
        post_data = {}
        for name, value in r:
            post_data[name] = value
        post_data['referer'] = referer
        headers={'Referer':referer}
        html = net().http_POST(url, post_data).content
        r = re.findall(r'<a href=\"(.+?)(?=\">Download the file</a>)', html)
        return r[0]
    except Exception, e:
        print 'Mash Up: Resolve MightyUpload Error - '+str(e)
        addon.show_small_popup('[B][COLOR green]Mash Up: MightyUpload Resolver[/COLOR][/B]','Error, Check XBMC.log for Details',
                               5000, elogo)
        return
开发者ID:charlesjackson261,项目名称:yolo-boo,代码行数:24,代码来源:movieplaylist.py

示例3: Addon

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import log_error [as 别名]
addon = Addon(addon_id, sys.argv)

    
art = main.art
error_logo = art+'/bigx.png'

try:
    import urllib, urllib2, re, string, urlparse, sys, os
    
    from t0mm0.common.net import Net
    from metahandler import metahandlers
    from sqlite3 import dbapi2 as database
    from universal import playbackengine, watchhistory
    import urlresolver
except Exception, e:
    addon.log_error(str(e))
    addon.show_small_popup('MashUP: Tv-Release','Failed To Import Modules', 5000, error_logo)
    addon.show_ok_dialog(['Failed To Import Modules','Please Post Logfile In MashUP Forum @','http://www.xbmchub.com'],
                          'MashUP: TV-Release')
net = Net()
BASEURL = 'http://www.tv-release.net/'
wh = watchhistory.WatchHistory(addon_id)

def MAINMENU():
    main.addDir('Search Tv-Release',    BASEURL+'?s=',                            1006,art+'/tvrsearch1.png')
    main.addDir('TV 480',               BASEURL+'category/tvshows/tv480p/',       1001,art+'/TV480.png')
    main.addDir('TV 720',               BASEURL+'category/tvshows/tv720p/',       1001,art+'/TV720.png')
    main.addDir('TV MP4',               BASEURL+'category/tvshows/tvmp4/',        1001,art+'/TVmp4.png')
    main.addDir('TV Xvid',              BASEURL+'category/tvshows/tvxvid/',       1001,art+'/TVxvid.png')
    main.addDir('TV Packs',             BASEURL+'tv-pack/',                       1007,art+'/TVpacks.png')
    main.addDir('TV Foreign',           BASEURL+'category/tvshows/tv-foreign/',   1001,art+'/TVforeign.png')
开发者ID:the-one-,项目名称:MashUp,代码行数:33,代码来源:tvrelease.py

示例4: Addon

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import log_error [as 别名]
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
    

    playable = urlresolver.filter_urls(links.keys())
    
    if playable:
开发者ID:Rogerthis,项目名称:xbmc-urlresolver,代码行数:33,代码来源:default.py

示例5:

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import log_error [as 别名]
          'Crime', 'Documentary', 'Drama', 'Family', 'Fantasy', 'Game-Show', 
          'History', 'Horror', 'Japanese', 'Korean', 'Music', 'Musical', 
          'Mystery', 'Reality-TV', 'Romance', 'Sci-Fi', 'Short', 'Sport', 
          'Talk-Show', 'Thriller', 'War', 'Western', 'Zombies']
          
mode = addon.queries['mode']
play = addon.queries.get('play', None)
print play
if play:
    url = addon.queries.get('url', None)
    try:
        addon.log_debug('fetching %s' % url)
        html = net.http_GET(url).content
    except urllib2.URLError, e:
        html = ''
        addon.log_error('got http error %d fetching %s' %
                        (e.code, url))
    
    #find all sources and their info
    sources = []
    for s in re.finditer('class="movie_version.+?quality_(.+?)>.+?url=(.+?)' + 
                         '&domain=(.+?)&.+?"version_veiws">(.+?)</', 
                         html, re.DOTALL):
        q, url, host, views = s.groups()
        verified = s.group(0).find('star.gif') > -1
        title = host.decode('base-64')
        if verified:
            title += ' [verified]'
        title += ' (%s)' % views.strip()
        url = url.decode('base-64')
        hosted_media = urlresolver.HostedMediaFile(url=url, title=title)
        sources.append(hosted_media)
开发者ID:1c0n,项目名称:xbmc-urlresolver,代码行数:34,代码来源:default.py


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