I’m working on a plugin for http://www.tou.tv (a French Canadian webtv site)…
So far, everything is working (I am able to retrieve the show list, the episodes etc…), but when I get to the part where the video should be playing, I’m only getting sound and a black screen!
Here’s the relevant part of code (GetEmissionList retrieves the list of episodes for a serie, GetVideo delivers the actual video)
<br />
def GetEmissionsList(sender, url):<br />
dir = MediaContainer(title2=sender.itemTitle)<br />
page = XML.ElementFromURL(url, True)<br />
for item in page.xpath('//div[@class="blocepisodeemission"]'):<br />
try:<br />
saison = item.xpath('.//p[@class="saison"]')[0].text<br />
episodeurl = item.xpath('.//a[@class="episode"]')[0].get('href')<br />
title = saison + ": " + item.xpath('.//a[@class="episode"]/b')[0].text<br />
dir.Append(Function(WebVideoItem(GetVideo, title=title), url=TOUTV_URL + episodeurl))<br />
except IndexError:<br />
continue<br />
return dir<br />
<br />
<br />
def GetVideo(sender, url):<br />
# first, try to find the episode id!<br />
page = HTTP.Request(url)<br />
clip = re.search("\"pid\":\"([^\"]+)\"", page).group(1)<br />
# request the info from ThePlatform...<br />
platformurl = "http://release.theplatform.com/content.select?pid=" + clip<br />
platformpage = XML.ElementFromURL(platformurl, True).xpath('//playlist/choice/url')[0]<br />
# split the url so we have the media url in [0] and the clip in [1]<br />
platforminfo = platformpage.text.split("<break>")<br />
return Redirect(RTMPVideoItem(platforminfo[0], clip=platforminfo[1], width=852, height=480))<br />
Am I doing anything wrong? Considering the sound is working, I know I am parsing the URL correctly etc... I just can't get the video to work!
I have no idea if it's relevant, but the video should be an mp4... (the "clip" parameter looks like this: mp4:002/MOV/HR/2010-08-24_BEAUTES_0134_hr.mov)
Any help would be appreciated!
