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


Python Addon.resolve_url方法代码示例

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


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

示例1: Settings

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import resolve_url [as 别名]
print "arg2: "+sys.argv[2]

if play:
   stream_url = None
   if 'dailymotion' in url:
      stream_url = url
   else:
      hosted_media = urlresolver.HostedMediaFile( url=url, title=name )
      print "hosted_media"
      print hosted_media
      if hosted_media:
         stream_url = hosted_media.resolve()
         print stream_url

   if stream_url:
      addon.resolve_url(stream_url)
   else:
      print "unable to resolve"
      addon.show_ok_dialog( [ 'Unknown hosted video' ], title='Playback' )
else:
   if mode == 'main':
      Main_Categories()
          
   elif mode == 'settings':
      Settings()

   elif mode == 'movie':
      Main_Movie( url, lang )

   elif mode == 'tree':
      Main_Tree( url, lang )
开发者ID:Kantilal,项目名称:codenx-xbmc-addons,代码行数:33,代码来源:default.py

示例2:

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import resolve_url [as 别名]
       
##### Queries ##########
mode = addon.queries['mode']
url = addon.queries.get('url', None)
name = addon.queries.get('name', None)
play = addon.queries.get('play', None)

print "MODE: "+str(mode)
print "URL: "+str(url)
print "Name: "+str(name)
print "play: "+str(play)
print "arg1: "+sys.argv[1]
print "arg2: "+sys.argv[2]

if play:
   addon.resolve_url(url)
else:
   if mode == 'main':
      Main_Categories()

   elif mode == 'radio':
      Radio_Main()

   elif mode == 'vod':
      Vod_Main()
          
   elif mode == 'movie':
      Movie_Main(url)
          
   elif mode == 'tree':
      Main_Tree( url )
开发者ID:codenx,项目名称:codenx-xbmc-addons,代码行数:33,代码来源:default.py

示例3: resolve_youtube_url

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import resolve_url [as 别名]
##################################################################################################################################

def resolve_youtube_url(url):
	url_patterns = ['(?:youtu.be/|/embed/|/v/|v=)(?P<video_id>[a-zA-Z0-9_\-]{11})']
	for pattern in url_patterns:
		v_id = re.search(pattern, url)
		if v_id:
			return 'plugin://plugin.video.youtube/play/?video_id={}'.format(v_id.group('video_id'))
	return ''


if play:
	url = addon.queries.get('url', '')
	playable_url = resolve_youtube_url(url)
	addon.resolve_url(playable_url)

##################################################################################################################################

def getUrl(url):
	req = urllib2.Request(url)
        req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
        response = urllib2.urlopen(req)
        link=response.read()
        response.close()
	return link

##################################################################################################################################


def get_params():
开发者ID:Romans-I-XVI,项目名称:plugin.video.creationtoday_org,代码行数:32,代码来源:default.py

示例4: CATEGORIES

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import resolve_url [as 别名]
# Query play, mode, url and name
play = addon.queries.get('play', None)
mode = addon.queries['mode']
url = addon.queries.get('url', '')
name = addon.queries.get('name', '')
iconimage = addon.queries.get('iconimage', '')

print "Play: " +str(play)
print "Mode: "+str(mode)
print "URL: "+str(url)
print "Name: "+str(name)


# Program flow control
if play:
    addon.resolve_url(url.encode('UTF-8')) # <<< Play resolved media url

if mode=='main':
    print ""
    CATEGORIES()

elif mode=='schedule':
    print ""+url
    IDX_SCHED(url)

elif mode=='live_strm':
    print ""+url
    IDX_LIVE_STRM()

elif mode=='vod':
    print ""+url
开发者ID:misty-,项目名称:addons,代码行数:33,代码来源:default.py


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