import requests
def download_videofile(video_links): root='保存文件位置' for link in video_links: file_name = link.split('/')[-1] print("Downloading file:%s" % file_name) r = requests.get(link, stream=True) with open(root+file_name, 'wb') as f: for chunk in r.iter_content(chunk_size=1024 * 1024): if chunk: f.write(chunk) print("%s downloaded!\\n" % file_name) print("All videos downloaded!") return if __name__ == "__main__": video_links=[视频链接1] download_video_series(video_links)
运行结果图如下: