Script to Download TED Videos in Bulk

I recently became addicted to TED Videos. This inspired me to create a simple python script which helps one download TED Talks in bulk. Here is the main part of the script. Scroll down for download link and usage instructions.

#! /usr/bin/python

# Name: TED Video Downloader
# Version: 0.4
# Summary: A bulk TED Talks download tool
# License: BSD
# Author: Pranav Ashok
# Author-email:
# Author-homepage:
# Support:
# Support: Twitter (@pranavashok)

from BeautifulSoup import BeautifulSoup
from urllib2 import urlopen
import re
import os
import sys

f = open(sys.argv[1], 'r')
for link in f:
	web = urlopen(link)
	soup = BeautifulSoup(
	wholeTag = soup.find(href=re.compile(""))

	name = os.path.basename(link)
	fileName, fileExt = os.path.splitext(name)
	outputFile = fileName+".mp4"

	# wholeTag['href'] gives the value of the href attribute
	downloadUrl = wholeTag['href']

	w = open('', 'a')
	w.write('wget -c -O \"%s\" \"%s\"\n' % (outputFile, downloadUrl))

Continue reading Script to Download TED Videos in Bulk