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


Python ListItem.add_moving_data方法代码示例

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


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

示例1: playChannel

# 需要导入模块: from common.DataObjects import ListItem [as 别名]
# 或者: from common.DataObjects.ListItem import add_moving_data [as 别名]
def playChannel(request_obj, response_obj):
    item = ListItem()
    item.set_next_action_name('Play')
    item.add_moving_data('videoStreamUrl', request_obj.get_data()['channelUrl'])
    xbmcListItem = xbmcgui.ListItem(label=request_obj.get_data()['channelName'], iconImage=request_obj.get_data()['channelLogo'], thumbnailImage=request_obj.get_data()['channelLogo'])
    item.set_xbmc_list_item_obj(xbmcListItem)
    response_obj.addListItem(item)
开发者ID:weskerhluffy,项目名称:xbmc_caca,代码行数:9,代码来源:YEAH_Live.py

示例2: prepareVideoItem

# 需要导入模块: from common.DataObjects import ListItem [as 别名]
# 或者: from common.DataObjects.ListItem import add_moving_data [as 别名]
def prepareVideoItem(request_obj, response_obj):
    item = ListItem()
    item.add_moving_data('videoUrl', request_obj.get_data()['videoLink'])
    item.set_next_action_name('Play')
    xbmcListItem = xbmcgui.ListItem(label=request_obj.get_data()['videoTitle'])
    item.set_xbmc_list_item_obj(xbmcListItem)
    response_obj.addListItem(item)
开发者ID:ak0ng,项目名称:dk-xbmc-repaddon-rep,代码行数:9,代码来源:PreProcessor.py

示例3: __preparePlayListItem__

# 需要导入模块: from common.DataObjects import ListItem [as 别名]
# 或者: from common.DataObjects.ListItem import add_moving_data [as 别名]
def __preparePlayListItem__(video_source_id, video_source_img, video_playlist_items):
    item = ListItem()
    item.add_request_data('videoPlayListItems', video_playlist_items)
    item.set_next_action_name('SnapAndDirectPlayList')
    item.add_moving_data('isContinuousPlayItem', True)
    xbmcListItem = xbmcgui.ListItem(label='[COLOR blue]' + AddonUtils.getBoldString('Continuous Play') + '[/COLOR]' + ' | ' + 'Source #' + str(video_source_id) + ' | ' + 'Parts = ' + str(len(video_playlist_items)) , iconImage=video_source_img, thumbnailImage=video_source_img)
    item.set_xbmc_list_item_obj(xbmcListItem)
    return item
开发者ID:jigarsavla,项目名称:apple-tv2-xbmc,代码行数:10,代码来源:DT_TVShows.py

示例4: prepareVideoItem

# 需要导入模块: from common.DataObjects import ListItem [as 别名]
# 或者: from common.DataObjects.ListItem import add_moving_data [as 别名]
def prepareVideoItem(request_obj, response_obj):
    item = ListItem()
    item.add_moving_data('videoUrl', request_obj.get_data()['videoLink'])
    item.set_next_action_name('Play')
    xbmcListItem = xbmcgui.ListItem(label=request_obj.get_data()['videoTitle'])
    if(request_obj.get_data().has_key('videoInfo')):
        meta = request_obj.get_data()['videoInfo']
        xbmcListItem.setIconImage(meta['thumb_url'])
        xbmcListItem.setThumbnailImage(meta['cover_url'])
        xbmcListItem.setInfo('video', meta)
    item.set_xbmc_list_item_obj(xbmcListItem)
    response_obj.addListItem(item)
开发者ID:jigarsavla,项目名称:apple-tv2-xbmc,代码行数:14,代码来源:PreProcessor.py

示例5: __processPlaylistAndAddVideoItem__

# 需要导入模块: from common.DataObjects import ListItem [as 别名]
# 或者: from common.DataObjects.ListItem import add_moving_data [as 别名]
def __processPlaylistAndAddVideoItem__(item):
    playlist = findPlaylistInfo(item.get_moving_data()['videoUrl'])
    if playlist is not None:
        videoItems = []
        part = 0
        for videoUrl in playlist:
            part = part + 1
            item = ListItem()
            item.add_moving_data('videoUrl', videoUrl)
            item.set_next_action_name('Play')
            xbmcListItem = xbmcgui.ListItem(label='Video ' + str(part))
            item.set_xbmc_list_item_obj(xbmcListItem)
            videoItems.append(item)
        return videoItems
开发者ID:jigarsavla,项目名称:apple-tv2-xbmc,代码行数:16,代码来源:SnapVideo.py

示例6: retrieveLiveLink

# 需要导入模块: from common.DataObjects import ListItem [as 别名]
# 或者: from common.DataObjects.ListItem import add_moving_data [as 别名]
def retrieveLiveLink(request_obj, response_obj):
    channelInfo = request_obj.get_data()['channelInfo']
    params = {'channel_id':channelInfo[0], 'server_type':channelInfo[1], 'timezone':channelInfo[2]}
    content = HttpClient().getHtmlContent(url='http://www.watchsuntv.com/play/pages/playOn/', params=params)
    streamUrl = re.compile('<param name="flashvars" value="streamer=(.+?)"').findall(content)[0]
    swfUrl = 'http://www.watchsuntv.com/play/' + re.compile('<param name="movie" value="(.+?)"').findall(content)[0]
    urlParams = streamUrl.split('&')
    videoStreamUrl = urlParams[0] + ' ' + urlParams[1].replace('file', 'playpath') + ' swfUrl=' + swfUrl + ' swfVfy=true live=true pageUrl=' + swfUrl
    
    item = ListItem()
    item.set_next_action_name('Play')
    item.add_moving_data('videoStreamUrl', videoStreamUrl)
    xbmcListItem = xbmcgui.ListItem(label=request_obj.get_data()['channelName'], iconImage=request_obj.get_data()['channelLogo'], thumbnailImage=request_obj.get_data()['channelLogo'])
    item.set_xbmc_list_item_obj(xbmcListItem)
    response_obj.addListItem(item)
开发者ID:weskerhluffy,项目名称:xbmc_caca,代码行数:17,代码来源:WST_Live.py

示例7: retrieveLiveLink

# 需要导入模块: from common.DataObjects import ListItem [as 别名]
# 或者: from common.DataObjects.ListItem import add_moving_data [as 别名]
def retrieveLiveLink(request_obj, response_obj):
    videoStreamUrl = None
    channelName = request_obj.get_data()['channelId']
    if request_obj.get_data()['flash']:
        videoStreamUrl = retrieveFlashLiveLink(request_obj, response_obj)
        channelName = channelName + ' Flash HQ'
    else:
        videoStreamUrl = retrieveMMSLiveLink(request_obj, response_obj)
    
    
    item = ListItem()
    item.set_next_action_name('Play')
    item.add_moving_data('videoStreamUrl', videoStreamUrl)
    xbmcListItem = xbmcgui.ListItem(label=channelName, iconImage=request_obj.get_data()['channelLogo'], thumbnailImage=request_obj.get_data()['channelLogo'])
    item.set_xbmc_list_item_obj(xbmcListItem)
    response_obj.addListItem(item)
开发者ID:weskerhluffy,项目名称:xbmc_caca,代码行数:18,代码来源:MNT_Live.py

示例8: preparePlayListItems

# 需要导入模块: from common.DataObjects import ListItem [as 别名]
# 或者: from common.DataObjects.ListItem import add_moving_data [as 别名]
def preparePlayListItems(request_obj, response_obj):
    if request_obj.get_data().has_key('videoPlayListItems'):
        playList = request_obj.get_data()['videoPlayListItems']
        for videoItem in playList:
            data = {}
            data['videoLink'] = videoItem['videoLink']
            data['videoTitle'] = videoItem['videoTitle']
            item = ListItem()
            item.add_moving_data('videoStreamUrl', 'plugin://plugin.video.filmibynaturex/?actionId=snap_and_resolve_video&data=' + urllib.quote_plus(AddonUtils.encodeData(data)))
            item.set_next_action_name('Play')
            xbmcListItem = xbmcgui.ListItem(label=videoItem['videoTitle'])
            if(request_obj.get_data().has_key('videoInfo')):
                meta = request_obj.get_data()['videoInfo']
                xbmcListItem.setIconImage(meta['thumb_url'])
                xbmcListItem.setThumbnailImage(meta['cover_url'])
                xbmcListItem.setInfo('video', meta)
            item.set_xbmc_list_item_obj(xbmcListItem)
            response_obj.addListItem(item)
开发者ID:jigarsavla,项目名称:apple-tv2-xbmc,代码行数:20,代码来源:PlaylistProcessor.py

示例9: __preparePlayListItem__

# 需要导入模块: from common.DataObjects import ListItem [as 别名]
# 或者: from common.DataObjects.ListItem import add_moving_data [as 别名]
def __preparePlayListItem__(video_items, source):
    video_playlist_items = []
    video_source_img = None
    video_source_name = None
    for item in video_items:
        video_item = {}
        video_item['videoLink'] = item.get_request_data()['videoLink']
        video_item['videoTitle'] = item.get_request_data()['videoTitle']
        video_playlist_items.append(video_item)
        video_source_img = item.get_moving_data()['videoSourceImg']
        video_source_name = item.get_moving_data()['videoSourceName']
    Logger.logDebug('IMAGE :: ')
    Logger.logDebug(video_source_img)
    Logger.logDebug(type(video_source_img))
    item = ListItem()
    item.add_request_data('videoPlayListItems', video_playlist_items)
    item.add_moving_data('isContinuousPlayItem', True)
    item.add_moving_data('videoSourceName', video_source_name)
    item.set_next_action_name('Play_AllStreams')
    xbmcListItem = xbmcgui.ListItem(label='[COLOR blue]' + AddonUtils.getBoldString('Continuous Play') + '[/COLOR]' + ' | ' + 'Source #' + source + ' | ' + 'Parts = ' + str(len(video_playlist_items)) , iconImage=video_source_img, thumbnailImage=video_source_img)
    item.set_xbmc_list_item_obj(xbmcListItem)
    return item
开发者ID:shauryaanand,项目名称:desimc,代码行数:24,代码来源:Sominal.py

示例10: __retrieveTVShowEpisodes__

# 需要导入模块: from common.DataObjects import ListItem [as 别名]
# 或者: from common.DataObjects.ListItem import add_moving_data [as 别名]
def __retrieveTVShowEpisodes__(threads, response_obj):
    if threads is None:
        return
    aTags = threads.findAll('a', {'class':re.compile(r'\btitle\b')})
    videoEpisodes = []
    for aTag in aTags:
        episodeName = aTag.getText()
        if not re.search(r'\b(Watch|Episode|Video|Promo)\b', episodeName, re.IGNORECASE):
            pass
        else:
            videoEpisodes.append(aTag)
            
    if len(videoEpisodes) == 0:
        videoEpisodes = aTags
        
    for aTag in videoEpisodes:
        episodeName = aTag.getText()
        item = ListItem()
        titleInfo = HttpUtils.unescape(episodeName)
        movieInfo = re.compile("(.+?)\((\d+)\)").findall(titleInfo)
        if(len(movieInfo) >= 1 and len(movieInfo[0]) >= 2):
            title = unicode(movieInfo[0][0].rstrip()).encode('utf-8')
            year = unicode(movieInfo[0][1]).encode('utf-8')
            item.add_moving_data('movieTitle', title)
            item.add_moving_data('movieYear', year)
        
        item.add_request_data('episodeName', titleInfo)
        episodeUrl = str(aTag['href'])
        if not episodeUrl.lower().startswith(BASE_WSITE_URL):
            if episodeUrl[0] != '/':
                episodeUrl = '/' + episodeUrl
            episodeUrl = BASE_WSITE_URL + episodeUrl
        item.add_request_data('episodeUrl', episodeUrl)
        item.set_next_action_name('Episode_VLinks')
        xbmcListItem = xbmcgui.ListItem(label=episodeName)
        item.set_xbmc_list_item_obj(xbmcListItem)
        response_obj.addListItem(item)
开发者ID:jigarsavla,项目名称:apple-tv2-xbmc,代码行数:39,代码来源:DR_TVShows.py

示例11: listMovies

# 需要导入模块: from common.DataObjects import ListItem [as 别名]
# 或者: from common.DataObjects.ListItem import add_moving_data [as 别名]
def listMovies(request_obj, response_obj):
    categoryUrlSuffix = request_obj.get_data()['categoryUrlSuffix']
    page = 1
    if request_obj.get_data().has_key('page'):
        page = int(request_obj.get_data()['page'])
    
    titles = retrieveMovies(categoryUrlSuffix, page)
    
    items = []
    for entry in titles:
        titleInfo = entry['title']
        
        if re.compile('Hindi Dubbed').findall(titleInfo) is not None:
            titleInfo = titleInfo.replace('(Hindi Dubbed)', '').replace('Hindi Dubbed', '')
        
        movieInfo = re.compile("(.+?)\((\d+)\) (.*)").findall(titleInfo)
        if(len(movieInfo) == 0):
            movieInfo = re.compile("(.+?)\((\d+)\)").findall(titleInfo)
        if(len(movieInfo) == 0):
            movieInfo = [[titleInfo]]
        title = unicode(movieInfo[0][0].rstrip()).encode('utf-8').replace('&#8211;', '-').replace('&amp;', '&')
        year = ''
        if(len(movieInfo[0]) >= 2):
            year = unicode(movieInfo[0][1]).encode('utf-8')
        quality = ''
        if categoryUrlSuffix != 'BluRay':
            if(len(movieInfo[0]) >= 3):
                quality = unicode(movieInfo[0][2]).encode('utf-8').strip()
                if quality == '*BluRay*' or quality == '*BluRay* (Hindi Dubbed)' or quality == '*BluRay* Hindi Dubbed':
                    quality = '[COLOR red]*HD*[/COLOR]'
                elif quality == 'DVD' or quality == 'DVD (Hindi Dubbed)' or quality == 'DVD Hindi Dubbed':
                    quality = '[COLOR orange]DVD[/COLOR]'
                quality = ' :: ' + quality
                
        movieInfo = entry['content']
        movieLabel = '[B]' + title + '[/B]' + ('(' + year + ')' + quality if (year != '') else '')
        item = ListItem()
        item.add_moving_data('movieTitle', title)
        item.add_moving_data('movieYear', year)
        item.add_request_data('movieInfo', unicode(movieInfo).encode('utf-8'))
        item.add_request_data('movieTitle', title)
        item.set_next_action_name('Movie_Streams')
        xbmcListItem = xbmcgui.ListItem(label=movieLabel, label2='(' + year + ') :: ' + quality)
        item.set_xbmc_list_item_obj(xbmcListItem)
        items.append(item)
        response_obj.addListItem(item)
    
    total_pages = 4
    count = 0
    next_page = page
    if count < total_pages:
        count = count + 1
        next_page = next_page + 1
        item = ListItem()
        item.add_request_data('page', next_page)
        item.add_request_data('categoryUrlSuffix', request_obj.get_data()['categoryUrlSuffix'])
        item.set_next_action_name('Next_Page')
        xbmcListItem = xbmcgui.ListItem(label='  ---- NEXT PAGE #' + str(next_page) + ' --->')
        item.set_xbmc_list_item_obj(xbmcListItem)
        response_obj.addListItem(item)
    
    response_obj.set_xbmc_content_type('movies')
开发者ID:shauryaanand,项目名称:desimc,代码行数:64,代码来源:Sominal.py

示例12: __prepareVideoLink__

# 需要导入模块: from common.DataObjects import ListItem [as 别名]
# 或者: from common.DataObjects.ListItem import add_moving_data [as 别名]
def __prepareVideoLink__(videoSourceLink):
    new_items = []
    url = videoSourceLink
    if re.search('wp.me', url, re.I):
        url = HttpUtils.getRedirectedUrl(url)
    if not url.startswith('http://'):
        url = 'http://' + url
    Logger.logDebug(url)
#     contentDiv = BeautifulSoup.SoupStrainer('div', {'class':'left_articles'})
#     soup = BeautifulSoup.BeautifulSoup(html, contentDiv)
    html = HttpUtils.HttpClient().getHtmlContent(url)
    dek = EnkDekoder.dekode(html)
    Logger.logDebug(dek)
    if dek is not None:
        html = dek
        
    html = html.replace('\n\r', '').replace('\r', '').replace('\n', '').replace('\\', '')
    children = []
    if re.search('http://videos.stvflicks.com/', html):
        docId = re.compile('http://videos.stvflicks.com/(.+?).mp4"').findall(html)[0]
        children.append('src="http://videos.stvflicks.com/' + docId + '.mp4"')
    elif re.search('http://playcineflix.com/', html):
        docId = re.compile('http://playcineflix.com/(.+?).mp4"').findall(html)[0]
        children.append('src="http://playcineflix.com/' + docId + '.mp4"')
    elif re.search('https://video.google.com/get_player', html):
        docId = re.compile('docid=(.+?)"').findall(html)[0]
        children.append('src="https://docs.google.com/file/d/' + docId + '/preview"')
    elif re.search('http://videos.videopress.com/', html):
        docId = re.compile('type="video/mp4" href="http://videos.videopress.com/(.+?).mp4"').findall(html)[0]
        children.append('src="http://videos.videopress.com/' + docId + '.mp4"')
    else:
        children = re.compile('<embed(.+?)>').findall(html)
        if children is None or len(children) == 0:
            children = re.compile('<iframe(.+?)>').findall(html)
    
            
    Logger.logDebug(children)
    for child in children:
        video_url = re.compile('src="(.+?)"').findall(child)[0]
        if(re.search('http://ads', video_url, re.I) or re.search('http://ax-d', video_url, re.I)):
            continue
        if video_url.startswith('http://goo.gl/'):
            Logger.logDebug('Found google short URL = ' + video_url)
            video_url = HttpUtils.getRedirectedUrl(video_url)
            Logger.logDebug('After finding out redirected URL = ' + video_url)
            if re.search('videos.desionlinetheater.com', video_url):
                XBMCInterfaceUtils.displayDialogMessage('Unable to parse', 'A new HTML Guardian is used to protect the page', 'Sounds technical!! hmm, it means cannot find video.', 'Fix: Find me JavaScript Interpreter online service')
        video_hosting_info = SnapVideo.findVideoHostingInfo(video_url)
        if video_hosting_info is None:
            Logger.logDebug('Unrecognized video_url = ' + video_url)
            continue
        video_source_img = video_hosting_info.get_video_hosting_image()
        
        new_item = ListItem()
        new_item.add_request_data('videoTitle', 'Part #')
        new_item.add_request_data('videoLink', video_url)
        new_item.add_moving_data('videoSourceImg', video_source_img)
        new_item.add_moving_data('videoSourceName', video_hosting_info.get_video_hosting_name())
        new_item.set_next_action_name('Play_Stream')
        xbmcListItem = xbmcgui.ListItem(label='Part #', iconImage=video_source_img, thumbnailImage=video_source_img)
        new_item.set_xbmc_list_item_obj(xbmcListItem)
        new_items.append(new_item)
    
    return new_items
开发者ID:shauryaanand,项目名称:desimc,代码行数:66,代码来源:Sominal.py

示例13: listMovies

# 需要导入模块: from common.DataObjects import ListItem [as 别名]
# 或者: from common.DataObjects.ListItem import add_moving_data [as 别名]
def listMovies(request_obj, response_obj):
    categoryUrlSuffix = request_obj.get_data()['categoryUrlSuffix']
   
    page = None
    if request_obj.get_data().has_key('page'):
        page = int(request_obj.get_data()['page'])
    
    titles = Container().getAddonContext().cache.cacheFunction(retrieveMovies, categoryUrlSuffix)
    
    count = -1
    start = 0
    current_page = -1
    total_pages = -1
    if len(titles) > TITLES_PER_PAGE:
        count = 0
        current_page = 1
        total_pages = int(len(titles) / TITLES_PER_PAGE)
        if len(titles) % TITLES_PER_PAGE:
            total_pages = total_pages + 1
        if page is not None:
            current_page = int(page)
            start = (current_page - 1) * TITLES_PER_PAGE
    end = start + TITLES_PER_PAGE
    items = []
    for entry in titles:
        if count > -1:
            if count < start:
                count = count + 1
                continue
            elif count >= end:
                break
            else:
                count = count + 1
        titleInfo = entry['info']
        year = ''
                
        movieInfoUrl = entry['link']
        movieLabel = '[B]' + titleInfo + '[/B]' + ('(' + year + ')' + quality if (year != '') else '')
      
        item = ListItem()
        item.add_moving_data('movieTitle', titleInfo)
        item.add_moving_data('movieYear', year)
        item.add_request_data('movieTitle', titleInfo)
        item.add_request_data('movieInfoUrl', movieInfoUrl)
        item.set_next_action_name('Movie_Streams')
        xbmcListItem = xbmcgui.ListItem(label=movieLabel, label2='(' + year + ')')
        item.set_xbmc_list_item_obj(xbmcListItem)
        items.append(item)
        response_obj.addListItem(item)
    
    if current_page > 0 and current_page < total_pages:
        next_page = current_page + 1
        item = ListItem()
        item.add_request_data('page', next_page)
        item.add_request_data('categoryUrlSuffix', request_obj.get_data()['categoryUrlSuffix'])
        item.set_next_action_name('Next_Page')
        xbmcListItem = xbmcgui.ListItem(label='  ---- next page ----  #' + str(next_page) + ' ->')
        item.set_xbmc_list_item_obj(xbmcListItem)
        response_obj.addListItem(item)
    
    response_obj.set_xbmc_content_type('movies')
开发者ID:jigarsavla,项目名称:apple-tv2-xbmc,代码行数:63,代码来源:Einthusan.py


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