May 10, 2011

SBS Downloader in Python

Filed under: Technical — Tags: , , , — James Bunton @ 11:33 pm

Update: See WebDL

Just wrote a simple downloader script for SBS’s website. The SBS Player interface is all in flash and is very hard to use on my TV, so this script lets me download the stuff I’m interested in and play it however/whenever I want.

It has a simple command line interface and requires that you already have rtmpdump on your path. Get the sbs-downloader script here.

Usage example:

$ sbs-downloader
10) Documentary
41) mY generation
0) Back
Choose> 10
1) Designer People Ep 11 - Young Baek Min
2) Designer People Ep 12
3) Destination Australia - A Family Divided Full Ep
4) Empire of the Seas Ep 4
5) Gaddafi - Our Best Enemy Full Ep
0) Back
Choose> 3 5
RTMPDump v2.3
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Connecting ...
INFO: Connected...
Starting download at: 0.000 kB

The bolded parts are what you type. Note that you can go back on any screen by typing “0”. Also at the list of episodes you can download a single episode by typing one number, or multiple episodes by typing several numbers separated by spaces.


Gavin says:

I just tried your script on opensuse 11.4 and it works a treat. I’m stuck with an older machine with insufficient ram and am on adsl 1 with my exchange. Playback of sbs was always annoyingly choppy as a result, plus my browser usually maxed out my resources in the process. Now I can watch with mplayer or vlc with no trouble! Thanks for your work. Gavin

Komang says:

Thanks for the script. I had to struggle a bit because I have no idea about scripting or programming. But I googled “how to make executable python script” and I did a lot of guessing work but it works. For those who don’t know what to do from the start, like me, here is what I did:

1. Make sure that Python and rtmpdump is installed. I checked it in Synaptic Package Manager. Both were installed. I use Joli operating system.

2. Copy and Paste the sbs-downloader script mentioned in the article, into a text editor program such as gedit or GVim. In that script, on the first line, make sure the location of your python is correct for your system. Mine is usr/bin/python I found this by typing ‘which python’ command in terminal. Save the text as into a directory. Note the directory location.

3. In root terminal, change to directory where the was saved. Then, type in this command: chmod +x Press enter. This will make the file executable (it is a working program now)

4. Double click the file… That’s it… the sbs-downloader is now working.

Question to the author: What command should I use to Resume the download of a partly downloaded file that was interrupted ? Thanks in advance for your help.

Comments are closed.