0

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

Ex: http://openclassroom.stanford.edu/MainFolder/CoursePage.php?course=WebApplications

thanx in advance

2

Use Firefox with Video DownloadHelper addon.

1
  1. Copy the following code in a new document and save it in a new directory as downloader.py.

    #!/usr/bin/env python
    
    import urllib
    from BeautifulSoup import BeautifulSoup
    
    
    COURSE_URL = 'http://openclassroom.stanford.edu/MainFolder/CoursePage.php?course=WebApplications'
    
    def download_video(video_name):
        course_name = COURSE_URL.split('course=')[1]
        request = urllib.urlopen('http://openclassroom.stanford.edu/MainFolder/'\
                                 'courses/{0}/videos/{1}.xml'.format(course_name,
                                                                     video_name))
        response = request.read()
    
        flv_name = response.split('<videoFile>')[1].split('</videoFile>')[0]
        print 'Downloading: %s' % flv_name
        urllib.urlretrieve('http://openclassroom.stanford.edu/MainFolder/courses/'\
                           '{0}/videos/{1}'.format(course_name, flv_name),
                            flv_name)
    
    def main():
        request = urllib.urlopen(COURSE_URL)
        response = request.read()
        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]
                    download_video(video_name)
    
    if __name__ == '__main__':
        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 downloader.py file is located (using the 'cd' command).

  4. Run the file using the python command:

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

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

0

This works for me:

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

e.g.

youtube-dl 'http://openclassroom.stanford.edu/MainFolder/VideoPage.php?course=ufldl&video=03.1-NeuralNetworks-Representation&speed=100' 
0

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 downloader.py, 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.

  • 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 '16 at 18:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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