本文整理汇总了Python中resources.lib._common.addDirectory函数的典型用法代码示例。如果您正苦于以下问题:Python addDirectory函数的具体用法?Python addDirectory怎么用?Python addDirectory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了addDirectory函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: listCatType
def listCatType(url,db,showtype=True):
data = common.getURL(url)
db_shows=[]
if data:
items = demjson.decode(data)['Entries']
for item in items:
show_id=str(item['ID'])
name=item['Name']
if db==True:
db_shows.append((name, 'crackle', 'showroot', show_id))
else:
if showtype:
common.addShow(name, 'crackle', 'showroot', show_id)
else:
plot=item['Description']
genre=item['Genre']
thumb=item['ChannelArtTileLarge']
fanart=item['ChannelArtLandscape']
common.addDirectory(name, 'crackle', 'showroot', show_id, thumb, '', plot, '',genre)
if db==True:
return db_shows
elif showtype:
common.setView('tvshows')
else:
common.setView('seasons')
示例2: showsubcats
def showsubcats(url=common.args.url):
#Add season options
data = common.getURL(url)
tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
subs=tree.find(attrs={'class':'group-a'}).findAll('a')
for sub in subs:
name = sub.string
url = sub['href']
if BASE not in url:
url = BASE + url
if name == None:
name = sub.contents[-1]
if 'Episodes' in name or 'Clips' in name or 'Peeks' in name or 'Watch' in name or 'Video' in name:
if 'id=' in url:
u = sys.argv[0]
u += '?url="'+urllib.quote_plus(url)+'"'
u += '&mode="vh1"'
u += '&sitemode="playurl"'
item=xbmcgui.ListItem(name)
item.setInfo( type="Video", infoLabels={ "Title":name })
item.setProperty('IsPlayable', 'true')
xbmcplugin.addDirectoryItem(pluginhandle,url=u,listitem=item,isFolder=False)
else:
common.addDirectory(name,'vh1','videos',url)
common.setView('seasons')
示例3: seasonOptions
def seasonOptions(url=common.args.url):
common.addDirectory('All Videos','vh1','videos',url)
common.addDirectory('Full Episodes','vh1','videos',url+'fulleps')
common.addDirectory('Bonus Clips','vh1','videos',url+'bonusclips')
common.addDirectory('After Shows','vh1','videos',url+'aftershows')
common.addDirectory('Sneak Peeks','vh1','videos',url+'sneakpeeks')
common.setView('seasons')
示例4: sp_seasons
def sp_seasons(url=common.args.url):
for sn in range(1,17):
sn = str(sn)
name = 'Season '+sn
url = sn
common.addDirectory(name,'comedy','sp_episodes',url)
common.setView('seasons')
示例5: shows
def shows(url=common.args.url,db=False):
data = common.getURL(showlist)
tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
menu = tree.find('div',attrs={'id':'accordion','class':'view-content'}).findAll('h3')
names = []
for item in menu:
name = item.find('a',attrs={'href':'#'}).string
names.append(name)
if db == False:
marker = names.index(url)
elif db == True:
marker = names.index('Current Shows')
menu = tree.find('div',attrs={'id':'accordion','class':'view-content'})
shows = menu.findAll('div',recursive=False)[marker].findAll('li')
dbshows = []
for show in shows:
showdata = show.findAll(attrs={'class':'field-content'})
name = showdata[0].a.string
showid = showdata[1].string
if db == False:
if 'Movies' in common.args.name:
common.addDirectory(name, 'lifetime', 'showroot', showid)
else:
common.addShow(name, 'lifetime', 'showroot', showid)
elif db == True:
dbshows.append((name, 'lifetime', 'showroot', showid))
if db == True:
return dbshows
else:
common.setView('tvshows')
示例6: show_cats
def show_cats(url=common.args.url):
data = common.getURL(url.replace(' ','%20'))
tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
homedir = tree.find('div',attrs={'id':'video_home_dir','style':'display : none'}).string
series_base = 'http://www.aetv.com/minisite/videoajx.jsp'
series_base += '?homedir='+homedir
#full_series_url = series_url+'&pfilter=FULL%20EPISODES'
#clips_series_url = series_url+'&pfilter=CLIPS'
if homedir == '/lifestyle/' or homedir == '/classic/':
series = url.split('=')[-1].replace(' ','%20')
series_url = series_base + '&seriesfilter='+series
else:
series_url = series_base
data = common.getURL(series_url)
tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
seasons = tree.find('div',attrs={'id':'primary_filter'}).findAll('li',attrs={'class':None})
if len(seasons) > 0:
for season in seasons:
link = season.find('a')
if '?' in series_base:
season_url = series_base + '&pfilter='+link.string.strip().replace(' ','%20')
else:
season_url = series_base + '?pfilter='+link.string.strip().replace(' ','%20')
if homedir == '/lifestyle/' or homedir == '/classic/':
series = url.split('=')[-1].replace(' ','%20')
season_url += '&seriesfilter='+series
common.addDirectory(link.string.title(), 'aetv', 'showseasonThePlatform', season_url)
xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL)
common.setView('seasons')
else:
showseasonThePlatform(url.replace(' ','%20'),tree=tree)
common.setView('seasons')
示例7: show
def show(url=common.args.url):
data = common.getURL(url)
tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
sections=tree.find('ul',attrs={'class':'channel-list'})
if sections:
sections = sections.findAll('li',recursive=False)
for section in sections:
name = section.find('h4').contents[1].strip()
if common.args.name in name and common.args.name <> name:
name = name.replace(common.args.name,'').strip().strip('-').strip(',').strip()
url = section.find('a')['href']
if 'http://' not in url:
url = BASE+url
common.addDirectory(name, 'hgtv', 'videos', url)
common.setView('seasons')
else:
xml_url=getShowXML_URL(data)
if xml_url:
videos(xml_url=xml_url)
else:
backup_url = tree.find('ul', attrs={'class' : "button-nav"})
if backup_url:
if len(backup_url) > 2:
show(backup_url.findAll('a')[1]['href'])
else:
backup2_url = tree.find('li', attrs={'class' : "tab-past-season"})
if backup2_url:
show(backup2_url.a['href'])
示例8: showcats
def showcats(url=common.args.url):
data = common.getURL(url)
tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
cats=tree.findAll(attrs={'class' : re.compile('(.+?)videoCollectionModule(.+?)')})
for cat in cats:
name = cat.find('div',attrs={'class' : 'twocolumnheader'}).find('h3').string.title()
common.addDirectory(name, 'abcfamily', 'videos', url)
common.setView('seasons')
示例9: rootlist
def rootlist():
data = common.getURL(showlist)
tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
menu = tree.find('div',attrs={'id':'accordion','class':'view-content'}).findAll('h3')
for item in menu:
name = item.find('a',attrs={'href':'#'}).string
common.addDirectory(name, 'lifetime', 'shows', name )
common.addDirectory('Full Movies', 'lifetime', 'movies', '')
common.setView('seasons')
示例10: show
def show(url=common.args.url):
data = common.getURL(url)
tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
menu=tree.find('div',attrs={'id':'videotabs'}).findAll('li')
for item in menu:
itemurl = url +'<videotab>'+ item['id'].replace('videotab_','')
name = item.find('p').string.split('(')[0].title()
common.addDirectory(name, 'thecw', 'episodes', itemurl)
common.setView('seasons')
示例11: rootlist
def rootlist():
data = common.getURL(BASE_URL)
tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
menu=tree.find(attrs={'id' : 'daypart_nav'})
categories=menu.findAll('a')
for item in categories:
catid = item['onclick'].replace("showDaypart('",'').replace("');",'')
name = catid.title()
common.addDirectory(name, 'cbs', 'shows', catid)
common.setView('seasons')
示例12: seasons
def seasons(url=common.args.url):
data = common.getURL(url)
tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
seasonmenu=tree.find('select',attrs={'id':'videolist_id'})
if seasonmenu:
seasons = seasonmenu.findAll('option')
for season in seasons:
url = BASE + season['value']
name = season.string
common.addDirectory(name,'vh1','seasonOptions',url)
common.setView('seasons')
示例13: show
def show():
data = common.getURL(common.args.url)
full = re.compile('f:"(.*?)",').findall(data)
clip = re.compile('c:"(.*?)",').findall(data)
if len(full) > 0:
if full[0] <> '':
common.addDirectory('Full Episodes', 'gsn', 'episodes', full[0])
if len(clip) > 0:
if clip[0] <> '':
common.addDirectory('Clips', 'gsn', 'episodes', clip[0])
common.setView('seasons')
示例14: stshowcats
def stshowcats(url = common.args.url):
stbase = 'http://www.startrek.com'
data = common.getURL(url)
remove = re.compile('<!.*?">')
data = re.sub(remove, '', data)
tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
stcats=tree.find('div',attrs={'id' : 'content'}).findAll('div', attrs={'class' : 'box_news'})
for cat in stcats:
name = cat.find('h4').contents[1].strip()
common.addDirectory(name, 'cbs', 'stvideos', url+'<name>'+name)
common.setView('seasons')
示例15: rootlist
def rootlist():
xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_NONE)
data = common.getURL(CONFIGURATION_URL)
tree=BeautifulStoneSoup(data, convertEntities=BeautifulStoneSoup.XML_ENTITIES)
categories = tree.find('logiccategories').findAll('category')
for category in categories:
name = category['name']
description = category['description']
categoryid = category['categoryid']
common.addDirectory(name, 'adultswim', 'showbycat', categoryid)
common.setView('seasons')