Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nilaoda/BBDown
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.3.7
Choose a base ref
...
head repository: nilaoda/BBDown
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 7,263 additions and 2,568 deletions.
  1. +12 −0 .editorconfig
  2. +16 −0 .github/issue_template.md
  3. +181 −0 .github/workflows/build_latest.yml
  4. +14 −0 .gitignore
  5. +19 −0 BBDown.Core/APP/Header/device.proto
  6. +8 −0 BBDown.Core/APP/Header/fawkesreq.proto
  7. +12 −0 BBDown.Core/APP/Header/locale.proto
  8. +12 −0 BBDown.Core/APP/Header/metadata.proto
  9. +25 −0 BBDown.Core/APP/Header/network.proto
  10. +14 −0 BBDown.Core/APP/Header/restriction.proto
  11. +10 −0 BBDown.Core/APP/Payload/dmviewreq.proto
  12. +25 −0 BBDown.Core/APP/Payload/playviewreq.proto
  13. +104 −0 BBDown.Core/APP/Response/dmviewreply.proto
  14. +163 −0 BBDown.Core/APP/Response/playviewreply.proto
  15. +582 −0 BBDown.Core/AppHelper.cs
  16. +22 −0 BBDown.Core/BBDown.Core.csproj
  17. +26 −0 BBDown.Core/Config.cs
  18. +241 −0 BBDown.Core/DanmakuUtil.cs
  19. +223 −0 BBDown.Core/Entity/Entity.cs
  20. +16 −0 BBDown.Core/Entity/ParsedResult.cs
  21. +48 −0 BBDown.Core/Entity/VInfo.cs
  22. +82 −0 BBDown.Core/Fetcher/BangumiInfoFetcher.cs
  23. +58 −0 BBDown.Core/Fetcher/CheeseInfoFetcher.cs
  24. +105 −0 BBDown.Core/Fetcher/FavListFetcher.cs
  25. +126 −0 BBDown.Core/Fetcher/IntlBangumiInfoFetcher.cs
  26. +76 −0 BBDown.Core/Fetcher/MediaListFetcher.cs
  27. +131 −0 BBDown.Core/Fetcher/NormalInfoFetcher.cs
  28. +77 −0 BBDown.Core/Fetcher/SeriesListFetcher.cs
  29. +74 −0 BBDown.Core/Fetcher/SpaceVideoFetcher.cs
  30. +41 −0 BBDown.Core/FetcherFactory.cs
  31. +6 −0 BBDown.Core/IFetcher.cs
  32. +60 −0 BBDown.Core/Logger.cs
  33. +468 −0 BBDown.Core/Parser.cs
  34. +74 −0 BBDown.Core/Util/BilibiliBvConverter.cs
  35. +105 −0 BBDown.Core/Util/HTTPUtil.cs
  36. +484 −0 BBDown.Core/Util/SubUtil.cs
  37. +9 −3 BBDown.sln
  38. +17 −8 BBDown/BBDown.csproj
  39. +188 −0 BBDown/BBDownApiServer.cs
  40. +25 −23 BBDown/BBDownAria2c.cs
  41. +0 −76 BBDown/BBDownBangumiInfoFetcher.cs
  42. +0 −51 BBDown/BBDownCheeseInfoFetcher.cs
  43. +60 −0 BBDown/BBDownConfigParser.cs
  44. +220 −0 BBDown/BBDownDownloadUtil.cs
  45. +0 −100 BBDown/BBDownEntity.cs
  46. +29 −0 BBDown/BBDownEnums.cs
  47. +0 −51 BBDown/BBDownLogger.cs
  48. +130 −0 BBDown/BBDownLoginUtil.cs
  49. +194 −78 BBDown/BBDownMuxer.cs
  50. +0 −65 BBDown/BBDownNormalInfoFetcher.cs
  51. +0 −284 BBDown/BBDownParser.cs
  52. +0 −60 BBDown/BBDownSpaceVideoFetcher.cs
  53. +0 −237 BBDown/BBDownSubUtil.cs
  54. +478 −592 BBDown/BBDownUtil.cs
  55. +0 −52 BBDown/BBDownVInfo.cs
  56. +226 −0 BBDown/CommandLineInvoker.cs
  57. +32 −0 BBDown/ConsoleQRCode.cs
  58. +14 −0 BBDown/Directory.Build.props
  59. +0 −11 BBDown/IFetcher.cs
  60. +63 −0 BBDown/MyOption.cs
  61. +525 −0 BBDown/Program.Methods.cs
  62. +791 −634 BBDown/Program.cs
  63. +126 −70 BBDown/ProgressBar.cs
  64. +19 −0 BBDown/Properties/launchSettings.json
  65. +0 −126 BBDown/changelog.txt
  66. +0 −9 BBDown/nuget.config
  67. +233 −38 README.md
  68. +144 −0 json-api-doc.md
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 4
charset = utf-8
# end_of_line = crlf
# trim_trailing_whitespace = false
# insert_final_newline = false
16 changes: 16 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- 提问前请确认你的版本是最新版 不要拿一个过时的版本来咨询为什么某某功能失效 -->
#### 1. 你使用的BBDown版本是什么?(指明 Release / Actions / DotnetTool)
。。。

#### 2. 你在什么系统使用本软件?(Win/Linux/Mac)
。。。

#### 3. 你使用的完整命令是什么?
```
BBDown ...
```
#### 4. 遇到了什么问题?
xxx

#### 5. 运行截图(最好开启`--debug`;注意自行将Cookie/Token等敏感信息隐藏)
。。。
181 changes: 181 additions & 0 deletions .github/workflows/build_latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
name: Build Latest

on: [push,workflow_dispatch]

env:
DOTNET_SDK_VERSION: '9.0.*'
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true

jobs:
set-date:
runs-on: ubuntu-latest
outputs:
date: ${{ steps.get_date.outputs.date }}
steps:
- name: Get Date in UTC+8
id: get_date
run: echo "date=$(date -u -d '8 hours' +'%Y%m%d')" >> "$GITHUB_OUTPUT"

build-win-x64-arm64:
runs-on: windows-latest
needs: set-date

steps:
- uses: actions/checkout@v1

- name: Set up dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}

- name: Install zip
run: choco install zip --no-progress --yes

- name: Publish [win]
run: |
dotnet publish BBDown -r win-x64 -c Release -o artifact
dotnet publish BBDown -r win-arm64 -c Release -o artifact-arm64
- name: Package [win]
run: |
cd artifact
zip ../BBDown_${{ needs.set-date.outputs.date }}_win-x64.zip BBDown.exe
cd ../artifact-arm64
zip ../BBDown_${{ needs.set-date.outputs.date }}_win-arm64.zip BBDown.exe
- name: Upload Artifact [win-x64]
uses: actions/upload-artifact@v4
with:
name: BBDown_win-x64
path: BBDown_${{ needs.set-date.outputs.date }}_win-x64.zip

- name: Upload Artifact [win-arm64]
uses: actions/upload-artifact@v4
with:
name: BBDown_win-arm64
path: BBDown_${{ needs.set-date.outputs.date }}_win-arm64.zip

build-linux-x64-arm64:
runs-on: ubuntu-latest
needs: set-date

steps:
- name: setup deb822 repos
run: |
if [[ $ImageOS == "ubuntu24" ]]; then
cat <<EOF > deb822sources
Types: deb
URIs: http://archive.ubuntu.com/ubuntu/
Suites: noble
Components: main restricted universe
Architectures: amd64
Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: noble-security
Components: main restricted universe
Architectures: amd64
Types: deb
URIs: http://archive.ubuntu.com/ubuntu/
Suites: noble-updates
Components: main restricted universe
Architectures: amd64
Types: deb
URIs: http://azure.ports.ubuntu.com/ubuntu-ports/
Suites: noble
Components: main restricted multiverse universe
Architectures: arm64
Types: deb
URIs: http://azure.ports.ubuntu.com/ubuntu-ports/
Suites: noble-updates
Components: main restricted multiverse universe
Architectures: arm64
EOF
sudo mv deb822sources /etc/apt/sources.list.d/ubuntu.sources
else
sudo mv config/crosscomp-sources.list /etc/apt/sources.list
fi
# https://learn.microsoft.com/zh-cn/dotnet/core/deploying/native-aot/cross-compile
- run: |
sudo dpkg --add-architecture arm64
sudo bash -c 'cat > /etc/apt/sources.list.d/arm64.list <<EOF
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiverse
EOF'
sudo sed -i -e 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list
sudo sed -i -e 's/deb mirror/deb [arch=amd64] mirror/g' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y curl wget libicu-dev libcurl4-openssl-dev zlib1g-dev libkrb5-dev clang llvm binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu zlib1g-dev:arm64
- uses: actions/checkout@v1

- name: Set up dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}

- name: Publish [linux]
run: |
dotnet publish BBDown -r linux-x64 -c Release -o artifact
dotnet publish BBDown -r linux-arm64 -c Release -o artifact-arm64
- name: Package [linux]
run: |
cd artifact
zip ../BBDown_${{ needs.set-date.outputs.date }}_linux-x64.zip BBDown
cd ../artifact-arm64
zip ../BBDown_${{ needs.set-date.outputs.date }}_linux-arm64.zip BBDown
- name: Upload Artifact [linux-x64]
uses: actions/upload-artifact@v4
with:
name: BBDown_linux-x64
path: BBDown_${{ needs.set-date.outputs.date }}_linux-x64.zip

- name: Upload Artifact[linux-arm64]
uses: actions/upload-artifact@v4
with:
name: BBDown_linux-arm64
path: BBDown_${{ needs.set-date.outputs.date }}_linux-arm64.zip

build-mac-x64-arm64:
runs-on: macos-latest
needs: set-date

steps:
- uses: actions/checkout@v1

- name: Set up dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}

- name: Publish [osx]
run: |
dotnet publish BBDown -r osx-x64 -c Release -o artifact
dotnet publish BBDown -r osx-arm64 -c Release -o artifact-arm64
- name: Package [osx]
run: |
cd artifact
zip ../BBDown_${{ needs.set-date.outputs.date }}_osx-x64.zip BBDown
cd ../artifact-arm64
zip ../BBDown_${{ needs.set-date.outputs.date }}_osx-arm64.zip BBDown
- name: Upload Artifact [osx-x64]
uses: actions/upload-artifact@v4
with:
name: BBDown_osx-x64
path: BBDown_${{ needs.set-date.outputs.date }}_osx-x64.zip

- name: Upload Artifact [osx-arm64]
uses: actions/upload-artifact@v4
with:
name: BBDown_osx-arm64
path: BBDown_${{ needs.set-date.outputs.date }}_osx-arm64.zip
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -16,6 +16,12 @@
# Mono auto generated files
mono_crash.*

# Rider
.idea

# macOS shit
.DS_Store

# Build results
[Dd]ebug/
[Dd]ebugPublic/
@@ -360,3 +366,11 @@ MigrationBackup/

# Fody - auto-generated XML schema
FodyWeavers.xsd

# debug log
debug_*.json

# dotnet run in `BBDown/` sub folder
/BBDown/*.mp4
/BBDown/*.xml
/BBDown/*.ass
19 changes: 19 additions & 0 deletions BBDown.Core/APP/Header/device.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax = "proto2";
option csharp_namespace = "BBDown.Core.Protobuf";

message Device {
optional int32 appId = 1;
optional int32 build = 2;
optional string buvid = 3;
optional string mobiApp = 4;
optional string platform = 5;
optional string device = 6;
optional string channel = 7;
optional string brand = 8;
optional string model = 9;
optional string osver = 10;
optional string fpLocal = 11;
optional string fpRemote = 12;
optional string versionName = 13;
optional string fp = 14;
}
8 changes: 8 additions & 0 deletions BBDown.Core/APP/Header/fawkesreq.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
syntax = "proto2";
option csharp_namespace = "BBDown.Core.Protobuf";

message FawkesReq {
optional string appkey = 1;
optional string env = 2;
optional string sessionId = 3;
}
12 changes: 12 additions & 0 deletions BBDown.Core/APP/Header/locale.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
syntax = "proto2";
option csharp_namespace = "BBDown.Core.Protobuf";

message Locale {
message LocaleIds {
optional string language = 1;
optional string script = 2;
optional string region = 3;
}
optional LocaleIds cLocale = 1;
optional LocaleIds sLocale = 2;
}
12 changes: 12 additions & 0 deletions BBDown.Core/APP/Header/metadata.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
syntax = "proto2";
option csharp_namespace = "BBDown.Core.Protobuf";

message Metadata {
optional string accessKey = 1;
optional string mobiApp = 2;
optional string device = 3;
optional int32 build = 4;
optional string channel = 5;
optional string buvid = 6;
optional string platform = 7;
}
25 changes: 25 additions & 0 deletions BBDown.Core/APP/Header/network.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
syntax = "proto2";
option csharp_namespace = "BBDown.Core.Protobuf";

message Network {
enum TYPE {
NT_UNKNOWN = 0;
WIFI = 1;
CELLULAR = 2;
OFFLINE = 3;
OTHERNET = 4;
ETHERNET = 5;
}
optional TYPE type = 1;
enum TF {
TF_UNKNOWN = 0;
U_CARD = 1;
U_PKG = 2;
C_CARD = 3;
C_PKG = 4;
T_CARD = 5;
T_PKG = 6;
}
optional TF tf = 2;
optional string oid = 3;
}
14 changes: 14 additions & 0 deletions BBDown.Core/APP/Header/restriction.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
syntax = "proto2";
option csharp_namespace = "BBDown.Core.Protobuf";

message Restriction {
optional bool teenagersMode = 1;
optional bool lessonsMode = 2;
enum Mode {
NORMAL = 0;
TEENAGERS = 1;
LESSONS = 2;
}
optional Mode mode = 3;
optional bool review = 4;
}
10 changes: 10 additions & 0 deletions BBDown.Core/APP/Payload/dmviewreq.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
syntax = "proto2";
option csharp_namespace = "BBDown.Core.Protobuf";

message DmViewReq {
optional int64 pid = 1;
optional int64 oid = 2;
optional int32 type = 3;
optional string spmid = 4;
optional int32 isHardBoot = 5;
}
25 changes: 25 additions & 0 deletions BBDown.Core/APP/Payload/playviewreq.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
syntax = "proto2";
option csharp_namespace = "BBDown.Core.Protobuf";

message PlayViewReq {
optional int64 epId = 1;
optional int64 cid = 2;
optional int64 qn = 3;
optional int32 fnver = 4;
optional int32 fnval = 5;
optional uint32 download = 6;
optional int32 forceHost = 7;
optional bool fourk = 8;
optional string spmid = 9;
optional string fromSpmid = 10;
optional int32 teenagersMode = 11;
enum CodeType {
NOCODE = 0;
CODE264 = 1;
CODE265 = 2;
CODEAV1 = 3;
}
optional CodeType preferCodecType = 12;
optional bool isPreview = 13;
optional int64 roomId = 14;
}
Loading