Exemplo n.º 1
0
def playVideo(link):
    playlistLink = "http://www.nickjr.com/dynamo/video/data/mrssGen.jhtml?type=network&loc=sidebar&hub=njParentsHub&mode=playlist&mgid=mgid:cms:item:nickjr.com:"
    playlistLink = playlistLink + link
    page = helper.load_page(playlistLink, True)
    media = helper.extractMrss(page)

    player = media[0]['player']
    link = media[0]['url']

    response = urllib.urlopen(urllib.unquote(player))
    mediaPlayer = response.geturl()

    page = helper.load_page(urllib.unquote(link))
    extractRtmpUrls = re.compile(
        "<rendition.*?height=[\"\']+([0-9]*)[\"\']+.*?>[\n\ \t]*<src>(.*?)</src>[\n\ \t]*</rendition>"
    )

    streamUrl = ""
    streamHeight = 0

    for rtmpItem in extractRtmpUrls.finditer(page):
        if rtmpItem.group(1) > streamHeight:
            streamUrl = rtmpItem.group(2)

    streamUrl = streamUrl + " swfUrl=" + mediaPlayer + " swfVfy=1"

    helper.setResolvedUrl(streamUrl)
Exemplo n.º 2
0
def playVideo(link):
    playlistLink = "http://www.nickjr.com/dynamo/video/data/mrssGen.jhtml?type=network&loc=sidebar&hub=njParentsHub&mode=playlist&mgid=mgid:cms:item:nickjr.com:"
    playlistLink = playlistLink+link
    page = helper.load_page(playlistLink,True)
    media = helper.extractMrss(page)
    
    player = media[0]['player']
    link = media[0]['url']

    response = urllib.urlopen(urllib.unquote(player))
    mediaPlayer = response.geturl()
    
    page = helper.load_page(urllib.unquote(link))
    extractRtmpUrls = re.compile("<rendition.*?height=[\"\']+([0-9]*)[\"\']+.*?>[\n\ \t]*<src>(.*?)</src>[\n\ \t]*</rendition>")
    
    streamUrl = ""
    streamHeight = 0
    
    for rtmpItem in extractRtmpUrls.finditer(page):
        if rtmpItem.group(1)>streamHeight:
            streamUrl = rtmpItem.group(2)
    
    streamUrl = streamUrl + " swfUrl=" + mediaPlayer + " swfVfy=1"
    
    helper.setResolvedUrl(streamUrl)
Exemplo n.º 3
0
def showVideos(feedUrl):
    feed = helper.load_page(urllib.unquote(feedUrl))

    media = helper.extractMrss(feed)

    for video in media:
        parameters = {
            "channel": thisChannel,
            "action": "playVideo",
            "link": video['url']
        }
        helper.addDirectoryItem(video['title'],
                                parameters,
                                video['img'],
                                False,
                                duration=video['duration'],
                                plot=video['plot'])

    #Next page
    extractNextPage = re.compile(
        "<atom:link rel=\"next\" href=\"(.*)\" />").search(feed)
    if extractNextPage is not None:
        helper.addDirectoryItem(
            "Show more", {
                "channel": thisChannel,
                "action": "showVideos",
                "link": extractNextPage.group(1)
            }, "")

    helper.endOfDirectory()
Exemplo n.º 4
0
def showVideos(feedUrl):
	feed = helper.load_page(urllib.unquote(feedUrl))
	
	media = helper.extractMrss(feed)

   	for video in media:
   		parameters = {"channel":thisChannel,"action":"playVideo","link":video['url']}
   		helper.addDirectoryItem(video['title'], parameters, video['img'], False, duration=video['duration'], plot=video['plot'])
	
	#Next page
	extractNextPage = re.compile("<atom:link rel=\"next\" href=\"(.*)\" />").search(feed)
	if extractNextPage is not None:
		helper.addDirectoryItem("Show more", {"channel":thisChannel,"action":"showVideos","link":extractNextPage.group(1)}, "")
	
	helper.endOfDirectory()