Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Ubuntu 11.10 & want to download Stanford Open Classroom videos..basically for offline viewing,


thanx in advance

share|improve this question

Use Firefox with Video DownloadHelper addon.

share|improve this answer
  1. Copy the following code in a new document and save it in a new directory as

    #!/usr/bin/env python
    import urllib
    from BeautifulSoup import BeautifulSoup
    COURSE_URL = ''
    def download_video(video_name):
        course_name = COURSE_URL.split('course=')[1]
        request = urllib.urlopen(''\
        response =
        flv_name = response.split('<videoFile>')[1].split('</videoFile>')[0]
        print 'Downloading: %s' % flv_name
                           '{0}/videos/{1}'.format(course_name, flv_name),
    def main():
        request = urllib.urlopen(COURSE_URL)
        response =
        soup = BeautifulSoup(response)
        results = soup.findAll('div', {'class': 'results-list'})
        for result in results:
            lists = result.findAll('li')
            for li in lists:
                urls = li.findAll('a')
                for url in urls:
                    video_name = str(url).split('video=')[1].split('&')[0]
    if __name__ == '__main__':
  2. Open a new terminal (press Alt+F2 and enter 'terminal') and make sure you have the python-beautifulsoup package installed by entering:

    sudo apt-get install python-beautifulsoup
  3. Navigate to the directory where the file is located (using the 'cd' command).

  4. Run the file using the python command:

  5. Wait until all the video files are downloaded. They should appear in the same directory where the file is located.

  6. If you want to download other course, you would have to change the 'COURSE_URL' variable in the file with the URL address of the course you want to download.

share|improve this answer
I parallelized this to download 10 videos at a time, and changed it to ask for a directory to save in and to ask for the course url. See here: – mdenton8 Mar 26 '15 at 21:26
I wrote another one and now see your post. Mine works on python 3.5 and is very simple and similar to yours – Almog Cohen Feb 5 at 17:22

This works for me:

sudo apt-get install youtube-dl
youtube-dl 'SOMEURL'


youtube-dl '' 
share|improve this answer

I just wrote my own simple downloader based on python 3.5 and the simple requests library. No magic there. Check it out

just run python, select your course and enjoy the parallel download :)

The script will first fetch the full course list and will let you choose. Then after you choose it will fetch the course description and will download all of it's videos into a folder named as the course name.

share|improve this answer
This answer solves the problem, but it could be improved with a description of what the script does, any dependencies it may have, and example usages. – user323419 Feb 6 at 18:41
Added more description, thanks – Almog Cohen Feb 7 at 19:11
Thank you. Added an upvote, great code! :) – user323419 Feb 7 at 19:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.