
05-25-2010, 03:28 AM
|
any user of the forum who preferred to post anonymously
|
|
Join Date: Aug 2011
Location: Server of stream-recorder.com
Posts: 211
|
|
 Re: Need help recording bbc.co.uk show...
http://beebhack.wikia.com/wiki/IPhone_H.264_version:
Quote:
On the 7th of March 2008 the BBC launched an iPhone compatible version of their web-based iPlayer service. Visitors to iPlayer site using an iPhone would be presented with a slightly tweaked interface, but crucially where users of the site using a desktop web browser, iPhone users would see an embedded Quicktime player streaming H.264 video (referred to on iPlayer as MP4) over a normal HTTP protocol. This is the current method used by download scripts.
Overview of video request process
The process for requesting the H.264 video is as follows: - Video page is requested and a "BBC-UID" cookie is set, containing the URL-encoded User-Agent string of the browser.
- Find a version PID for the episode PID from
Code:
http://www.bbc.co.uk/iplayer/playlist/
. This is found in the form of
Code:
<item kind="programme" duration="[duration]" identifier="[version PID]" ...
- Request
Code:
http://www.bbc.co.uk/mediaselector/3/auth/iplayer_streaming_http_mp4/[PID]?[RAND]
where [PID] is the programme version ID and [RAND] is a random number, although the random number is apparently unused by the service. This URL (and all subsequent requests) must have: - The Quicktime User-Agent header: "Apple iPhone v1.1.1 CoreMedia v1.0.0.3A110a"
- The BBC-UID cookie
- A "Range" header of "0-1"
- "Accept" header of "*/*"
- The video URL then 302 redirects to a much more complex URL . Store this URL.
- Initially, request this URL with "Range" of "bytes=0-1" to get the "Content-Range" header back containing the full byte length of the video.
- Step through the video length using the "Range" header from zero (or from the existing size of a partially downloaded file) in steps of under 70MB until the download is finished, appending to a file with a .mp4 extension.
The finished file should be a playable, unencrypted video.
Alternative Method
Follow the above steps replacing steps 3 and 4 as follows:
3. Request
Code:
http://www.bbc.co.uk/mediaselector/4/mtis/stream/[version PID]
where [version PID].
4. In the resulting XML find the media element that contains the attribute
Code:
service="iplayer_streaming_http_mp4"
then find the href attribute of the connection child element. The is the URL. e.g.
Code:
<media kind="video"
width="480"
height="272"
expires="2010-01-01T22:59:00+00:00"
bitrate="516"
service="iplayer_streaming_http_mp4"
type="video/mp4"
encoding="h264" >
<connection
priority="2"
kind="securesis"
server="http://download.iplayer.bbc.co.uk/"
identifier="iplayer_streaming_http_mp4/5421531205075963289"
authString="iVXZx55%2FTNMmb1BzHh0nO6835iCiAPOU6K2ofDUx9limC26%2Bqowh8666zL5G9U7neJxvdfGgSRuU%0A%2F86r%2BxAGs4sbRmkZclq9%2F9h%2B3brWmr6fsuKhi4DosbXOUg59b%2FGGNBdQKl0%3D%0A"
href="http://download.iplayer.bbc.co.uk/iplayer_streaming_http_mp4/5421531205075963289.mp4?token=iVXZx55%2FTNMmb1BzHh0nO6835iCiAPOU6K2ofDUx9limC26%2Bqowh8666zL5G9U7neJxvdfGgSRuU%0A%2F86r%2BxAGs4sbRmkZclq9%2F9h%2B3brWmr6fsuKhi4DosbXOUg59b%2FGGNBdQKl0%3D%0A&pid=b00pm1h6"
/>
</media>
Example HTTP headers sent by an iPhone session
Code:
GET www.bbc.co.uk/mediaselector/3/auth/iplayer_streaming_http_mp4/b009gbsn HTTP/1.1
Accept: */*
Cookie: BBC-UID=74a79c638cbe4c2d416e453f70f0dcf063d0b78d20c0c1d4843ffaaf85b17c9c0Mozilla%2f5%2e0%20%28iPhone%3b%20U%3b%20CPU%20like%20Mac%20OS%20X%3b%20en%29%20AppleWebKit%2f420%2e1%20%28KHTML%2c%20like%20Gecko%29%20Version%2f3%2e0%20Mobile%2f4A93%20Safari%2f419%2e3
User-Agent: Apple iPhone v1.1.4 CoreMedia v1.0.0.4A102
Connection: close
Range: bytes=0-1
Host: www.bbc.co.uk
This is then followed by a redirect response and the client creates another request to the actual media location:
Code:
GET download.iplayer.bbc.co.uk/iplayer_streaming_http_mp4/120535810311891748.mp4?token=iVXfwJl4SNsma1ByHhlxO%2FVjsCCjA%2FSSsqr6KzU2p1ymDTC%2Bq94kpfjpz%2BlMpki3epI%2BcfHySRmU%0Aos7y%2BxQGsdNDF2UeI124qoN%2F3b7QmLqZtOuii4bpt7jOVQp7b%2BbFKVM%3D%0A HTTP/1.1
Cookie: BBC-UID=74a79c638cbe4c2d416e453f70f0dcf063d0b78d20c0c1d4843ffaaf85b17c9c0;
User-Agent: Apple iPhone v1.1.4 CoreMedia v1.0.0.4A102
Connection: close
Host: download.iplayer.bbc.co.uk
Range: bytes=0-
Timeline of BBC updates to iPhone interface
This seems to have stabilized and the current method of requesting video is at the top of the page.
View the page history for this section if you want to see all the fun hoops the BBC made us jump through for a while.
Various methods for downloading from iPlayer have been developed, including get_iplayer which has versions for Windows 95/98/ME/XP, Linux/Unix, and Mac OSX.
As of March 10 2010, get_iplayer has been withdrawn and is no longer available on the linuxcentre.net website. It has been forked here: http://github.com/jjl/get_iplayer
|
http://www.google.com/search?q=bbcmedia.fcod.llnwd.net/a1414/e3/
|