-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: 添加独立的文档页面,移除 README 中的相关描述 (#127)
- Loading branch information
Showing
23 changed files
with
638 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
**/target | ||
auth_data | ||
*.sqlite | ||
*.json | ||
video | ||
debug* | ||
node_modules | ||
docs/.vitepress/cache | ||
docs/.vitepress/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import { defineConfig } from "vitepress"; | ||
import taskLists from "markdown-it-task-lists"; | ||
|
||
// https://vitepress.dev/reference/site-config | ||
export default defineConfig({ | ||
title: "bili-sync", | ||
description: "基于 rust tokio 的哔哩哔哩同步工具", | ||
lang: "zh-Hans", | ||
sitemap: { | ||
hostname: "https://bili-sync.github.io", | ||
}, | ||
lastUpdated: true, | ||
cleanUrls: true, | ||
metaChunk: true, | ||
themeConfig: { | ||
outline: { | ||
label: "页面导航", | ||
level: "deep", | ||
}, | ||
// https://vitepress.dev/reference/default-theme-config | ||
nav: [ | ||
{ text: "主页", link: "/" }, | ||
{ | ||
text: "更新日志", | ||
items: [ | ||
{ | ||
text: "程序本体", | ||
link: "https://github.com/amtoaer/bili-sync/releases", | ||
}, | ||
{ | ||
text: "文档页面", | ||
link: "https://github.com/search?q=repo:amtoaer/bili-sync+docs&type=commits", | ||
}, | ||
], | ||
}, | ||
], | ||
sidebar: [ | ||
{ | ||
text: "简介", | ||
items: [ | ||
{ text: "什么是 bili-sync?", link: "/introduction" }, | ||
{ text: "快速开始", link: "/quick-start" }, | ||
], | ||
}, | ||
{ | ||
text: "细节", | ||
items: [ | ||
{ text: "配置文件", link: "/configuration" }, | ||
{ text: "命令行参数", link: "/args" }, | ||
], | ||
}, | ||
{ | ||
text: "参考", | ||
items: [ | ||
{ text: "获取收藏夹信息", link: "/favorite" }, | ||
{ | ||
text: "获取视频合集/视频列表信息", | ||
link: "/collection", | ||
}, | ||
], | ||
}, | ||
], | ||
socialLinks: [ | ||
{ icon: "github", link: "https://github.com/amtoaer/bili-sync" }, | ||
], | ||
search: { | ||
provider: "local", | ||
}, | ||
notFound: { | ||
title: "你来到了没有知识的荒原", | ||
quote: "这里什么都没有", | ||
linkText: "返回首页", | ||
}, | ||
docFooter: { | ||
prev: "上一页", | ||
next: "下一页", | ||
}, | ||
lastUpdated: { | ||
text: "上次更新于", | ||
}, | ||
returnToTopLabel: "回到顶部", | ||
sidebarMenuLabel: "菜单", | ||
darkModeSwitchLabel: "主题", | ||
lightModeSwitchTitle: "切换到浅色模式", | ||
darkModeSwitchTitle: "切换到深色模式", | ||
}, | ||
markdown: { | ||
config: (md) => { | ||
md.use(taskLists); | ||
}, | ||
theme: { | ||
light: "github-light", | ||
dark: "github-dark", | ||
}, | ||
}, | ||
head: [ | ||
["link", { rel: "icon", type: "image/svg+xml", href: "/icon.svg" }], | ||
["link", { rel: "icon", type: "image/png", href: "/icon.png" }], | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# 命令行参数 | ||
|
||
程序支持有限的命令行参数,可以通过执行 `bili-sync-rs --help` 查看说明。 | ||
|
||
```shell | ||
bili-sync/target/debug docs_vitepress* ⇡ | ||
❯ ./bili-sync-rs --help | ||
基于 rust tokio 编写的 bilibili 收藏夹同步下载工具 | ||
|
||
Usage: bili-sync-rs [OPTIONS] | ||
|
||
Options: | ||
-s, --scan-only [env: SCAN_ONLY=] | ||
-l, --log-level <LOG_LEVEL> [env: RUST_LOG=] [default: None,bili_sync=info] | ||
-h, --help Print help | ||
-V, --version Print version | ||
``` | ||
|
||
可以看到除版本和帮助信息外,程序仅支持两个参数,参数除可以通过命令行设置外,还可通过环境变量设置。 | ||
|
||
## `--scan-only` | ||
|
||
`--scan-only` 参数用于仅扫描列表,而不实际执行下载操作。该参数的主要目的是[方便用户从 v1 迁移](https://github.com/amtoaer/bili-sync/issues/66#issuecomment-2066642481),新用户不需要关注。 | ||
|
||
## `--log-level` | ||
|
||
`--log-level` 参数用于设置日志级别,一般可以维持默认。该参数与 Rust 程序中 `RUST_LOG` 的语义相同,可以查看[相关文档](https://docs.rs/env_logger/latest/env_logger/#enabling-logging)获取详细信息。 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# 获取视频合集/视频列表信息 | ||
|
||
要说明的是,视频合集和视频列表虽然在哔哩哔哩网站交互上行为类似,但在接口层级是两个不同的概念。可以简单将视频列表理解为一个老旧版本的视频合集。 | ||
|
||
在调试过程中我注意到视频列表的 ID 可以通过某种规则转换为视频合集的 ID,从而成功调用视频合集的接口,但由于不清楚具体的转换策略,在 bili-sync 的实现中还是将其当成两种类型处理。 | ||
|
||
## 区分方法 | ||
|
||
这两种类型可以很容易地通过如下手段区分: | ||
1. 两者的名称前缀不同,视频合集会有显式的“合集”字样 | ||
2. 两者的图标不同 | ||
|
||
如下图所示,“合集【命运方舟全剧情解说】”是视频合集,而“阿拉德冒险记”是视频列表。 | ||
![image](./assets/collection.png) | ||
|
||
在 bili-sync 的设计中,视频合集的 key 为 `season:{mid}:{season_id}`,而视频列表的 key 为 `series:{mid}:{series_id}`。 | ||
|
||
## 参数获取 | ||
|
||
了解了区分方法后,我们可以通过如下步骤获取视频合集/视频列表的信息。 | ||
|
||
### 视频合集 | ||
|
||
![image](./assets/season.png) | ||
|
||
该视频合集的 key 为 `season:521722088:1987140`。 | ||
|
||
### 视频列表 | ||
|
||
![image](./assets/series.png) | ||
|
||
该视频列表的 key 为 `series:521722088:387214`。 |
Oops, something went wrong.