斯坦福公开课一键下载

斯坦福大学有几门计算机、电子工程相关的公开课,包括教学视频和课程资料,供免费下载。官网链接,首页预览如下:
公开课官网首页

如果一个一个去下载,挺麻烦的,写了个python脚本,目前依赖于Linuxwgetmkdir(mingw我没试过),如果你正在找类似资源,希望能帮到你。

from subprocess import call
import re #正则表达式
baseUrl = "http://html5.stanford.edu/videos/courses/see/"
courseSeries = 9 #开通的课程总数
courseList = [dict() for x in range(courseSeries)]

# Introduction to Computer Science
courseList[0] = ["CS106A",28,"Programming Methodology","Sahami, Mehran","https://see.stanford.edu/materials/icspmcs106a/ProgrammingMethodologyAllMaterials.zip"]

courseList[1] = ["CS106B",27,"Programming Abstractions","Zelenski, Julie","https://see.stanford.edu/materials/icspacs106b/ProgrammingAbstractionsAllMaterials.zip"]

courseList[2] = ["CS107",27,"Programming Paradigms","Cain, Jerry","https://see.stanford.edu/materials/icsppcs107/ProgrammingParadigmsAllMaterials.zip"]

# Artificial Intelligence
courseList[3] = ["CS223A",16,"Introduction to Robotics","Khatib, Oussama","https://see.stanford.edu/materials/aiircs223a/IntroToRoboticsAllMaterials.zip"]

courseList[4] = ["CS229",20,"Machine Learning","Ng, Andrew","https://see.stanford.edu/materials/aimlcs229/MachineLearningAllMaterials.zip"]

# Linear Systems and Optimization
courseList[5] = ["EE261",30,"The Fourier Transform and its Applications","Osgood, Brad G","https://see.stanford.edu/materials/lsoftaee261/FourierTransformAllMaterials.zip"]

courseList[6] = ["EE263",20,"Introduction to Linear Dynamical Systems","Boyd, Stephen","https://see.stanford.edu/materials/lsoeldsee263/LinearDynamicalSystemsAllMaterials.zip"]

courseList[7] = ["EE364A",19,"Convex Optimization I","Boyd, Stephen","https://see.stanford.edu/materials/lsocoee364a/ConvexOptimizationIAllMaterials.zip"]

courseList[8] = ["EE364B",18,"Convex Optimization II","Boyd, Stephen","https://see.stanford.edu/materials/lsocoee364b/ConvexOptimizationIIAllMaterials.zip"]

def downloadCourse(courseName,courseTotal):
    courseMain = baseUrl + courseName + "/" + courseName + "-lecture"
    videoFormat = ".mp4"
    #新建一个路径
    call(["mkdir",courseName])
    for c in range(1,courseTotal+1):
        if c < 10:
            index = "0"
            index  = index + str(c)
        else:
            index = str(c)
        link = courseMain + index + videoFormat
        print(link)
        #下载并保存到对应路径
        call(["wget","-P",courseName,link])

    #视频资源下载结束后,解析出课程附件
    for i in range(courseSeries):
        search = re.search(courseName,courseList[i][4],re.IGNORECASE)
        if search:
            call(["wget","-P",courseName,(courseList[i][4])])
#下载第一门课程
downloadCourse(courseList[0][0],courseList[0][1])
  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值