Download BrightCove videos (tutorial)

Update:  The download method described in my original post no longer works.  It looks like they've updated their delivery system to incorporate additional security measures.  Fortunately, there's an easier rtmpdump method that still works:

0.  if you don't already have it, install the rtmpdump suite:

sudo apt-get install rtmpdump
1. open a terminal and become root:
sudo su - root
2. create a firewall rule to temporarily redirect TCP traffic to a custom port:
iptables -t nat -A OUTPUT -p tcp --dport 1935 -m owner \! --uid-owner root -j REDIRECT
3. run a (cleverly named) companion program in the rtmpdump package that sniffs traffic for streaming video
4. minimize the root terminal window and then open (or refresh) the video page in your browser and play the video

5. bring up the root terminal window and when it says "Closing connection... done!" (or the video finishes playing) press Ctrl+C to stop rtmpsuck

6. the video will have been saved in the root user's home directory; move it to tmp (note: if the source video is flv, swf, etc. you will need to change the extension in the command below)
mv ~/*.mp4 /tmp
7. delete the temporary firewall rule
iptables -t nat -D OUTPUT -p tcp --dport 1935 -m owner \! --uid-owner root -j REDIRECT
8. close the root terminal window and enjoy your video!

P.S. This works for other video sites as well, such as News and Sports broadcasts.


Legacy (non-working) instructions for reference:

KeepVid makes it super easy to download videos from Youtube, Dailymotion, Metacafe, and iFilm, but it doesn't support BrightCove.

Most BrightCove flash-based videos have an HTML5 (iPad/iPhone) alternate so the process is a little technical but relatively easy to do.  But what if you follow those instructions and no HTML5 video appears?  Well, that means there is no HTML5 alternate.  In that case, the process gets a little harder but not impossible:

1.  Install rtmpdump: sudo apt-get install rtmpdump
2.  In Chrome, press F12 to open the browser developer tools and click on the Network tab
3.  Start playing the video and look for entries in the Network list that start with 9.gif?a=
4.  Click on one and view the Headers and it should look something like this (color-coded to highlight important info):;%20Linux%20x86_64)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Ubuntu%20Chromium/30.0.1599.114%20Chrome/30.0.1599.114%20Safari/537.36~aj=11,2,202,310~ak=Flash_PlugIn~am=D~an=309~ao=607~ap=916~ar=0~at=Chrome%2030~au=1425*469~aw=rtmp://,0,0,0~fh=0,0,0,0~fi=8317000:0:5169::1~fj=8317000:5169~fl=42990573000:5169

5. Stop the video playing in the browser
6.  Open a command prompt and craft a rtmpdump command like:

rtmpdump -r "rtmp://" -y "mp4:66852713001/66852713001_2008369076001_2007-04-004-the-district-2-episode-1-8000k-eng.mp4" -a "ondemand?auth=daEbuc0awbycaa1bTbaaxcucucxdqcdavbh-bsJdpa-bWG-knzAtqvy_yDyr_umE_AEvA_GsD&aifp=bcosldsuds&slist=66852713001/" -o my_downloaded_video.mp4

That should connect to the video server and begin downloading the file!

Once done, feel free to create a DVD


j8048188 said...

Does this method still work? I get a couple errors, even when trying the string you have as an example.

Mr. Blue Coat said...

I've updated my instructions with a working method. Thanks!

darthmarcos2007 said...

Would there be any chance you know the windows equivalent of step 2. "create a firewall rule to temporarily redirect TCP traffic to a custom port"?

Mr. Blue Coat said...

Sorry @darthmarcos2007, I moved on from Windows years ago. Perhaps you can try the freeware "Tcp Port Forwarding" tool from Nsauditor:

darthmarcos2007 said...

thanks for the link to the port forwarding tool. unfortunately networking is not my strongest skill... what is the linux firewall rule doing exactly? I can only see one port being referenced (1935).

Mr. Blue Coat said...

Try setting "port to listen" as 80

Loki said...

Thanks. You're a legend.

Better Grown said...

I use the following method to download Brightcove videos

Post a Comment

Keep it clean and professional...