The ubiquitous maximize button on Flash video players is missing on a certain URL of interest to me. You can only watch it at 325×198 px (it’s actually almost twice those dimensions). This has forced — and I do mean forced — me to rummage through the page and find a way to download the content so I can view it at a normal size.
I started with the usual “inspect element” routine, and discovered that the media is streamed via rtmp. This requires an Intermediate Internet Forensics Kit to untangle:
- a way to decode the flashvars variable that is passed by the browser to Flash
- a tool to download the RTMP stream
- a way to play the downloaded file
$ curl "http://sharks.nhl.com/club/gamevideo.htm?id=2011020365" | grep jsonString
rtmp:\/\/flash.onthefly.nhl.com\/ondemand\/NHLHighlights\/mp4:20112012\/02\/0365\/2_365_mtl_sjs_1112_h_continuous_1600K_16x9_1.mp4
Well that is some hideous gibberish, way too many escape sequences. Pipe it through sed 's/\\//g' to get rid of the backslashes. Then it’ll be easy to pick it apart:
- the host part:
flash.onthefly.nhl.com - the “app”, which is the first two URL path segments:
ondemand/NHLHighlights - the filename, in this case
2_3w65_mtl_sjs_1112_h_continuous_1600K_16x9_1.mp4
OK so now we are ready to download! All you need to do is string all the details together, along with the URL of the swf file which is required for some wort of authentication token, like this:
$ rtmpdump -r rtmp://flash.onthefly.nhl.com -o sharks-habs-hilites.flv \
−−swfVfy "http://www.nhl.com/swf/DynamicLeadThreeColumn.swf?v=5.7" \
--app ondemand/NHLHighlights --playpath \
mp4:20112012/02/0365/2_365_mtl_sjs_1112_h_continuous_800K_16x9_1.mp4
The -o option specifies the output file (don’t be mislead by their use of .mp4 for a Flash video stream) and now you can open it in anything that can play an FLV, Movist or VLC will do fine.
Final note to the folks at the NHL: I know you went to trouble to try and keep people from downloading, um, game highlights? Question for you: if there had been a maximize button on your player, would I have bothered with all this?


