def playVideo(videoPlayer):
    stream = brightcovePlayer.play(const, playerID, videoPlayer, publisherID, playerKey)
    
    rtmpbase = stream[1][0:stream[1].find("&")]
    playpath = stream[1][stream[1].find("&") + 1:]
    finalurl = rtmpbase + ' playpath=' + playpath
    
    helper.setResolvedUrl(finalurl)
def playVideo(videoPlayer):
    stream = brightcovePlayer.play(const, playerID, videoPlayer, publisherID,
                                   playerKey)

    rtmpbase = stream[1][0:stream[1].find("&")]
    playpath = stream[1][stream[1].find("&") + 1:]
    finalurl = rtmpbase + ' playpath=' + playpath

    helper.setResolvedUrl(finalurl)
Пример #3
0
def playEpisode(videoPlayer):
    brightcove_item = brightcovePlayer.play(const, playerID, str(videoPlayer), publisherID, height, playerKey)
    stream_url = brightcove_item[1]
    rtmpbase = stream_url[0:stream_url.find("&")]
    playpath = stream_url[stream_url.find("&") + 1:]
    
    finalurl = rtmpbase + ' playpath=' + playpath
    
    item = xbmcgui.ListItem(path=finalurl)
    xbmcplugin.setResolvedUrl(thisPlugin, True, item)
Пример #4
0
def playEpisode(videoPlayer):
    brightcove_item = brightcovePlayer.play(const, playerID, str(videoPlayer), publisherID, height)
    stream_url = brightcove_item[1]
    rtmpbase = stream_url[0:stream_url.find("&")]
    playpath = stream_url[stream_url.find("&") + 1:]
    
    finalurl = rtmpbase + ' playpath=' + playpath
        
    item = xbmcgui.ListItem(path=finalurl)
    xbmcplugin.setResolvedUrl(thisPlugin, True, item)
Пример #5
0
def playVideo(link):
    page = helper.load_page(urllib.unquote(link))
    videoPlayer = re.compile("brightcove_mediaId: ([0-9]*),").search(page).group(1)
    stream = brightcovePlayer.play(const, playerID, videoPlayer, publisherID, playerKey)
    
    rtmpbase = stream[1][0:stream[1].find("&")]
    playpath = stream[1][stream[1].find("&") + 1:]
    finalurl = rtmpbase + ' playpath=' + playpath
    
    helper.setResolvedUrl(finalurl)
Пример #6
0
def playLivestream():
    #livestream-profile0
    brightcove_item = brightcovePlayer.play(lsConst, lsPlayerId, 'livestream-profile0', lsPublisherID, height, lsPlayerKey)
    stream_url = brightcove_item[1]
    rtmpbase = stream_url[0:stream_url.find("&")]
    playpath = stream_url[stream_url.find("&") + 1:]
    
    finalurl = rtmpbase + ' playpath=' + playpath
        
    item = xbmcgui.ListItem(path=finalurl)
    xbmcplugin.setResolvedUrl(thisPlugin, True, item)
Пример #7
0
def playVideo(link):
    page = load_page(urllib.unquote(link))
    videoPlayer = re.compile("brightcove_mediaId: ([0-9]*),").search(page).group(1)
    stream = brightcovePlayer.play(videoPlayer)
    
    rtmpbase = stream[1][0:stream[1].find("&")]
    playpath = stream[1][stream[1].find("&") + 1:]
    finalurl = rtmpbase + ' playpath=' + playpath
    
    item = xbmcgui.ListItem(stream[0], path=finalurl)
    xbmcplugin.setResolvedUrl(thisPlugin, True, item)
Пример #8
0
def playVideo(link):
    page = helper.load_page(urllib.unquote(link))
    videoPlayer = (
        re.compile('<input type="hidden" name="asset-id" value="([0-9]*)" id="asset-id" />').search(page).group(1)
    )
    stream = brightcovePlayer.play(const, playerID, videoPlayer, publisherID, playerKey)

    rtmpbase = stream[1][0 : stream[1].find("&")]
    playpath = stream[1][stream[1].find("&") + 1 :]
    finalurl = rtmpbase + " playpath=" + playpath

    helper.setResolvedUrl(finalurl)
Пример #9
0
def playVideo(link):
    page = helper.load_page(urllib.unquote(link))
    videoPlayer = re.compile(
        "<input type=\"hidden\" name=\"asset-id\" value=\"([0-9]*)\" id=\"asset-id\" />"
    ).search(page).group(1)
    stream = brightcovePlayer.play(const, playerID, videoPlayer, publisherID,
                                   playerKey)

    rtmpbase = stream[1][0:stream[1].find("&")]
    playpath = stream[1][stream[1].find("&") + 1:]
    finalurl = rtmpbase + ' playpath=' + playpath

    helper.setResolvedUrl(finalurl)
Пример #10
0
def playVideo(videoPlayer):
	stream = brightcovePlayer.play(const, playerID, videoPlayer, publisherID, playerKey)
	
	if stream[1][0:5] == "http:":
		finalurl = stream[1]
	else:
		rtmpbase = stream[1][0:stream[1].find("&")]
		rtmpbase = rtmpbase + stream[1][stream[1].find("?"):]
		playpath = stream[1][stream[1].find("&") + 1:]
		finalurl = rtmpbase + ' playpath=' + playpath
	
	item = xbmcgui.ListItem(path=finalurl)
	xbmcplugin.setResolvedUrl(thisPlugin, True, item)
def playVideo(link):
    #print 'playVideo'
    ulink = urllib.unquote(link)
    data = cache.cacheFunction(getURL, ulink)
    if not data:
        xbmcplugin.setResolvedUrl(thisPlugin, False, xbmcgui.ListItem())
        return
    page = data['html']
    #page = load_page(ulink)
    contentIds = common.parseDOM(page, "param", {"name": "@videoPlayer"}, ret="value")
    if not contentIds:
        #xbmcplugin.setResolvedUrl(thisPlugin, False, xbmcgui.ListItem())
        node_article = common.parseDOM(page, "div", {"class": "node_article"})[0]
        videolinks = hosts.resolve(node_article)
        if videolinks:
            videolink = videolinks[0]
            xbmcplugin.setResolvedUrl(thisPlugin, True, xbmcgui.ListItem(path=videolink))
        return
    #videoPlayer = re.compile("brightcove_mediaId: ([0-9]*),").search(page).group(1)
    
    #splits = ulink.rsplit('/', 1)
    #contentId = int(splits[1])
    stacked_url = 'stack://'
    for contentId in contentIds:
        contentId = int(contentId)
        stream = brightcovePlayer.play(contentId, ulink)
    
        rtmpbase = stream[1][0:stream[1].find("&")]
        finalurl = None
        if not 'edgefcs.net' in rtmpbase:
            playpath = stream[1][stream[1].find("&") + 1:]
            finalurl = rtmpbase + ' playpath=' + playpath
        else:
            postfix = stream[1][stream[1].find("?") :]
            postfix2 = "&videoId=" + str(contentId) + "&lineUpId=&pubId=616302933001&playerId=798983031001&affiliateId="
            app = "ondemand" + postfix + postfix2
        
            swfUrl = "http://admin.brightcove.com/viewer/us20120711.1450/federatedVideoUI/BrightcovePlayer.swf?uid=42300475817"
        
            pageUrl = ulink
        
            playpath = stream[1][stream[1].find("&") + 1:] + postfix2
            finalurl = rtmpbase + " app=" + app + " swfUrl=" + swfUrl + " pageUrl=" + pageUrl + " playpath=" + playpath
            
        if finalurl:
            stacked_url += finalurl.replace(',',',,')+' , '
    
    stacked_url = stacked_url[:-3]
    item = xbmcgui.ListItem(stream[0], path=stacked_url)
    xbmcplugin.setResolvedUrl(thisPlugin, True, item)
Пример #12
0
def playVideo(link):
    page = helper.load_page(baseLink + urllib.unquote(link))

    extractYouTubeId = re.compile('<div data-youtube="(.*?)" id="yt_video">')

    youTubeInfo = extractYouTubeId.search(page)

    if youTubeInfo is not None:
        youTubeId = youTubeInfo.group(1)
        streamUrl = "plugin://plugin.video.youtube/?action=play_video&videoid=" + youTubeId
        helper.setResolvedUrl(streamUrl)
    else:
        const = "07e6acedf6c0f426a377e5b3ba077229e6e826f9"
        publisherID = "1521649306001"

        extractVideo = re.compile(
            '<param name="playerID" value="([0-9]*)".*?name="playerKey" value="(.*?)".*name="@videoPlayer" value="([0-9]*)"'
        )

        video = extractVideo.search(page)
        playerID = video.group(1)
        playerKey = video.group(2)
        videoPlayer = video.group(3)

        stream = brightcovePlayer.play(const, playerID, videoPlayer, publisherID, playerKey)

        vidStr = (
            "?videoId=" + videoPlayer + "&lineUpId=&pubId=" + publisherID + "&playerId=" + playerID + "&affiliateId="
        )

        rtmpbase = stream[1][0 : stream[1].find("&")]
        conn = stream[1][stream[1].find("&") + 1 :]
        playpath = conn[0 : conn.find("&")] + vidStr
        app = rtmpbase[rtmpbase.find("/", 7) + 1 : -1] + vidStr

        finalurl = rtmpbase + " playpath=" + playpath + " conn=B:0 conn=S:" + conn + " app=" + app

        helper.setResolvedUrl(finalurl)
Пример #13
0
def playVideo(link):
    page = helper.load_page(baseLink + urllib.unquote(link))

    extractYouTubeId = re.compile(
        "<div data-youtube=\"(.*?)\" id=\"yt_video\">")

    youTubeInfo = extractYouTubeId.search(page)

    if youTubeInfo is not None:
        youTubeId = youTubeInfo.group(1)
        streamUrl = "plugin://plugin.video.youtube/?action=play_video&videoid=" + youTubeId
        helper.setResolvedUrl(streamUrl)
    else:
        const = "07e6acedf6c0f426a377e5b3ba077229e6e826f9"
        publisherID = "1521649306001"

        extractVideo = re.compile(
            "<param name=\"playerID\" value=\"([0-9]*)\".*?name=\"playerKey\" value=\"(.*?)\".*name=\"@videoPlayer\" value=\"([0-9]*)\""
        )

        video = extractVideo.search(page)
        playerID = video.group(1)
        playerKey = video.group(2)
        videoPlayer = video.group(3)

        stream = brightcovePlayer.play(const, playerID, videoPlayer,
                                       publisherID, playerKey)

        vidStr = "?videoId=" + videoPlayer + "&lineUpId=&pubId=" + publisherID + "&playerId=" + playerID + "&affiliateId="

        rtmpbase = stream[1][0:stream[1].find("&")]
        conn = stream[1][stream[1].find("&") + 1:]
        playpath = conn[0:conn.find("&")] + vidStr
        app = rtmpbase[rtmpbase.find("/", 7) + 1:-1] + vidStr

        finalurl = rtmpbase + ' playpath=' + playpath + " conn=B:0 conn=S:" + conn + " app=" + app

        helper.setResolvedUrl(finalurl)