View Full Version : challenge: Mediaset Video plugin
l.capriotti
2008-12-03, 12:36
Anyone able to find the way to write a plugin for the italian mediaset video site (http://www.video.mediaset.it)?
I tried some basic tests but I was not able to have a working schema nor to receive any valid video streams :(
Any help appreciated!
Hi,
I looked very quickly to the website you have mentionned, and I think I found information which could be useful for writing your script.
Uing http header (add on firefox) I found those XML:
- Liste of video :
http://www.video.mediaset.it/vedianche/intrattenimento.xml?_=1228312463454&classname=intrattenimento
You can see entries like:
<video-summary id="scherziaparte/2007/07/20/108">
<image>bin/10.$plit/C_5_video_25284_stopframe.jpg</image>
<title>Senti chi parla</title>
<program>Scherzi a Parte</program>
<description>Scherzi a Parte</description>
<date>20/07/2007</date>
<visto>1489</visto>
<network-logo/>
</video-summary>
−
And one xml for a s[ecific video which includes video links:
http://www.video.mediaset.it/video/uominiedonne/2008/12/02/651/video.sxml?_=1228312463129&videoId=uominiedonne%2F2008%2F12%2F02%2F651
So if I use the entry above: scherziaparte/2007/07/20/108 and mix it with the video URL, I get the xml URL:
http://www.video.mediaset.it/video/scherziaparte/2007/07/20/108/video.sxml?_=1228312463129
<video id="scherziaparte/2007/07/20/108" code="25284">
<thumbnail>bin/10.$plit/C_5_video_25284_stopframe.jpg</thumbnail>
−
<urls>
<url type="wmv">scherziaparte/2007/07/Scherzi_GiadaDeblank2.wmv</url>
<url type="flv"/>
</urls>
<title>Senti chi parla</title>
<date>20/07/2007</date>
−
<description>
Un macchinario avveneristico per leggere il pensiero
</description>
−
<category ads="true" area="intrattenimento" classname="intrattenimento" id="scherziaparte/2007/scherzi">
<airtime/>
<program-logo>/bin/54.$plit/C_5_aggregazione_38_grafica_logo.gif</program-logo>
<program-link/>
<network-logo>/img/logo_network_canale5.png</network-logo>
</category>
<visto>1517</visto>
<rating stars="5" voti="6"/>
</video>
Here it is, the video URL is in it!:grin:
I think it is a good starting point, I hope it help.
l.capriotti
2008-12-03, 20:22
maybe I got it wrong, but I can't stream the video with the URL built as instructed.
Did you try to open the video streams (wmv or flv)?
for example:
http://www.video.mediaset.it/video/scherziaparte/2007/07/Scherzi_GiadaDeblank2.wmv
is not is video stream!
Yes you're right, I tried and it doesn't work.
You have to dig and look what are the request sent using http header for instance.
The issue could be also the use of cookie which return differene thing depending on what is defined in the cookie.
Sorry I cannot spent too much time on it right know, I will try to see if I can figure it out.
Just olling the answer from the server on:
http://www.video.mediaset.it/video/scherziaparte/2007/07/Scherzi_GiadaDeblank2.wmv
http://www.video.mediaset.it/video/scherziaparte/2007/07/Scherzi_GiadaDeblank2.wmv
GET /video/scherziaparte/2007/07/Scherzi_GiadaDeblank2.wmv HTTP/1.1
Host: www.video.mediaset.it
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
HTTP/1.x 404 Not Found
Date: Wed, 03 Dec 2008 18:33:40 GMT
Server: Apache
Accept-Ranges: bytes
Content-Length: 115
Keep-Alive: timeout=5, max=1000
Connection: Keep-Alive
Content-Type: text/html
So it seems the URL is wrong, it could be the base path since in the XML we only have:
scherziaparte/2007/07/Scherzi_GiadaDeblank2.wmv
Perhaps http://www.video.mediaset.it/video/ is not valid for video path ...
rwparris2
2008-12-03, 23:36
if there is no FLV link use: mms://mediaset.wmod.llnwd.net/a2695/e1/[wmvurl]
ex. mms://mediaset.wmod.llnwd.net/a2695/e1/scherziaparte/2007/07/Scherzi_GiadaDeblank2.wmv
if there is a FLV link, it gets kinda weird. the base url is:
rtmp://217.169.112.25:80/vod/
but then the actual video url is different than what is listed on the XML page.
ex.
mediasetestero/2008/12/nipV_14_darlene.flv
mediaset_admediasetestero_2008_12_nipV_14_darlene. flv
have fun and good luck :)
@rwparris2
Well done :), I wasn't able to find those damn URLs.
May I asked how you find it? It would help me to improved my investigation technique. Nothing came throw the header, how did you get those? ???
@l.capriotti
I think you have the minimum for starting now, good luck! :D
rwparris2
2008-12-04, 07:02
firebug for firefox & orbit downloader
l.capriotti
2008-12-04, 09:56
tks you all, much appreciated!
rwparris2
2008-12-04, 10:04
No problem.
And to be honest, I probably wouldn't have ever looked at this if it weren't for the challenge in the title
If you need anymore help, let us know.
l.capriotti
2008-12-04, 20:36
I do, can you speculate a little bit on the FLV video URL? I did not get the point...
rwparris2
2008-12-05, 09:08
The point I was trying to make is I could figure out FLV when I was looking at it before... the url provided in the xml with the video details is different from the url firefox said I was playing. AND if a FLV link was provided in said xml page, the actual wmv is different than what is provided as well.
In other words, if only the wmv filename is provided, the method I posted earlier works.
If both or only flv is provided it doesn't.
Also I only looked at 3-4 videos, but it seemed the FLV links were only present for the shorter clips, and wmv were for full length episodes. Maybe my sample size was too small.
I'll try to remember to look at it more next week when I have time.
Hello chaps, thought i`d join in.
Categories:-
http://www.video.mediaset.it/category/categories.sxml?_=1228660611751
Open this:
http://www.video.mediaset.it/video/scherziaparte/2007/07/20/108/video.sxml?_=1228312463129
then scrape :
<url type="wmv">scherziaparte/2007/07/Scherzi_GiadaDeblank2.wmv</url>
Then add that after stream=scherziaparte/2007/07/Scherzi_GiadaDeblank2.wmv%20HTTP/1.1
http://cdnselector.xuniplay.fdnames.com/getCDN.aspx?stream=here%20HTTP/1.1
see:-
http://cdnselector.xuniplay.fdnames.com/getCDN.aspx?stream=scherziaparte/2007/07/Scherzi_GiadaDeblank2.wmv%20HTTP/1.1
And we resolve the stream.
works for flv and wmv & they work.
rwparris2
2008-12-07, 17:18
& how did you come up with that last bit?
the http://cdnselector.xuniplay.fdnames.com/getCDN.aspx?stream=scherziaparte/2007/07/Scherzi_GiadaDeblank2.wmv%20HTTP/1.1 part.
Wireshark?
Wireshark and trawling through the Get requests.
Good job! I was looking for this damn base url but wasn't able to find it.
l.capriotti
2008-12-09, 11:23
tnk you all, I will try and find seconds here and there and come up with something.
hi, I was looking into developing a plugin for mediaset but I'm stucked with the xml parsing part. So far I've parsed categories.sxml but when I get the showlist I need to jump right into the category section with the selected showid.
Example:
I select the category "Intrattenimento" <group title="Intrattenimento"> and afterwards I parse all the shows in that group. Now I choose the show "Le Iene". Here comes the problem: how can I jump to this section in the xml-file?
<category title="Le Iene" logo="/bin/50.$plit/C_5_aggregazione_12_logo_category.gif" id="iene" search="true" link="http://www.iene.mediaset.it/">
<category title="Ultimi arrivi" id="iene/2009_2010" search="true"/>
<category title="Puntate" id="iene/2009_2010/puntata" search="true"/>
<category title="Interviste" id="iene/2009_2010/puntata/interviste" search="true"/>
<category title="Inediti" id="iene/2009_2010/inediti" search="true"/>
<category title="Speciali" id="iene/2009_2010/speciali" search="true"/>
<category title="Edizione 2008/2009" id="iene/2008_2009" search="true"/>
<category title="Edizione 2007/2008" id="iene/2007_2008" search="true"/>
...
</category>
There is a thread in this forum with my problem, but now I've found this thread and I have to post it here to.
I've found the solution to my problem:
root.xpath('.//category[@id="iene"]')
Now my problem is how to import the lxml library in the plugin. I have the script running on a normal python install, but I don't know how to use it with the xbmc python interpreter.
Thanks
kimx