本文整理汇总了Python中xbmcplugin.SORT_METHOD_VIDEO_TITLE属性的典型用法代码示例。如果您正苦于以下问题:Python xbmcplugin.SORT_METHOD_VIDEO_TITLE属性的具体用法?Python xbmcplugin.SORT_METHOD_VIDEO_TITLE怎么用?Python xbmcplugin.SORT_METHOD_VIDEO_TITLE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类xbmcplugin
的用法示例。
在下文中一共展示了xbmcplugin.SORT_METHOD_VIDEO_TITLE属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_sort_methods
# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_VIDEO_TITLE [as 别名]
def add_sort_methods(sort_type):
if sort_type == 'sort_nothing':
xbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_NONE)
if sort_type == 'sort_label':
xbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_LABEL)
if sort_type == 'sort_label_ignore_folders':
xbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_LABEL_IGNORE_FOLDERS)
if sort_type == 'sort_episodes':
xbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_EPISODE)
xbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_LABEL)
xbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_VIDEO_TITLE)
示例2: parse_listas
# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_VIDEO_TITLE [as 别名]
def parse_listas(item, bloque_lista):
logger.info()
if item.tipo == "populares":
patron = '<div class="lista(.*?)</div>\s*</h4>'
else:
patron = '<div class="lista(.*?)</h4>\s*</div>'
matches = re.compile(patron, re.DOTALL).findall(bloque_lista)
itemlist = []
for lista in matches:
scrapedurl = scrapertools.htmlclean(scrapertools.find_single_match(lista, '<a href="([^"]+)">[^<]+</a>'))
scrapedtitle = scrapertools.find_single_match(lista, '<a href="[^"]+">([^<]+)</a>')
scrapedfollowers = scrapertools.find_single_match(lista, 'Follow: <span class="number">([^<]+)')
scrapedseries = scrapertools.find_single_match(lista, '<div class="lista-stat badge">Series: ([^<]+)')
scrapedpelis = scrapertools.find_single_match(lista, '<div class="lista-stat badge">Pelis: ([^<]+)')
title = scrapertools.htmlclean(scrapedtitle) + ' ('
if scrapedpelis != '':
title += scrapedpelis + ' pelis, '
if scrapedseries != '':
title += scrapedseries + ' series, '
if scrapedfollowers != '':
title += scrapedfollowers + ' seguidores'
title += ')'
url = urlparse.urljoin(host, scrapedurl)
thumbnail = ""
itemlist.append(
Item(channel=item.channel, action="peliculas", token=item.token, tipo="lista", title=title, url=url))
nextpage = scrapertools.find_single_match(bloque_lista,
'<div class="onclick load-more-icon no-json" data-action="replace" data-url="([^"]+)"')
if nextpage != '':
url = urlparse.urljoin(host, nextpage)
itemlist.append(Item(channel=item.channel, action="lista_sig", token=item.token, tipo=item.tipo,
title=">> Página siguiente", extra=item.extra, url=url))
try:
import xbmcplugin
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_UNSORTED)
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_VIDEO_TITLE)
except:
pass
return itemlist
示例3: parse_listas
# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_VIDEO_TITLE [as 别名]
def parse_listas(item, patron):
logger.info()
# Descarga la pagina
headers = {"X-Requested-With": "XMLHttpRequest"}
data = httptools.downloadpage(item.url, headers=headers).data
logger.debug("data="+data)
# Extrae las entradas (carpetas)
json_object = jsontools.load_json(data)
logger.debug("html="+json_object["html"])
data = json_object["html"]
matches = re.compile(patron,re.DOTALL).findall(data)
itemlist = []
for scrapedurl,scrapedtitle,scrapeduser,scrapedfichas in matches:
title = scrapertools.htmlclean(scrapedtitle + ' (' + scrapedfichas + ' fichas, por ' + scrapeduser + ')')
url = urlparse.urljoin(item.url,scrapedurl) + "/offset/0/loadmedia"
thumbnail = ""
itemlist.append( Item(channel=item.channel, action="lista" , title=title , url=url))
logger.debug("title=["+title+"], url=["+url+"], thumbnail=["+thumbnail+"]")
nextpage = scrapertools.find_single_match(data,'data-url="(/lists/loadlists/offset/[^"]+)"')
if nextpage != '':
url = urlparse.urljoin(item.url,nextpage)
itemlist.append( Item(channel=item.channel, action="listas_sigues" , title=">> Página siguiente" , extra=item.extra, url=url))
try:
import xbmcplugin
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_UNSORTED)
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_VIDEO_TITLE)
except:
pass
return itemlist
示例4: ListGenres
# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_VIDEO_TITLE [as 别名]
def ListGenres():
"""List programmes based on alphabetical order.
Only creates the corresponding directories for each character.
"""
genres = []
html = OpenURL('http://www.bbc.co.uk/radio/programmes/genres')
mains = html.split('<div class="category__box island--vertical">')
for main in mains:
current_main_match = re.search(r'<a.+?class="gel-double-pica-bold".+?href="(.+?)">(.+?)</a>',main)
if current_main_match:
genres.append((current_main_match.group(1), current_main_match.group(2), True))
current_sub_match = re.findall(r'<a.+?class="gel-long-primer-bold".+?href="(.+?)">(.+?)</a>',main)
for sub_match_url, sub_match_name in current_sub_match:
genres.append((sub_match_url, current_main_match.group(2)+' - '+sub_match_name, False))
for url, name, group in genres:
new_url = 'http://www.bbc.co.uk%s' % url
if group:
AddMenuEntry("[B]%s[/B]" % name, new_url, 137, '', '', '')
else:
AddMenuEntry("%s" % name, new_url, 137, '', '', '')
#BUG: this should sort by original order but it doesn't (see http://trac.kodi.tv/ticket/10252)
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_UNSORTED)
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_VIDEO_TITLE)
示例5: parse_mixed_results
# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_VIDEO_TITLE [as 别名]
def parse_mixed_results(item,data):
patron = '<a class="defaultLink extended" href="([^"]+)"[^<]+'
patron += '<div class="coverMini shadow tiptip" title="([^"]+)"[^<]+'
patron += '<img class="centeredPic.*?src="([^"]+)"'
patron += '[^<]+<img[^<]+<div class="extra-info">'
patron += '<span class="year">([^<]+)</span>'
patron += '<span class="value"><i class="icon-star"></i>([^<]+)</span>'
matches = re.compile(patron,re.DOTALL).findall(data)
itemlist = []
for scrapedurl,scrapedtitle,scrapedthumbnail,scrapedyear,scrapedvalue in matches:
title = scrapertools.htmlclean(scrapedtitle)
if scrapedyear != '':
title += " ("+scrapedyear+")"
fulltitle = title
if scrapedvalue != '':
title += " ("+scrapedvalue+")"
thumbnail = urlparse.urljoin(item.url,scrapedthumbnail)
fanart = thumbnail.replace("mediathumb","mediabigcover")
plot = ""
#http://www.pordede.com/peli/the-lego-movie
#http://www.pordede.com/links/view/slug/the-lego-movie/what/peli?popup=1
if "/peli/" in scrapedurl or "/docu/" in scrapedurl:
#sectionStr = "peli" if "/peli/" in scrapedurl else "docu"
if "/peli/" in scrapedurl:
sectionStr = "peli"
else:
sectionStr = "docu"
referer = urlparse.urljoin(item.url,scrapedurl)
url = referer.replace("/{0}/".format(sectionStr),"/links/view/slug/")+"/what/{0}".format(sectionStr)
logger.debug("title=["+title+"], url=["+url+"], thumbnail=["+thumbnail+"]")
itemlist.append( Item(channel=item.channel, action="findvideos" , title=title , extra=referer, url=url, thumbnail=thumbnail, plot=plot, fulltitle=fulltitle, fanart=fanart,
contentTitle=scrapedtitle, contentType="movie", context=["buscar_trailer"]))
else:
referer = item.url
url = urlparse.urljoin(item.url,scrapedurl)
itemlist.append( Item(channel=item.channel, action="episodios" , title=title , extra=referer, url=url, thumbnail=thumbnail, plot=plot, fulltitle=fulltitle, show=title, fanart=fanart,
contentTitle=scrapedtitle, contentType="tvshow", context=["buscar_trailer"]))
next_page = scrapertools.find_single_match(data, '<div class="loadingBar" data-url="([^"]+)"')
if next_page != "":
url = urlparse.urljoin("http://www.pordede.com", next_page)
itemlist.append(
Item(channel=item.channel, action="lista", title=">> Página siguiente", extra=item.extra, url=url))
try:
import xbmcplugin
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_UNSORTED)
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_VIDEO_TITLE)
except:
pass
return itemlist
示例6: parse_listas
# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_VIDEO_TITLE [as 别名]
def parse_listas(item, bloque_lista):
logger.info()
if item.tipo == "populares":
patron = '<div class="lista(.*?)</div>\s*</h4>'
else:
patron = '<div class="lista(.*?)</h4>\s*</div>'
matches = re.compile(patron,re.DOTALL).findall(bloque_lista)
itemlist = []
for lista in matches:
scrapedurl = scrapertools.htmlclean(scrapertools.find_single_match(lista,'<a href="([^"]+)">[^<]+</a>'))
scrapedtitle = scrapertools.find_single_match(lista, '<a href="[^"]+">([^<]+)</a>')
scrapedfollowers = scrapertools.find_single_match(lista, 'Follow: <span class="number">([^<]+)')
scrapedseries = scrapertools.find_single_match(lista, '<div class="lista-stat badge">Series: ([^<]+)')
scrapedpelis = scrapertools.find_single_match(lista, '<div class="lista-stat badge">Pelis: ([^<]+)')
title = scrapertools.htmlclean(scrapedtitle) + ' ('
if scrapedpelis != '':
title += scrapedpelis + ' pelis, '
if scrapedseries != '':
title += scrapedseries + ' series, '
if scrapedfollowers != '':
title += scrapedfollowers+' seguidores'
title += ')'
url = urlparse.urljoin("https://www.plusdede.com",scrapedurl)
thumbnail = ""
itemlist.append( Item(channel=item.channel, action="peliculas" , token=item.token, tipo="lista", title=title , url=url))
logger.debug("title=["+title+"], url=["+url+"], thumbnail=["+thumbnail+"], tipo =[lista]")
nextpage = scrapertools.find_single_match(bloque_lista,'<div class="onclick load-more-icon no-json" data-action="replace" data-url="([^"]+)"')
if nextpage != '':
url = urlparse.urljoin("https://www.plusdede.com",nextpage)
itemlist.append( Item(channel=item.channel, action="lista_sig", tipo=item.tipo , title=">> Página siguiente" , extra=item.extra, url=url))
try:
import xbmcplugin
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_UNSORTED)
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_VIDEO_TITLE)
except:
pass
return itemlist
示例7: ListFollowing
# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_VIDEO_TITLE [as 别名]
def ListFollowing(logged_in):
if(CheckLogin(logged_in) == False):
CreateBaseDirectory('audio')
return
"""Scrapes all episodes of the favourites page."""
html = OpenURL('https://www.bbc.co.uk/radio/favourites/programmes')
programmes = html.split('<div class="favourites follow ')
for programme in programmes:
if not programme.startswith('media'):
continue
series_id = ''
series_name = ''
series_id_match = re.search(r'<a aria-label="(.*?)" class="follows__image-link" href="http://www.bbc.co.uk/programmes/(.*?)">',programme)
if series_id_match:
series_name = series_id_match.group(1)
series_id = series_id_match.group(2)
episode_name = ''
episode_id = ''
episode_id_match = re.search(r'<a aria-label="(.*?)" class="size-e clr-white" href="http://www.bbc.co.uk/programmes/(.*?)#play"',programme)
if episode_id_match:
episode_name = episode_id_match.group(1)
episode_id = episode_id_match.group(2)
episode_image = ''
series_image = ''
series_image_match = re.search(r'<img class="media__image" src="(.*?)"',programme)
if series_image_match:
series_image = "https:%s" % series_image_match.group(1)
episode_image = series_image
station = ''
station_match = re.search(r'<a href="(.*?)" class="clr-light-grey">\s*(.*?)\s*</a>',programme, flags=(re.DOTALL | re.MULTILINE))
if station_match:
station = station_match.group(2).strip()
description = ''
if series_id:
series_title = "[B]%s - %s[/B]" % (station, series_name)
AddMenuEntry(series_title, series_id, 131, series_image, description, '')
if episode_id:
if series_name:
episode_title = "[B]%s[/B] - %s - %s" % (station, series_name, episode_name)
else:
episode_title = "[B]%s[/B] - %s" % (station, episode_name)
episode_url = "http://www.bbc.co.uk/programmes/%s" % episode_id
# xbmc.log(episode_url)
CheckAutoplay(episode_title, episode_url, episode_image, ' ', '')
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_VIDEO_TITLE)
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_UNSORTED)
示例8: ListMostPopular
# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_VIDEO_TITLE [as 别名]
def ListMostPopular():
html = OpenURL('http://www.bbc.co.uk/radio/popular')
programmes = re.split(r'<li class="(episode|clip) typical-list-item', html)
for programme in programmes:
if not programme.startswith(" item-idx-"):
continue
programme_id = ''
programme_id_match = re.search(r'<a href="/programmes/(.*?)"', programme)
if programme_id_match:
programme_id = programme_id_match.group(1)
name = ''
name_match = re.search(r'<img src=".*?" alt="(.*?)"', programme)
if name_match:
name = name_match.group(1)
subtitle = ''
subtitle_match = re.search(r'<span class="subtitle">\s*(.+?)\s*</span>', programme)
if subtitle_match:
if subtitle_match.group(1).strip():
subtitle = "(%s)" % subtitle_match.group(1)
image = ''
image_match = re.search(r'<img src="(.*?)"', programme)
if image_match:
image = image_match.group(1)
station = ''
station_match = re.search(r'<span class="service_title">\s*(.+?)\s*</span>', programme)
if station_match:
station = station_match.group(1)
title = "[B]%s[/B] - %s %s" % (station, name, subtitle)
if programme_id and title and image:
url = "http://www.bbc.co.uk/radio/play/%s" % programme_id
CheckAutoplay(title, url, image, ' ', '')
#BUG: this should sort by original order but it doesn't (see http://trac.kodi.tv/ticket/10252)
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_VIDEO_TITLE)
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_UNSORTED)