代码拉取完成,页面将自动刷新
import download
import download2
import json
import os
class Infinit:
def __iter__(self):
return self
def __next__(self):
return None
def downloadMultiPart():
bvId = input('输入视频BV号:')
startPart = input('输入起始P:')
isVideo = input("是否爬取视频:(默认false)")
file_path = ''
with open("./config.json", 'rb') as f:
config = json.load(f)
file_path = config['file_path']
if not os.path.isdir(file_path):
os.makedirs(file_path)
if(startPart == ''):
startPart = '1'
start = int(startPart)
if(isVideo == "true"):
for i in Infinit():
try:
download.single_download2(bvId+'?p='+str(start), file_path)
# time.sleep(random.randint(1, 3))
start = start+1
except:
print('下载完成!')
break
else:
for i in Infinit():
try:
download.single_download(bvId+'?p='+str(start), file_path)
# time.sleep(random.randint(1, 3))
start = start+1
except:
print('下载完成!')
break
# BV1sV411k749
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。