A beautiful video clip by Laura Bradford of my piece Urban Bloom. It is pretty high quality so you can watch it full screen.
video
how to download a facebook video using wget
Saturday, February 25th, 2012In this post I will show you how to go about downloading a video from facebook. It won’t involve putting the URL in some video downloader. You will use wget and the browser to download the video.
Background:
A few weeks I wrote a post on getting tracks from bandcamp as a learning exercise for exploring a web page with the javascript console.
This post will follow along similar lines, but in this case it also highlights the value of learning a little bit of programming. Currently there is no option to download a video posted on facebook. You can download a photo, but not a video you are tagged in. This became important to me recently because I wanted to pull some videos people took of some artwork I made. Knowing a little bit of code helped me figure out how the video is being displayed and eventually download it. I think it is kind of a political thing too- the video is provides some value for facebook, why they would make it difficult to download I dont know, but I do know that it confines personal data my friends have shared with me that I want to liberate and use for myself.
And I also think this is a pretty awesome example of something cool you can do knowing a little code, or rather, a bit about the Terminal and the Browser.
Now get that video
I’m going to be doing this using the Chrome browser and Terminal for mac. You should be able to do this on Windows or Linux machines, or with Firefox or Safari.
Open up Terminal. You can find it under /Applications/Utilities/Terminal.app
Get wget. I use Homebrew, so I just wrote
brew install wget
You can also download it online.
Now open up your browser and go to the video you want. If you right click it to download, you’ll get something like this.
So you can’t get to it that way. Pause the video. We’re going to play it again, but now find the stream url for the video. This is the url sent to your browser which contains the video.
Instead we’ll observe the network traffic. In Chrome open up the developer tools. It is at View-> Developer -> Developer Tools, or just command-option-i. Click the network tab. Push play on the video. You should see a lot of activity. Find the one that ends in “.mp4″. For me it is at the top. In Safari you can open up the Activity Monitor, under Window-> Activity. You are looking for the URL that begins with “http://video.ak.fbcdn.net/…”
This URL is the one that contains the video. Right click it, and copy the link address. It is a really long address. Move over to Terminal. Now we’ll download it. type the following, replacing the italics with the appropriate content. movie_title is whatever you want to save the movie file as, and in the quotes is the URL we found above.
wget -O movie_title “paste-url-here“
Hit enter and you’ll see the movie being downloaded.
And thats it! The movie is yours.
I searched a bit online to find a nice tool, and some required the videos to be public, or seemed a bit clunky. This way was a bit fun because I could dig into the facebook code a little bit, and after I finished I realized it felt really satisfying. While it wasn’t necessarily programming, it was getting something I wanted with some tools I regularly use while programming on the web, and I figured a great way to get people interested in command line tools or looking under the hood of internet traffic in the browser.
Makin’ Synths: Clips of the breadboard synth and bottle synth
Thursday, December 15th, 2011I’ve been getting into making synths. Here’s a couple. The first is of three square wave oscillators mixed with diodes. The second is the bottle synth I made for the p.irateship synth-in (i.e. music hackathon) . yea!


