本文整理汇总了Python中resources.lib._common.addDirectory函数的典型用法代码示例。如果您正苦于以下问题:Python addDirectory函数的具体用法?Python addDirectory怎么用?Python addDirectory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了addDirectory函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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')
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:25,代码来源:crackle.py
示例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')
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:25,代码来源:vh1.py
示例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')
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:7,代码来源:vh1.py
示例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')
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:7,代码来源:comedy.py
示例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')
开发者ID:yultide,项目名称:BlueCop-XBMC-Plugins,代码行数:30,代码来源:lifetime.py
示例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')
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:32,代码来源:aetv.py
示例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'])
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:28,代码来源:hgtv.py
示例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')
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:8,代码来源:abcfamily.py
示例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')
开发者ID:yultide,项目名称:BlueCop-XBMC-Plugins,代码行数:9,代码来源:lifetime.py
示例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')
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:9,代码来源:thecw.py
示例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')
开发者ID:AddoSolutions,项目名称:BlueCop-XBMC-Plugins,代码行数:10,代码来源:cbs.py
示例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')
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:11,代码来源:vh1.py
示例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')
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:11,代码来源:gsn.py
示例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')
开发者ID:yultide,项目名称:BlueCop-XBMC-Plugins,代码行数:11,代码来源:cbs.py
示例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')
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:11,代码来源:adultswim.py
示例16: rootlist
def rootlist():
print "DEBUG Entering rootlist function"
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:
if item['href'].find('javascript') == 0:
catid = item['onclick'].replace("showDaypart('",'').replace("');",'')
name = re.compile('<a.*>(.+)</a>').findall(str(item))[0].title()
common.addDirectory(name, 'cbs', 'shows', catid)
common.setView('seasons')
开发者ID:yultide,项目名称:BlueCop-XBMC-Plugins,代码行数:12,代码来源:cbs.py
示例17: rootlist
def rootlist(): # No mode - Root Listing
url = getCollections + '?id=185669'
html=common.getURL(url)
tree=BeautifulStoneSoup(html, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
collections = tree.findAll('collection')
for collection in collections:
cid = collection['id']
name = collection.find('name').string
if name == 'feature - not show in nav':
continue
common.addDirectory(name.title(), 'tbs', 'shows', cid)
common.setView('seasons')
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:12,代码来源:tbs.py
示例18: rootlist
def rootlist():
xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL)
url = 'http://www.tnt.tv/content/services/getCollections.do?site=true&id=58127'
html=common.getURL(BASE_URL)
tree=BeautifulStoneSoup(html, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
collections = tree.findAll('collection')
for collection in collections:
cid = collection['id']
name = collection.find('name').string
if name == 'Featured':
continue
common.addDirectory(name, 'tnt', 'shows', cid)
common.setView('seasons')
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:13,代码来源:tnt.py
示例19: showcats
def showcats(url = common.args.url):
data = common.getURL(url)
#try:
# var show = new CBS.Show({id:111381});
# show_id = re.compile("new CBS\.Show\(id:(.*?)\);").findall(data)
# url = 'http://www.cbs.com/carousels/'+dir3+'/video/'+dir1+'/'+dir2+'/0/400/
try:
print 'CBS: Trying New Carousel'
carousels = re.compile("loadUpCarousel\('(.*?)','(.*?)', '(.*?)', (.*?), true, stored").findall(data)
carousels[0][0]
for name,dir1,dir2,dir3 in carousels:
url = 'http://www.cbs.com/carousels/'+dir3+'/video/'+dir1+'/'+dir2+'/0/400/'
common.addDirectory(name, 'cbs', 'newvideos', url)
except:
print 'CBS: Carousel Failed'
tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
try:
print 'CBS: trying secondary-show-nav-wrapper'
options = tree.find(attrs={'id' : 'secondary-show-nav-wrapper'})
options = options.findAll('a')
for option in options:
name = option.string.encode('utf-8')
url = BASE + option['href']
common.addDirectory(name, 'cbs', 'videos', url)
print 'CBS: trying vid_module'
options = tree.findAll(attrs={'class' : 'vid_module'})
for option in options:
moduleid = option['id']
name = option.find(attrs={'class' : 'hdr'}).string
common.addDirectory(name, 'cbs', 'showsubcats', url+'<moduleid>'+moduleid)
except:
print 'CBS: secondary-show-nav-wrapper failed'
print 'CBS: trying vid_module secondary'
try:
options = tree.findAll(attrs={'class' : 'vid_module'})
print 'DEBUG: '+options
for option in options:
moduleid = option['id']
name = option.find(attrs={'class' : 'hdr'}).string
common.addDirectory(name, 'cbs', 'showsubcats', url+'<moduleid>'+moduleid)
except:
print 'CBS: vid_module secondary failed'
print 'CBS: trying 16.04.2013 id-carousel'
categories = re.compile("id-carousel-(\d+)").findall(str(tree))
for catid in categories:
thisUrl = 'http://www.cbs.com/carousels/videosBySection/'+catid+'/offset/0/limit/40/xs/{excludeShow}'
data = common.getURL(thisUrl)
name = demjson.decode(data)['result']['title']
common.addDirectory(name, 'cbs', 'newvideos2', thisUrl)
common.setView('seasons')
开发者ID:yultide,项目名称:BlueCop-XBMC-Plugins,代码行数:50,代码来源:cbs.py
示例20: seasonsRSS
def seasonsRSS(url=common.args.url):
data = common.getURL(url)
tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
video_rss = menu=tree.find(attrs={'type' : 'application/rss+xml'})['href']
showid=url.split('?')[0].split('/')[-1]
url='http://abc.go.com/vp2/s/carousel?service=seasons&parser=VP2_Data_Parser_Seasons&showid='+showid+'&view=season&bust=07000001_3'
data = common.getURL(url)
tree=BeautifulStoneSoup(data, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
seasons=tree.findAll('a')
for season in seasons:
seasonid=season['seasonid']
name=season.string.strip()
url=video_rss.replace('-1/-1/-1',seasonid+'/-1/-1')
common.addDirectory(name, 'abc', 'episodes', url )
common.setView('seasons')
开发者ID:AddoSolutions,项目名称:BlueCop-XBMC-Plugins,代码行数:15,代码来源:abc.py
注:本文中的resources.lib._common.addDirectory函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论