Skip to content

Commit

Permalink
Merge pull request #212 from nICEnnnnnnnLee/dev
Browse files Browse the repository at this point in the history
V6.33 Update
  • Loading branch information
nICEnnnnnnnLee authored Aug 18, 2024
2 parents f7b48db + cd92e7e commit ccec7d8
Show file tree
Hide file tree
Showing 34 changed files with 1,064 additions and 192 deletions.
45 changes: 13 additions & 32 deletions .github/release.info
Original file line number Diff line number Diff line change
@@ -1,35 +1,16 @@
* 修复: 当编码不为`utf8`时,下载弹幕乱码的问题。[#197](https://github.com/nICEnnnnnnnLee/BilibiliDown/issues/197)
* 修复: 卸载脚本在删除文件时考虑路径中包含有空格的情况
* 修复: 当搜索UP主视频的结果存在课程时,跳过课程解析。`e.g. https://space.bilibili.com/345024422/search/video?keyword=保姆`
* 修复: 当视频链接中包含 au+数字 时,会被识别成音频[#204](https://github.com/nICEnnnnnnnLee/BilibiliDown/issues/204)
* 修复: 保存配置时,考虑多行配置同一个key的情况
* 新增: 现在可以提供Windows amd64下的安装包
* 新增: 增加配置,可以在软件启动时开始按计划周期性批量下载[#199](https://github.com/nICEnnnnnnnLee/BilibiliDown/issues/199)
* 新增: 现在可以替换音视频下载地址的host,建议在走PCDN表现不佳的情况下尝试使用
+ 可能使情况变好,也可能更坏
+ 右上角菜单`配置` -> `音视频链接替换host?` -> `替换` (临时启用,程序重启后失效)
+ 设置`bilibili.download.host.forceReplace = true` (持久化生效)
* 新增: 现在可以强制音视频下载走http而不是https
+ 下载链接如果指定了端口的话,那就只能走https协议,无论配置怎么样
* 优化: 下载队列的url存活时间超过90min(参数可调整)时,会重新查询url再进行下载[#202](https://github.com/nICEnnnnnnnLee/BilibiliDown/issues/202)
+ 一次生成这么多任务,_**你有点太极端了**_
+ 在这个场景下,最好设置成:失败重试/继续下载任务时,重新查询下载链接(搜`retry`或`reloadDownloadUrl`)
* 优化: 失败重试/暂停后继续下载的任务优先级更高,而不是排在任务队列的最后
* 优化: `UP主所有视频`支持更多类型的url
+ 现在增加支持`https://space.bilibili.com/336399506/?spm_id_from=333.999.0.0`
+ 以前的类型参数是直接跟在数字后面,而不是`/`后面
+ `https://space.bilibili.com/336399506/`
+ `https://space.bilibili.com/336399506?spm_id_from=333.999.0.0`
* 优化: Windows下jre11版本、modules更新
+ 版本`Oracle 11+28 2018-09-25`升级为`Temurin 21.0.3+9-LTS 2024-04-16`
+ modules
+ 前`java.base,java.compiler,java.datatransfer,java.desktop,java.management`
+ 后`java.base,java.compiler,java.datatransfer,java.desktop,java.management,java.security.sasl,java.xml,java.logging`
* [帮助文档]修复: 导航提示汉化覆盖完毕
* [帮助文档]新增: 添加搜索功能
* [帮助文档]优化: VitePress由`alpha`升级为`release`版本
* [帮助文档]优化: Github Pages由读取指定分支改为Actions附件上传
* 其它常规优化,详见[V6.31...V6.32](https://github.com/nICEnnnnnnnLee/BilibiliDown/compare/V6.31...V6.32)
* 新增: release 附件中`win64_jre`压缩文件加入`exe`程序
* 新增: 添加专栏图片解析
* 新增: 添加专栏文集图片解析
* 新增: 添加图文动态解析
* 新增: 添加图文动态个人收藏解析
* 新增: 可以JVM传入参数`-Dbilibili.prop.dataDirPath={dataDirPath}`来指定数据文件夹位置(可以不是程序所在目录)
* 新增: 可以JVM传入参数`-Dbilibili.prop.log=true/false`来尽可能减少打印信息
* 新增: 可以在登录时获取服务器时间并以之为基准
* 新增(ui): 配置面板中,针对文件/文件夹类型的配置,可以通过文件选择器来选择路径
* 新增(ci): 现在可以手动触发release ci,此时可以选择是否同步上传代码、附件到第三方
* 新增(ci): 现在会将`commit hash`,`workflow id`信息写入作品信息页面,`buildTime`改为`GMT+8`时区
* 已知问题: jpackage 打包的exe程序无法自重启 [JDK-8325924](https://bugs.openjdk.org/browse/JDK-8325924)/[JDK-8325203](https://bugs.openjdk.org/browse/JDK-8325203)
* 具体修改详见[V6.32...V6.33](https://github.com/nICEnnnnnnnLee/BilibiliDown/compare/V6.31...V6.32)
<hr/>

如果你是Win64用户,且没有java环境,请下载附件`*.win_x64_jre11.release.zip`或 `*.win_x64.msi`
84 changes: 68 additions & 16 deletions .github/scripts/installer-win/win64_msi.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
--main-class nicelee.memory.App \
--main-jar launch.jar \
--java-options -Dfile.encoding=utf-8 \
--java-options -Dbilibili.prop.log=false \
--runtime-image "./runtime" \
--icon ./resource/favicon.ico \
--app-version {version_installer} \
Expand Down Expand Up @@ -223,6 +224,70 @@ def step_6_deal_with_bundle_wxf():

with open('resource/bundle.wxf','w', encoding='utf-8') as output:
output.write(bundle)

def compress_folder(folder_path, output_path):
with zipfile.ZipFile(output_path, 'w', zipfile.ZIP_DEFLATED) as zipf:
for root, dirs, files in os.walk(folder_path):
for file in files:
file_path = os.path.join(root, file)
arc_name = os.path.relpath(file_path, folder_path)
# print(arc_name)
zipf.write(file_path, arc_name)

def step_7_build_msi():
print("step_7: 生成打包文件")
print("删除不必要的文件")
shutil.rmtree("./temp", onerror=on_err)

msi_path = f"./target/BilibiliDown-{version_installer}.msi"
msi_sha1_path = f"{msi_path}.sha1"
if os.path.exists(msi_path):
os.remove(msi_path)

print("执行jpackage命令")
exe_command(cmd_package, cmd_env)

print("计算MSI SHA1并输出")
with open(msi_sha1_path,'w', encoding='utf-8') as output:
sha1 = cal_file_sha1(msi_path)
output.write(sha1)

def step_8_build_exe_zip():
print("step_8: 生成包含exe的压缩包")
print("重新解压程序包到 ./release_exe_zip")
zip_file = zipfile.ZipFile(zip_file_path, 'r')
zip_file.extractall("./release_exe_zip")
zip_file.close()

print("jre由 minimal-bilibilidown-jre 重命名为 runtime")
# shutil.move("./release/minimal-bilibilidown-jre", "./runtime")
os.rename("./release_exe_zip/minimal-bilibilidown-jre", "./release_exe_zip/runtime")

print("删除不必要的文件")
os.remove("./release_exe_zip/Double-Click-to-Run-for-Mac.command")
os.remove("./release_exe_zip/Create-Shortcut-on-Desktop-for-Linux.sh")
os.remove("./release_exe_zip/Create-Shortcut-on-Desktop-for-Mac.sh")
os.remove("./release_exe_zip/Create-Shortcut-on-Desktop-for-Win.vbs")
os.remove("./release_exe_zip/uninstall.bat")
os.remove("./release_exe_zip/update.bat")

print("将相关文件复制到app文件夹")
os.mkdir("release_exe_zip/app")
shutil.copy("temp/images/win-msi.image/BilibiliDown/app/.package", "release_exe_zip/app/.package")
shutil.copy("resource/BilibiliDown.cfg", "release_exe_zip/app/BilibiliDown.cfg")

print("复制exe文件")
shutil.copy("temp/images/win-msi.image/BilibiliDown/BilibiliDown.exe", "release_exe_zip/BilibiliDown.exe")

print("打包成压缩包")
exe_zip_path = f"BilibiliDown.v{version}.win_x64_jre11.release.zip"
exe_zip_sha1_path = f"{exe_zip_path}.sha1"
compress_folder("release_exe_zip", exe_zip_path)

print("计算zip SHA1并输出")
with open(exe_zip_sha1_path,'w', encoding='utf-8') as output:
sha1 = cal_file_sha1(exe_zip_path)
output.write(sha1)

if __name__ == '__main__':

Expand All @@ -240,20 +305,7 @@ def step_6_deal_with_bundle_wxf():

step_6_deal_with_bundle_wxf()

print("step_7: 生成打包文件")
print("删除不必要的文件")
shutil.rmtree("./temp", onerror=on_err)

msi_path = f"./target/BilibiliDown-{version_installer}.msi"
msi_sha1_path = f"{msi_path}.sha1"
if os.path.exists(msi_path):
os.remove(msi_path)

print("执行jpackage命令")
exe_command(cmd_package, cmd_env)

print("计算SHA1并输出")
with open(msi_sha1_path,'w', encoding='utf-8') as output:
sha1 = cal_file_sha1(msi_path)
output.write(sha1)
step_7_build_msi()

step_8_build_exe_zip()
""" """
25 changes: 13 additions & 12 deletions .github/scripts/read_version_and_save_build_info.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# 工作目录在项目顶级
import re, os, datetime
from time import strftime
import re, os
from datetime import datetime, timedelta, timezone

version, about, buildType = None, None, os.environ.get("BUILD_TYPE", 'Release')
repo = os.environ.get("GITHUB_REPO", 'nICEnnnnnnnLee/BilibiliDown')
hashSHA = os.environ.get("GITHUB_SHA", 'unknown_sha')
runId = os.environ.get("GITHUB_RUN_ID", 'unknown_run_id')
utc_dt = datetime.utcnow().replace(tzinfo=timezone.utc)
bj_dt = utc_dt.astimezone(timezone(timedelta(hours=8)))
dateTime = bj_dt.strftime("%Y-%m-%d %H:%M:%S")
with open('src/nicelee/ui/Global.java', encoding='utf-8') as file:
content = file.read()
pattern = r'@Config\(key *= *"bilibili.version", *defaultValue *= *"v([\d\.]+)"'
Expand All @@ -15,14 +21,9 @@
about = file.read()

with open('src/resources/about.html', 'w', encoding='utf-8') as file:
now=datetime.datetime.now()
buildInfo = '''<div id="versionInfo" >
<p>版本信息: v{version} {buildType}</p>
<p>编译信息: Build by Github Actions at {dateTime}</p>
</div>'''.format(
version = version,
buildType = buildType,
dateTime = now.strftime("%Y-%m-%d %H:%M:%S")
)
buildInfo = f'''<div id="versionInfo" >
<p>版本信息: v{version} {buildType} - commit hash:<a href="https://github.com/{repo}/commit/{hashSHA}">{hashSHA}</a></p>
<p>编译信息: Build by Github Actions at {dateTime}, workflow: <a href="https://github.com/{repo}/actions/runs/{runId}">{runId}</a></p>
</div>'''
txtToSave = about.replace('<div id="versionInfo" ></div>', buildInfo)
file.write(txtToSave)
file.write(txtToSave)
1 change: 1 addition & 0 deletions .github/workflows/build-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ jobs:
with:
name: BilibiliDown.v${{ inputs.version_number }}.win64
path: win_msi/target/*.msi
retention-days: 2

2 changes: 1 addition & 1 deletion .github/workflows/closeStaleIssue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: CloseStaleIssue

on:
schedule:
- cron: '1 15 1/2 * *'
- cron: '1 15 1/8 * *'

jobs:
build:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pre-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
id: tag_latest
env:
BUILD_TYPE: Beta
GITHUB_REPO: ${{ github.repository }}
GITHUB_RUN_ID: ${{ github.run_id }}
run: |
python ./.github/scripts/read_version_and_save_build_info.py
Expand Down
28 changes: 19 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ name: Build Release

on:
workflow_dispatch:
inputs: {}
inputs:
enable_sync_third_party:
description: '同步上传代码、附件到第三方?'
required: false
type: boolean
default: true
# 不是人为触发时,为空字符串
push:
branches:
- master
Expand All @@ -32,6 +38,9 @@ jobs:

- name: Read tag_latest and Save build info
id: tag_latest
env:
GITHUB_REPO: ${{ github.repository }}
GITHUB_RUN_ID: ${{ github.run_id }}
run: |
python ./.github/scripts/read_version_and_save_build_info.py
Expand Down Expand Up @@ -67,14 +76,12 @@ jobs:
files: |
BilibiliDown.v${{steps.tag_latest.outputs.value}}.release.zip
BilibiliDown.v${{steps.tag_latest.outputs.value}}.release.zip.sha1
BilibiliDown.v${{steps.tag_latest.outputs.value}}.win_x64_jre11.release.zip
BilibiliDown.v${{steps.tag_latest.outputs.value}}.win_x64_jre11.release.zip.sha1
- name: Upload release to supabase
env:
VERSION_NUMBER: ${{ steps.tag_latest.outputs.value }}
SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }}
if: ${{ env.SUPABASE_ANON_KEY != ''}}
if: ${{ env.SUPABASE_ANON_KEY != '' && github.event.inputs.enable_sync_third_party != 'false'}}
run: |
chmod +x .github/scripts/upload_supabase.sh
./.github/scripts/upload_supabase.sh
Expand All @@ -85,7 +92,7 @@ jobs:
CLOUDINARY_API_SECRET: ${{ secrets.CLOUDINARY_API_SECRET }}
ZIP_FILE_NAME: BilibiliDown.v${{steps.tag_latest.outputs.value}}.release.zip
SHA1_FILE_NAME: BilibiliDown.v${{steps.tag_latest.outputs.value}}.release.zip.sha1
if: ${{ env.CLOUDINARY_API_KEY != '' && env.CLOUDINARY_API_SECRET != ''}}
if: ${{ env.CLOUDINARY_API_KEY != '' && env.CLOUDINARY_API_SECRET != '' && github.event.inputs.enable_sync_third_party != 'false'}}
run: |
chmod +x .github/scripts/upload_cloudinary.sh
./.github/scripts/upload_cloudinary.sh
Expand All @@ -94,15 +101,15 @@ jobs:
env:
VERSION_NUMBER: ${{ steps.tag_latest.outputs.value }}
BITBUCKET_TOKEN: ${{ secrets.BITBUCKET_TOKEN }}
if: ${{ env.BITBUCKET_TOKEN != ''}}
if: ${{ env.BITBUCKET_TOKEN != '' && github.event.inputs.enable_sync_third_party != 'false'}}
run: |
chmod +x .github/scripts/upload_bitbucket.sh
./.github/scripts/upload_bitbucket.sh
- name: Sync Push to Gitee
env:
GITEE_AUTH: ${{ secrets.GITEE_AUTH }}
if: ${{ env.GITEE_AUTH != ''}}
if: ${{ env.GITEE_AUTH != '' && github.event.inputs.enable_sync_third_party != 'false'}}
run: |
chmod +x .github/scripts/sync_push_to_gitee.sh
./.github/scripts/sync_push_to_gitee.sh
Expand All @@ -112,7 +119,8 @@ jobs:
with:
name: release
path: BilibiliDown.v${{steps.tag_latest.outputs.value}}.win_x64_jre11.release.zip

retention-days: 1

# 生成win64 安装包
build_win64_msi:
needs: build
Expand Down Expand Up @@ -146,11 +154,13 @@ jobs:
move target/BilibiliDown-1.${{needs.build.outputs.VERSION_NUMBER}}.0.msi target/BilibiliDown.v${{needs.build.outputs.VERSION_NUMBER}}.win_x64.msi
move target/BilibiliDown-1.${{needs.build.outputs.VERSION_NUMBER}}.0.msi.sha1 target/BilibiliDown.v${{needs.build.outputs.VERSION_NUMBER}}.win_x64.msi.sha1
- name: Upload MSI File to release asset
- name: Upload MSI,ZIP File to release asset
uses: softprops/[email protected]
with:
tag_name: V${{needs.build.outputs.VERSION_NUMBER}}
name: BilibiliDown - v${{needs.build.outputs.VERSION_NUMBER}}
files: |
win_msi/target/BilibiliDown.v${{needs.build.outputs.VERSION_NUMBER}}.win_x64.msi
win_msi/target/BilibiliDown.v${{needs.build.outputs.VERSION_NUMBER}}.win_x64.msi.sha1
win_msi/BilibiliDown.v${{needs.build.outputs.VERSION_NUMBER}}.win_x64_jre11.release.zip
win_msi/BilibiliDown.v${{needs.build.outputs.VERSION_NUMBER}}.win_x64_jre11.release.zip.sha1
4 changes: 4 additions & 0 deletions .github/workflows/upload-manually.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ jobs:

- name: Read tag_latest and Save build info
id: tag_latest
env:
BUILD_TYPE: Beta
GITHUB_REPO: ${{ github.repository }}
GITHUB_RUN_ID: ${{ github.run_id }}
run: |
python ./.github/scripts/read_version_and_save_build_info.py
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Bilibili 视频下载器,用于下载B站视频。

+ 本项目遵守开源协议`Apache 2.0`
```
Copyright (C) 2019-2023 NiceLee. All Rights Reserved.
Copyright (C) 2019-2024 NiceLee. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
14 changes: 14 additions & 0 deletions UPDATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
## UPDATE
* V6.33 `2024-08-18`
* 新增: release中`win64_jre`压缩文件加入`exe`程序
* 新增: 添加专栏图片解析
* 新增: 添加专栏文集图片解析
* 新增: 添加图文动态解析
* 新增: 添加图文动态个人收藏解析
* 新增: 可以JVM传入参数`-Dbilibili.prop.dataDirPath={dataDirPath}`来指定数据文件夹位置(可以不是程序所在目录)
* 新增: 可以JVM传入参数`-Dbilibili.prop.log=true/false`来尽可能减少打印信息
* 新增: 可以在登录时获取服务器时间并以之为基准
* 新增(ui): 配置面板中,针对文件/文件夹类型的配置,可以通过文件选择器来选择路径
* 新增(ci): 现在可以手动触发release ci,此时可以选择是否同步上传代码、附件到第三方
* 新增(ci): 现在会将`commit hash`,`workflow id`信息写入作品信息页面,`buildTime`改为`GMT+8`时区
* 已知问题: jpackage 打包的exe程序无法自重启 [JDK-8325924](https://bugs.openjdk.org/browse/JDK-8325924)/[JDK-8325203](https://bugs.openjdk.org/browse/JDK-8325203)

* V6.32 `2024-07-05`
* 修复: 当编码不为`utf8`时,下载弹幕乱码的问题。[#197](https://github.com/nICEnnnnnnnLee/BilibiliDown/issues/197)
* 修复: 卸载脚本在删除文件时考虑路径中包含有空格的情况
Expand Down
2 changes: 1 addition & 1 deletion release/Double-Click-to-Run-for-Win.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ set Path=%~dp0minimal-bilibilidown-jre\bin;%Path%
set Path=%~dp0runtime\bin\;%Path%
:: -Dhttps.protocols=TLSv1.2 https://bugs.openjdk.org/browse/JDK-8206923
:: start javaw -Dhttps.protocols=TLSv1.2 -jar INeedBiliAV.jar
start javaw -Dfile.encoding=utf-8 -Dhttps.protocols=TLSv1.2 -jar launch.jar
start javaw -Dfile.encoding=utf-8 -Dbilibili.prop.log=false -Dhttps.protocols=TLSv1.2 -jar launch.jar
Loading

0 comments on commit ccec7d8

Please sign in to comment.