Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
update to fit BBDown 1.4.9/1.5.0
  • Loading branch information
1299172402 committed May 8, 2022
1 parent 74fed8e commit c9ccc02
Show file tree
Hide file tree
Showing 10 changed files with 1,006 additions and 1,525 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug---.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ assignees: ''
- [ ] 请确认是界面(此GUI程序)的相关问题
此处无法解决 哔哩哔哩的地区/大会员限制、BBDown自身下载问题、FFmpeg混流问题、Aria2c自身限制 等一类的问题。如您的问题在这些方面,可以到其各自的仓库反馈。

- [ ] 在您反馈问题前,请关闭程序重试一次,以保证这不是一次误操作
- [ ] 在您反馈问题前,请关闭程序并删除 config.json 重试一次,以保证这不是一次误操作

## **✍问题描述**
您可以在此处说明问题
Expand Down
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: 新功能添加
about: "想添加一个新功能"
title: ''
labels: enhancement
assignees: ''

---

## **此功能的类型**
- [ ] BBDown 的命令行中存在此功能,而 GUI 中并没有提供

- [ ] 关于 GUI 本身的新功能

## **功能描述**
您可以在此处说明建议

## **额外说明(可选)**
如果此功能需要用到其他版本的 BBDown,Aria2c 等内容,可以在此处说明这些版本的下载地址
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ BBDown.exe

UI/__pycache__

__pycache__

Download/

[123456789]*/
236 changes: 141 additions & 95 deletions BBDown_GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def __init__(self, command):
super(RunBBDown, self).__init__()
self.command = command
def run(self):
p = subprocess.Popen(f"\"{bbdowndir}\" {self.command}", shell=True)
# print(f'"{bbdowndir}" {self.command}')
p = subprocess.Popen(f'"{bbdowndir}" {self.command}', shell=True)
p.wait()

class FormLogin(QMainWindow, Ui_Form_QRcode):
Expand Down Expand Up @@ -80,26 +81,28 @@ def Load(self):
self.advanced = config[item]
if self.advanced:
self.pushButton_advanced.setText("简易选项<")
self.resize(1220, 500)
self.resize(1560, 500)
self.advanced = True
else:
self.pushButton_advanced.setText("高级选项>")
self.resize(620, 400)
self.advanced = False
elif type(config[item]) == type(True):
exec(f"self.{item}.setChecked({config[item]})")
elif type(config[item]) == type(""):
exec(f"self.{item}.setText(r\"{config[item]}\")")
exec(f'self.{item}.setChecked({config[item]})')
elif type(config[item]) == type(''):
exec(f'self.{item}.setText(r"{config[item]}")')
elif type(config[item]) == type(0):
exec(f'self.{item}.setCurrentIndex({config[item]})')

super(FormMain, self).__init__()
self.setupUi(self)
self.pushButton_login.clicked.connect(self.login)
self.pushButton_logintv.clicked.connect(self.logintv)
self.lineEdit_ffmpeg.setText(os.path.join(workdir, "ffmpeg.exe"))
self.lineEdit_aria2c.setText(os.path.join(workdir, "aria2c.exe"))
self.lineEdit_aria2c_path.setText(os.path.join(workdir, "aria2c.exe"))
self.lineEdit_dir.setText(os.path.join(workdir, "Download"))
self.lineEdit_bbdown.setText(bbdowndir)
self.pushButton_ffmpeg.clicked.connect(self.ffmpegpath)
self.pushButton_aria2c.clicked.connect(self.aria2cpath)
self.pushButton_dir.clicked.connect(self.downpath)
self.pushButton_bbdown.clicked.connect(self.bbdownpath)
self.pushButton_download.clicked.connect(self.download)
Expand All @@ -109,132 +112,175 @@ def Load(self):
try:
Load(self)
except:
pass
self.resize(620, 400)
def login(self):
self.win_login = FormLogin("login")
self.win_login.show()
def logintv(self):
self.win_login = FormLogin("logintv")
self.win_login.show()
def ffmpegpath(self):
filepath, _ = QFileDialog.getOpenFileName(self, "选择文件", os.getcwd(), \
filepath, _ = QFileDialog.getOpenFileName(self, "选择文件", os.getcwd(),
"ffmpeg (ffmpeg.exe);;All Files (*.*)")
filepath = filepath.replace("/","\\")
self.lineEdit_ffmpeg.setText(filepath)
def aria2cpath(self):
filepath, _ = QFileDialog.getOpenFileName(self, "选择文件", os.getcwd(), \
filepath, _ = QFileDialog.getOpenFileName(self, "选择文件", os.getcwd(),
"aria2c (aria2c.exe);;All Files (*.*)")
filepath = filepath.replace("/","\\")
self.lineEdit_aria2c.setText(filepath)
def downpath(self):
downpath = QFileDialog.getExistingDirectory(self, "选择文件夹", os.getcwd())
downpath = downpath.replace("/","\\")
self.lineEdit_dir.setText(downpath)
def bbdownpath(self):
filepath, _ = QFileDialog.getOpenFileName(self, "选择文件", os.getcwd(), \
"BBDown (BBDown.exe);;All Files (*.*)")
filepath = filepath.replace("/","\\")
self.lineEdit_bbdown.setText(filepath)
global bbdowndir
bbdowndir = self.lineEdit_bbdown.text()
def download(self):
def Save():
config = {}
for i in range(1, 9):
exec(f"config[\"radioButton_{i}\"]=self.radioButton_{i}.isChecked()")
config["checkBox_ffmpeg"] = self.checkBox_ffmpeg.isChecked()
config["lineEdit_ffmpeg"] = self.lineEdit_ffmpeg.text()
config["checkBox_aria2c"] = self.checkBox_aria2c.isChecked()
config["lineEdit_aria2c"] = self.lineEdit_aria2c.text()
for i in dir(self):
if i[:9]=="checkBox_":
exec(f"config[i] = self.{i}.isChecked()")
elif i[:12]=="radioButton_":
exec(f"config[i] = self.{i}.isChecked()")
elif i[:9]=="lineEdit_":
exec(f"config[i] = self.{i}.text()")
elif i[:9]=="comboBox_":
exec(f"config[i] = self.{i}.currentIndex()")
config["advanced"] = self.advanced
for i in range(1, 26):
exec(f"config[\"checkBox_{i}\"]=self.checkBox_{i}.isChecked()")
for i in range(1, 8):
exec(f"config[\"lineEdit_{i}\"]=self.lineEdit_{i}.text()")
config["lineEdit_dir"] = self.lineEdit_dir.text()
config["lineEdit_url"] = self.lineEdit_url.text()
f = open(os.path.join(workdir, "config.json"), "w")
f.write(json.dumps(config, indent=4))
f.close()

Save()
arg = ""
if self.radioButton_1.isChecked():
pass
elif self.radioButton_2.isChecked():
arg += " -tv"
elif self.radioButton_3.isChecked():
arg += " -app"
elif self.radioButton_4.isChecked():
arg += " -intl"
if self.radioButton_5.isChecked():
args = ''

# 下载地址
args += f' {self.lineEdit_url.text()} '

# 画质选择
if self.radioButton_dfn_priority.isChecked():
pass
elif self.radioButton_6.isChecked():
arg += " -hevc"
elif self.radioButton_7.isChecked():
arg += " -avc"
elif self.radioButton_8.isChecked():
arg += " -av1"
elif self.radioButton_dfn_1080P.isChecked():
args += ' --dfn-priority "1080P 高清" '
elif self.radioButton_dfn_720P.isChecked():
args += ' --dfn-priority "720P 高清" '
elif self.radioButton_dfn_480P.isChecked():
args += ' --dfn-priority "480P 清晰" '
elif self.radioButton_dfn_360P.isChecked():
args += ' --dfn-priority "360P 流畅" '
elif self.radioButton_dfn_more.isChecked():
if self.comboBox_dfn_more.currentIndex()!=0:
dfn = self.comboBox_dfn_more.itemText(self.comboBox_dfn_more.currentIndex())
args += f' --dfn-priority "{dfn}"'

# 下载源选择
if self.comboBox_source.currentIndex()!=0:
choice = ['', '-tv', '-app', '-intl']
args += ' ' + choice[self.comboBox_source.currentIndex()] + ' '

# 下载视频编码选择
if self.comboBox_source.currentIndex()!=0:
choice = ['', 'AVC', 'AV1', 'HEVC']
args += ' --encoding-priority ' + choice[self.comboBox_source.currentIndex()] + ' '

# 指定FFmpeg路径
if self.checkBox_ffmpeg.isChecked():
arg += f" --ffmpeg-path \"{self.lineEdit_ffmpeg.text()}\""
if self.checkBox_aria2c.isChecked():
arg += f" --use-aria2c --aria2c-path \"{self.lineEdit_aria2c.text()}\""
if self.checkBox_25.isChecked():
arg += " -p ALL"
args += f' --ffmpeg-path "{self.lineEdit_ffmpeg.text()}" '

# 下载分P选项
if self.radioButton_p_current.isChecked():
pass
elif self.radioButton_p_all.isChecked():
args += ' -p ALL '
elif self.radioButton_p_new.isChecked():
args += ' -p NEW '

# 高级选项
if self.advanced:
if self.checkBox_1.isChecked():
arg += " --use-mp4box"
if self.checkBox_2.isChecked():
arg += " -info"
if self.checkBox_3.isChecked():
arg += " -hs"
if self.checkBox_4.isChecked():
arg += " -ia"
if self.checkBox_5.isChecked():
arg += " --show-all"
if self.checkBox_6.isChecked():
arg += f" --aria2c-proxy {self.lineEdit_1.text()}"
if self.checkBox_7.isChecked():
arg += " -mt"
if self.checkBox_8.isChecked():
arg += f" -p {self.lineEdit_2.text()}"
if self.checkBox_9.isChecked():
arg += " --audio-only"
if self.checkBox_10.isChecked():
arg += " --video-only"
if self.checkBox_11.isChecked():
arg += " --sub-only"
if self.checkBox_12.isChecked():
arg += " --no-padding-page-num"
if self.checkBox_13.isChecked():
arg += " --debug"
if self.checkBox_14.isChecked():
arg += " --skip-mux"
if self.checkBox_15.isChecked():
arg += " --skip-subtitle"
if self.checkBox_16.isChecked():
arg += " --skip-cover"
if self.checkBox_17.isChecked():
arg += " -dd"
if self.checkBox_18.isChecked():
arg += " --add-dfn-subfix"
if self.checkBox_19.isChecked():
arg += " --no-part-prefix"
if self.checkBox_20.isChecked():
arg += f" --language {self.lineEdit_3.text()}"
if self.checkBox_21.isChecked():
arg += f" -c {self.lineEdit_4.text()}"
if self.checkBox_22.isChecked():
arg += f" -token {self.lineEdit_5.text()}"
if self.checkBox_23.isChecked():
arg += f" --mp4box-path \"{self.lineEdit_6.text()}\""
if self.checkBox_24.isChecked():
arg += f" --delay-per-page {self.lineEdit_7.text()}"
arg += f" --work-dir \"{self.lineEdit_dir.text()}\""
arg += f" {self.lineEdit_url.text()}"
self.job1 = RunBBDown(arg)
# 下载选项
if self.checkBox_audio_only.isChecked():
args += ' --audio-only '
if self.checkBox_video_only.isChecked():
args += ' --video-only '
if self.checkBox_sub_only.isChecked():
args += ' --sub-only '
if self.checkBox_danmaku.isChecked():
args += ' -dd '

# 交互选项
if self.checkBox_ia.isChecked():
args += ' -ia '
if self.checkBox_info.isChecked():
args += ' -info '
if self.checkBox_hs.isChecked():
args += ' -hs '
if self.checkBox_debug.isChecked():
args += ' --debug '

# Cookies
if self.checkBox_token.isChecked():
args += f' -token "{self.lineEdit_token.text()}" '
if self.checkBox_c.isChecked():
args += f' -c "{self.lineEdit_c.text()}" '

# 跳过选项
if self.checkBox_skip_subtitle.isChecked():
args += ' --skip-subtitle '
if self.checkBox_skip_cover.isChecked():
args += ' --skip-cover '
if self.checkBox_skip_mux.isChecked():
args += ' --skip-mux '

# MP4box
if self.checkBox_mp4box.isChecked():
args += ' --use-mp4box '
if self.checkBox_mp4box_path.isChecked():
args += f' --mp4box-path "{self.lineEdit_mp4box_path.text()}" '

# 其他
if self.checkBox_mt.isChecked():
args += ' -mt '
if self.checkBox_language.isChecked():
args += f' --language {self.lineEdit_language.text()} '

# 分P
if self.checkBox_p_show_all.isChecked():
args += ' --show-all '
if self.checkBox_p.isChecked():
args += f' -p {self.lineEdit_p.text()} '
if self.checkBox_p_delay.isChecked():
args += f' --delay-per-page {self.lineEdit_p_delay.text()} '

# aria2c
if self.checkBox_use_aria2c.isChecked():
args += ' --use-aria2c '
if self.checkBox_aria2c_path.isChecked():
args += f' --aria2c-path "{self.lineEdit_aria2c_path.text()}" '
if self.checkBox_aria2c_proxy.isChecked():
args += f' --aria2c-proxy {self.lineEdit_aria2c_proxy.text()} '

# 文件名选项
if self.checkBox_F.isChecked():
args += f' -F "{self.lineEdit_F.text()}" '
if self.checkBox_M.isChecked():
args += f' -M "{self.lineEdit_M.text()}" '

# 下载路径
args += f' --work-dir "{self.lineEdit_dir.text()}" '

self.job1 = RunBBDown(args)
self.job1.start()

def advanced(self):
if not self.advanced:
self.pushButton_advanced.setText("简易选项<")
self.resize(1220, 500)
self.resize(1560, 500)
self.advanced = True
else:
self.pushButton_advanced.setText("高级选项>")
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ BBDown的图形化版本,亦保留有命令行
## 特性

- [x] 记忆下载参数
- [x] 下载全部剧集(分片)
- [x] 下载剧集选项
- [x] 优先显示常用选项,亦保留有所有功能

## 下载
Expand Down Expand Up @@ -44,8 +44,7 @@ python BBDown_GUI.py
-->

## 相关Repositories
## 相关Repository

- [BBDown_hk](https://github.com/1299172402/BBDown_hk)
(个人站点解析,替换UPOS加速下载,只有从网页端下载有效)

Loading

0 comments on commit c9ccc02

Please sign in to comment.