Hi,
The SvtPlay plugin needs to be completely rewritten. It has to be implemented as a Web Resource plugin.
It will involve scraping a couple of url:s in succession.
For instance, the player widget for the latest episode of Homeland is loaded at:
[1]
http://www.svt.se/wd?widgetId=55603&sec ... ionId=2636In it, you find two intersesting attributes:
[2] a link to the JSON object which describes the video rtmp urls for different qualities.
This is located in a tag attribute named "data-json-href" The value for this episode is:
/wd?widgetId=55603&sectionId=2636&articleId=547626&p
osition=0&format=json&type=embed&contextSectionId=2636
As you can see, [2] is [1] with an extra "&format=json" request variable.
The contents of [2] is pasted here:
- Code:
{"context":{"title":"Del 5 av 12: Q&A","embedUrl":null,"popoutUrl":"http://www.svt.se/wd?widgetId=55603§ionId=2636&articleId=547626&type=embed&contextSectionId=2636"},"statistics":{"context":"svtse","title":"del-5-av-12-q-och-a","category":"film-och-drama","broadcastTime":"2200","client":"svtse","broadcastDate":"20121105","folderStructure":"homeland.hela-program","programID":"1297329-05","statisticsUrl":"http://ld.svt.se/svt/svt/s?svt-play.film-och-drama.homeland.hela-program.del-5-av-12-q-och-a","mmsCategory":"1","mmsClientNr":"1001001"},"videoId":547626,"video":{"position":0,"live":false,"livestart":null,"availableOnMobile":false,"dvr":false,"livestartUTC":null,"subtitleReferences":[],"materialLength":3235,"videoReferences":[{"url":"rtmp://fl11.c90914.cdn.qbrick.com/90914/_definst_//20121101/FLAX3-HOMELAND2-mp4-b-v1-d9d3ecf0d2d33f36.mp4","bitrate":320,"playerType":"flash"},{"url":"rtmp://fl11.c90914.cdn.qbrick.com/90914/_definst_//20121101/FLAX3-HOMELAND2-mp4-c-v1-d9d3ecf0d2d33f36.mp4","bitrate":850,"playerType":"flash"},{"url":"rtmp://fl11.c90914.cdn.qbrick.com/90914/_definst_//20121101/FLAX3-HOMELAND2-mp4-d-v1-d9d3ecf0d2d33f36.mp4","bitrate":1400,"playerType":"flash"},{"url":"rtmp://fl11.c90914.cdn.qbrick.com/90914/_definst_//20121101/FLAX3-HOMELAND2-mp4-e-v1-d9d3ecf0d2d33f36.mp4","bitrate":2400,"playerType":"flash"}]}}
(this could probably be parsed from one of the flashvars-properties in [1], to avoid an extra http connection roundtrip.)
So, this has the url:s and different bitrates. The quality matching method in the current svtPlay plugin appears to work with these rmtp url:s.
[3] This node in [1] gives the url for the swfPlayer needed to decode the rtmp stream:
- Code:
<param name="movie" value="/statiskt/swf/video/svtplayer-2012.47.swf" />
I got [1] by sniffing my network traffic. Some forensics are needed among the many linked js-files to find out how this url was constructed. But clearly, the "id" of the episode appears to be 547626, and this is found in several tag attributes in the episode page at the svt web. The question is if the widgetid and sectionid need to be in accordance with how the article is categorized in order for the widget delivery to work correctly.
I'll be happy to make a go at implementing this in groovy. Anyone else care to join in? (I could create my first ever open source project!)