bilibili视频下载:
you-get-download.py
#!/usr/bin/python-8 # -*- coding: utf-8 -*- # Created by iFantastic on 2020/8/7# 用于视频下载(B站等) import sys,os #from you_get import common as you_get #导入you-getp库 import you_get #导入you-getp库 path="shangguigucss" #url = "https://www.bilibili.com/video/BV1Pi4y1D7uJ/?p=" #url = "https://www.bilibili.com/video/BV1p84y1P7Z5/?p=" url = "https://www.bilibili.com/video/BV1p84y1P7Z5/?p=" num1 =171 num2 = 201 def info(): directory = r'/opt/bilibili/%s' %path print(directory) isExists=os.path.exists(directory) if not isExists: os.makedirs(directory) for i in range(num1,num2): print(i) url_i = url + str(i) # sys.argv = ['you-get', '-o', directory, '--format','flv360',url_i] sys.argv = ['you-get', '-o', directory , '--format', 'flv',url_i] you_get.main() else: for i in range(num1,num2): print(i) url_i = url + str(i) # sys.argv = ['you-get', '-o', directory, '--format','flv360',url_i] print(url_i) sys.argv = ['you-get', url_i,'-o', directory] you_get.main() info()
标签:视频,get,url,argv,bilibili,sys,directory,下载 From: https://www.cnblogs.com/y593216/p/18138619