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


Python _common.setView函数代码示例

本文整理汇总了Python中resources.lib._common.setView函数的典型用法代码示例。如果您正苦于以下问题:Python setView函数的具体用法?Python setView怎么用?Python setView使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: showroot

def showroot(id=common.args.url):
    url = build_api_url('channel','',ID=id)
    data = common.getURL(url)
    if data:
        items = demjson.decode(data)['FolderList']
        for item in items:
            if 'Full Episodes'==item['Name'] or 'Television Clips & Trailers'==item['Name'] or 'Minisodes'==item['Name'] or 'Original Series'==item['Name'] or 'Movie'==item['Name'] or 'Movie Clips & Trailers'==item['Name']:
                for season in item['PlaylistList']:
                    for video in season['MediaList']:
                        thumb=video['ThumbnailExternal']
                        ID=str(video['ID'])
                        url = video['DetailsURL']
                        infoLabels={}
                        infoLabels['Title']=video['Title']
                        infoLabels['Duration']=video['Duration']
                        try:infoLabels['Season']=int(video['Season'])
                        except:pass
                        try:infoLabels['Episode']=int(video['Episode'])
                        except:pass
                        infoLabels['MPAA']=video['Rating'] 
                        infoLabels['Genre']=video['Genre'] 
                        infoLabels['TVShowTitle']=video['ParentChannelName'] 
                        infoLabels['Plot']=video['Description']
                        try:infoLabels['AirDate']=common.formatDate(video['ReleaseDate'],'%m/%d/%Y')
                        except: print video['ReleaseDate']
                        displayname=infoLabels['Title']
                        if infoLabels.has_key('Season') or infoLabels.has_key('Episode'):
                            displayname = str(infoLabels['Season'])+'x'+str(infoLabels['Episode'])+' - '+infoLabels['Title']
                        u = sys.argv[0]
                        u += '?url="'+urllib.quote_plus(ID)+'"'
                        u += '&mode="crackle"'
                        u += '&sitemode="play"'
                        common.addVideo(u,displayname,thumb,infoLabels=infoLabels)
    common.setView('episodes')
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:34,代码来源:crackle.py

示例2: videos

def videos():
    url = 'http://www.amctv.com/index.php'
    values = {'video_browser_action':'filter',
              'params[type]':'all',
              'params[filter]':common.args.url,
              'params[page]':'1',
              'params[post_id]':'71306',      
              'module_id_base':'rb-video-browser'}
    data = common.getURL( url , values)
    data = demjson.decode(data)['html']['date']
    items = BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES).findAll('li')
    for item in items:
        link = item.find('a')
        img = link.find('img')
        url = link['href']
        name = img['title']
        plot = img['alt'].replace('/n',' ')
        thumb = img['src']
        print item.prettify()
        u = sys.argv[0]
        u += '?url="'+urllib.quote_plus(url)+'"'
        u += '&mode="amc"'
        u += '&sitemode="play"'
        infoLabels={ "Title":name,
                     #"Season":season,
                     #"Episode":episode,
                     "Plot":plot,
                     #"TVShowTitle":common.args.name
                     }
        common.addVideo(u,name,thumb,infoLabels=infoLabels)
    common.setView('episodes')
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:31,代码来源:amc.py

示例3: showsubClips

def showsubClips(url = common.args.url):
    xbmcplugin.setContent(int(sys.argv[1]), 'episodes')
    data = common.getURL(url)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    videos=tree.find('div',attrs={'class' : 'scet-browse-group detail-short-clips-view '}).findAll('div',attrs={'class' : 'thumb-block '})
    for video in videos:
        #print video.prettify()
        url = BASE + video.find('a')['href']
        thumb = video.find('img')['src'].replace('w=131&h=74','w=446&h=248')
        name = video.find('div',attrs={'class' : 'title'}).string.strip()
        showname = video.find('div',attrs={'class' : 'type'}).string.strip()
        description = video.find('p',attrs={'class' : 'description'}).find('span').string
        duration = video.find('div',attrs={'class' : 'runtime'}).string.split(':',1)[1].strip()
        u = sys.argv[0]
        u += '?url="'+urllib.quote_plus(url)+'"'
        u += '&mode="nbc"'
        u += '&sitemode="play"'
        infoLabels={ "Title":name,
                     #"Season":season,
                     #"Episode":episode,
                     "Plot":description,
                     #"premiered":airDate,
                     "Duration":duration,
                     "TVShowTitle":showname
                     }
        common.addVideo(u,name,thumb,infoLabels=infoLabels)
    common.setView('episodes')
开发者ID:AddoSolutions,项目名称:BlueCop-XBMC-Plugins,代码行数:27,代码来源:nbc.py

示例4: videos

def videos(url=common.args.url,tree=False):
    if not tree:
        data = common.getURL(url)
        tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    videos=tree.find('ol',attrs={'id':'vid_mod_1'})
    if videos:
        videos=videos.findAll('li',attrs={'id':re.compile('vidlist')})    
        for video in videos:
            thumb = BASE + video.find('img')['src']
            name = video['maintitle']
            url = BASE + video['mainurl']
            uri = video['mainuri']
            if uri == '':
                uri = url
            airDate = video['mainposted']
            description = video['maincontent']
            u = sys.argv[0]
            u += '?url="'+urllib.quote_plus(uri)+'"'
            u += '&mode="mtv"'
            u += '&sitemode="play"'
            infoLabels={ "Title":name,
                         #"Season":season,
                         #"Episode":episode,
                         "Plot":description,
                         "premiered":airDate
                         #"Duration":duration,
                         #"TVShowTitle":common.args.name
                         }
            common.addVideo(u,name,thumb,infoLabels=infoLabels)
    common.setView('episodes')
开发者ID:AddoSolutions,项目名称:BlueCop-XBMC-Plugins,代码行数:30,代码来源:mtv.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: episodes

def episodes():
    url = 'http://www.teennick.com/ajax/videos/all-videos/'+common.args.url
    url += '?sort=date+desc&start=0&page=1&viewType=collectionAll&type=fullEpisodeItem'
    data = common.getURL(url)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    episodes=tree.find('ul',attrs={'class':'large-grid-list clearfix'}).findAll('li',recursive=False)
    for episode in episodes:
        h4link=episode.find('h4').find('a')
        name = h4link.string
        url = BASE + h4link['href']
        thumb = episode.find('img')['src'].split('?')[0]
        plot = episode.find('p',attrs={'class':'description text-small color-light'}).string
        u = sys.argv[0]
        u += '?url="'+urllib.quote_plus(url)+'"'
        u += '&mode="nickteen"'
        u += '&sitemode="playvideo"'
        infoLabels={ "Title":name,
                     #"Duration":duration,
                     #"Season":0,
                     #"Episode":0,
                     "Plot":str(plot),
                     "TVShowTitle":common.args.name
                     }
        common.addVideo(u,name,thumb,infoLabels=infoLabels)
    common.setView('episodes')
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:25,代码来源:nickteen.py

示例7: episodes

def episodes():
    url = 'http://www.nick.com/ajax/videos/full-episode-videos'
    url += '?sort=date+desc&start=0&viewType=videoContentList&rows=25&artist=&show='+common.args.url+'&f_type=&f_contenttype='
    data = common.getURL(url)
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    episodes=tree.findAll('article')
    for episode in episodes:
        name = episode.find('p',attrs={'class':'short-title'}).string
        showname = episode.find('p',attrs={'class':'show-name'}).string
        plot = episode.find('p',attrs={'class':'description'}).string
        thumb = episode.find('img',attrs={'class':'thumbnail'})['src']
        dataid = episode['data-id']
        url = BASE + episode.find('a')['href']
        u = sys.argv[0]
        u += '?url="'+urllib.quote_plus(url)+'"'
        u += '&mode="nick"'
        u += '&sitemode="playvideo"'
        infoLabels={ "Title":name,
                     #"Duration":duration,
                     #"Season":season,
                     #"Episode":episode,
                     "Plot":str(plot),
                     "TVShowTitle":showname
                     }
        common.addVideo(u,name,thumb,infoLabels=infoLabels)
    common.setView('episodes')
开发者ID:AddoSolutions,项目名称:BlueCop-XBMC-Plugins,代码行数:26,代码来源:nick.py

示例8: show

def show(url=common.args.url):
    data = common.getURL(url)
    videos = demjson.decode(data.split(' = ')[1])[0]['videos']
    for video in videos:
        if 'Season' in common.args.name:
            season = int(common.args.name.split('Season')[1])
            showname = common.args.name.split('Season')[0]
        else:
            showname = common.args.name
            season = 0
        #episode = int(video['number'])
        name = video['label']
        duration = video['length']
        thumb = video['thumbnailURL']
        description = video['description']
        airDate = video['delvStartDt']
        playpath = video['videoURL'].replace('http://wms.scrippsnetworks.com','').replace('.wmv','')
        url = 'rtmp://flash.scrippsnetworks.com:1935/ondemand?ovpfv=1.1'
        url+= ' swfUrl=http://common.scrippsnetworks.com/common/snap/snap-3.0.3.swf playpath='+playpath
        displayname = name
        infoLabels={ "Title":name,
                     "Season":season,
                     #"Episode":episode,
                     "Plot":description,
                     "premiered":airDate,
                     "Duration":duration,
                     "TVShowTitle":showname
                     }
        common.addVideo(url,displayname,thumb,infoLabels=infoLabels)
    common.setView('episodes')
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:30,代码来源:food.py

示例9: 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

示例10: 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

示例11: sp_episodes

def sp_episodes():
    import demjson
    xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_EPISODE)
    url = 'http://www.southparkstudios.com/feeds/full-episode/carousel/'+common.args.url+'/dc400305-d548-4c30-8f05-0f27dc7e0d5c'
    json = common.getURL(url)
    episodes = demjson.decode(json)['season']['episode']
    for episode in episodes:
        title = episode['title']
        description = episode['description'].encode('ascii', 'ignore')
        thumbnail = episode['thumbnail'].replace('width=55','')
        episodeid = episode['id']
        senumber = episode['episodenumber']
        date = episode['airdate'].replace('.','-')
        seasonnumber = senumber[:-2]
        episodenumber = senumber[len(seasonnumber):]
        try:
            season = int(seasonnumber)
            episode = int(episodenumber)
        except:
            season = 0
            episode = 0
        u = sys.argv[0]
        u += '?url="'+urllib.quote_plus(episodeid)+'"'
        u += '&mode="comedy"'
        u += '&sitemode="sp_play"'
        infoLabels={ "Title": title,
                    "Season":season,
                    "Episode":episode,
                    "premiered":date,
                    "Plot":description,
                    "TVShowTitle":"South Park"
                    }
        common.addVideo(u,title,thumbnail,infoLabels=infoLabels)
    common.setView('episodes')
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:34,代码来源:comedy.py

示例12: full_bios

def full_bios(path=common.args.url):
    xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL)
    for page in range(1,4):
        url = BASE+path+'?page-number='+str(page)+'&pagination-sort-by=alphabetical&pagination-per-page=100&prev-sort=alphabetical&prev-per-page=100'
        data = common.getURL(url)
        tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
        videos=tree.find('div',attrs={'class':'video-results clearfix'}).findAll('li')
        for video in videos:
            link = video.find('a')
            name = link.find('strong').string.strip()
            type = name.split(' - ')[1].strip()
            name = name.split(' - ')[0]
            if type == 'Full Episode' or type == 'Full Biography':
                pass
            else:
                name+=' ('+type+')'
            url = BASE + link['href']
            #thumb = video.find('img')['src']
            thumb = ''
            duration = video.find('span',attrs={'class':'video-duration'}).string.strip().replace('(','').replace(')','')
            u = sys.argv[0]
            u += '?url="'+urllib.quote_plus(url)+'"'
            u += '&mode="bio"'
            u += '&sitemode="play"'
            infoLabels={ "Title":name,
                         "Duration":duration}
            common.addVideo(u,name,thumb,infoLabels=infoLabels)
    common.setView('episodes')
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:28,代码来源:bio.py

示例13: episodes

def episodes(url=common.args.url):
    xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL)
    data = common.getURL(url)
    #print "D",data
    tree=BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)
    seeall=tree.find('a', attrs={'class' : 'see_all'})
    print "eall",seeall
    categories=tree.findAll('a',attrs={'class' : 'read_full'})
    categories.append(seeall)
    try:
        for category in categories:
            print "cat",category
            if category is not None and category.string is not None:
                url = category['href']
                print "catu",url
                print "cn",category.string,category
                name = category.string.replace('See all ','')
                print 'name',name
                if name == 'Video Clips':
                    print "ADDD",name, 'spike', 'videos', url
                    common.addDirectory(name, 'spike', 'videos', url)
                elif name == 'Full Episodes':
                    common.addDirectory(name, 'spike', 'fullepisodes', url)
        common.setView('seasons')
    except:
        video=tree.find(attrs={'class' : 'see_all_videos clearfix'}).find('a')
        url = video['href']
        name = video.contents[1].contents[0].replace('See All ','')
        common.addDirectory(name, 'spike', 'videos', url)
        common.setView('seasons')
开发者ID:yultide,项目名称:BlueCop-XBMC-Plugins,代码行数:30,代码来源:spike.py

示例14: episodesRSS

def episodesRSS(url=common.args.url):
    data = common.getURL(url)
    tree=BeautifulStoneSoup(data, convertEntities=BeautifulStoneSoup.HTML_ENTITIES)
    menu=tree.findAll('item')
    for item in menu:
        namedata = item('title')[0].string.encode('utf-8').split(' Full Episode - ')
        name = namedata[0]
        season = int(namedata[1].split(' - ')[0].split(' | ')[1].replace('s',''))
        episode = int(namedata[1].split(' - ')[0].split(' | ')[0].replace('e',''))
        tvshow = namedata[1].split(' - ')[1] 
        url = item('link')[0].string
        thumb = item('image')[0].string
        airDate = item('pubdate')[0].string.split('T')[0]
        descriptiondata = re.compile('<p>(.+?)</p>').findall(item('description')[0].string)[0].split('<br>')
        description = descriptiondata[0]
        duration = descriptiondata[-2].replace('Duration: ','')
        displayname = '%sx%s - %s' % (str(season),str(episode),name)
        u = sys.argv[0]
        u += '?url="'+urllib.quote_plus(url)+'"'
        u += '&mode="abc"'
        u += '&sitemode="play"'
        infoLabels={ "Title":name,
                     "Season":season,
                     "Episode":episode,
                     "Plot":description,
                     "premiered":airDate,
                     "Duration":duration,
                     "TVShowTitle":tvshow
                     }
        common.addVideo(u,displayname,thumb,infoLabels=infoLabels)
    common.setView('episodes')
开发者ID:AddoSolutions,项目名称:BlueCop-XBMC-Plugins,代码行数:31,代码来源:abc.py

示例15: videos

def videos(url=common.args.url,xml_url=False):
    if not xml_url:
        data = common.getURL(url)
        xml_url=getShowXML_URL(data)
    data = common.getURL(xml_url)
    tree = BeautifulStoneSoup(data, convertEntities=BeautifulStoneSoup.XML_ENTITIES)
    videos = tree.findAll('video')
    for video in videos:
        name = video.find('clipname').string
        showname = video.find('relatedtitle').string
        if not showname:
            showname=''
        duration = video.find('length').string
        thumb = video.find('thumbnailurl').string.replace('_92x69','_480x360')
        plot = video.find('abstract').string
        link = video.find('videourl').string
        playpath = link.replace('http://wms.scrippsnetworks.com','').replace('.wmv','')
        url = 'rtmp://flash.scrippsnetworks.com:1935/ondemand?ovpfv=1.1 swfUrl="http://common.scrippsnetworks.com/common/snap/snap-3.0.3.swf" playpath='+playpath
        infoLabels={ "Title":name,
                     "Duration":duration,
                     #"Season":season,
                     #"Episode":episode,
                     "Plot":plot,
                     "TVShowTitle":showname
                     }
        common.addVideo(url,name,thumb,infoLabels=infoLabels)
    common.setView('episodes')
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:27,代码来源:hgtv.py


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