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()

 

发布了56 篇原创文章 · 获赞 18 · 访问量 12万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章