python 批量 多线程 下载 bilibili 视频

使用you-get工具下载,需要先安装库

 

pip install you-get
pip install threadpool

 

 

import os
import threadpool

'''
bilibili 视频批量多线程下载
'''
def download(i):
    try:
        print(i)
        os.system("you-get --format=flv720 https://www.bilibili.com/video/av80616176?p=" + str(i))
    except:
        print('error ' + str(i))

name_list = range(23,57)
pool = threadpool.ThreadPool(3)
requests = threadpool.makeRequests(download, name_list)
[pool.putRequest(req) for req in requests]
pool.wait()

 

你可能感兴趣的:(python)