8000 docs: update docs and interface by timerring · Pull Request #32 · timerring/bilitool · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

docs: update docs and interface #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 125 additions & 16 deletions README-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,112 @@

`bilitool` is a Python toolkit that provides features such as persistent login, video download, and video upload to Bilibili. It can be used via command-line interface (CLI) or as a library in other projects.

## Major features
The project is designed following the MVC architecture:

```mermaid
graph TD
subgraph Model
M1[Model]
end

subgraph Database
DB1[JSON]
end

subgraph Controller
C1[DownloadController]
C2[UploadController]
C3[LoginController]
C4[FeedController]
end

subgraph View
V1[CLI]
end

subgraph Utility
U1[CheckFormat]
U2[IPInfo]
end

subgraph Download
D1[BiliDownloader]
end

subgraph Upload
U3[BiliUploader]
end

subgraph Feed
F1[BiliVideoList]
end

subgraph Login
L1[LoginBili]
L2[LogoutBili]
L3[CheckBiliLogin]
end

subgraph Authenticate
A1[WbiSign]
end

M1 --> DB1
DB1 --> M1

M1 <--> C1
M1 <--> C2
M1 <--> C4

C1 --> D1
C2 --> U3

V1 --> Utility

C3 --> L1
C3 --> L2
C3 --> L3

C4 --> F1

V1 --> C1
V1 --> C2
V1 --> C3
V1 --> A1 --> C4

```

## Major Features

- `bilitool login` remembers and stores login status
- Supports exporting `cookies.json` for use in other projects
- `bilitool logout` logs out
- Logs out and clears cookies to protect privacy and prevent leaks
- `bilitool check` checks login status
- `bilitool upload` uploads videos
- Supports various custom parameters for upload
- Supports YAML configuration and parsing for video uploads
- Supports various custom parameters for uploading
- Supports uploading videos with YAML configuration and parsing
- Displays logs and upload progress
- `bilitool download` downloads videos
- Supports downloading by `bvid` and `avid`
- Supports downloading comments
- Supports downloading in various qualities
- Supports downloading with `bvid` and `avid` identifiers
- Supports downloading danmaku (comments)
- Supports downloading in multiple qualities
- Supports downloading multi-part videos
- Displays logs and download progress
- `bilitool list` queries the status of past uploaded videos on the account
- `bilitool list` queries the status of past uploaded videos
- Supports querying videos with various statuses
- If a video fails review, the reason is displayed
- `bilitool convert` converts video IDs
- Displays reasons if video review fails
- `bilitool convert` converts video identifiers
- Supports conversion between `bvid` and `avid`
- `bilitool show` displays detailed video information
- Supports viewing basic video information and interaction status data
- `bilitool ip` displays the request IP address
- Supports viewing basic video information and interaction data
- `bilitool ip` displays IP information
- Supports querying specified IP addresses
- Append videos to existing videos (planned support)

> Add `-h` or `--help` to the above commands to view command help information.
>
> For more detailed commands, refer to [the documentation](https://bilitool.timerring.com).
> For more detailed commands, refer to the [project documentation](https://bilitool.timerring.com).

## Installation

Expand All @@ -46,13 +121,13 @@
pip install bilitool
```

Alternatively, you can download the compiled CLI tool and run it directly [Download link](https://github.com/timerring/bilitool/releases).
Alternatively, you can download the compiled CLI tool and run it directly [Download Link](https://github.com/timerring/bilitool/releases).

## Usage

### CLI Method

> For more detailed commands, refer to [the documentation](https://bilitool.timerring.com), which is not elaborated here.
> For more detailed commands, refer to the [project documentation](https://bilitool.timerring.com).

Help information:

Expand All @@ -72,7 +147,7 @@ positional arguments:
list Get the uploaded video list
show Show the video detailed info
convert Convert between avid and bvid
ip Get the IP info
ip Get the ip info

options:
-h, --help show this help message and exit
Expand All @@ -81,7 +156,41 @@ options:

### API Method

Currently being updated and will be available soon.
> For more detailed functions and documentation, refer to the [project documentation](https://bilitool.timerring.com).

```python
from bilitool.controller.login_controller import LoginController
from bilitool.controller.upload_controller import UploadController
from bilitool.controller.download_controller import DownloadController
from bilitool.controller.feed_controller import FeedController
from bilitool.utils.get_ip_info import IPInfo
from bilitool.utils.check_format import CheckFormat

# Login
LoginController().login_bilibili(export: bool)
# Logout
LoginController().logout_bilibili()
# Check login
LoginController().check_bilibili_login()

# Upload
UploadController().upload_video_entry(video_path: str, yaml: str, line: str, copyright: int, tid: int, title: str, desc: str, tag: str, source: str, cover: str, dynamic: str)

# Download
DownloadController().download_video_entry(vid: str, danmaku: bool, quality: int, chunksize: int, multiple: bool)

# Query recent video list
FeedController().print_video_list_info(size: int, status: str)

# Query video information
FeedController().print_video_info(vid: str)

# Convert video identifier
CheckFormat().convert_bv_and_av(vid: str)

# Query IP information
IPInfo.get_ip_address(ip: str)
```

## Acknowledgments

Expand Down
113 changes: 111 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,81 @@

`bilitool` 是一个 python 的工具库,实现持久化登录,下载视频,上传视频到 bilibili 等功能,可以使用命令行 cli 操作,也可以作为其他项目的库使用。

项目仿照 MVC 架构进行设计:

```mermaid
graph TD
subgraph Model
M1[Model]
end

subgraph Database
DB1[JSON]
end

subgraph Controller
C1[DownloadController]
C2[UploadController]
C3[LoginController]
C4[FeedController]
end

subgraph View
V1[CLI]
end

subgraph Utility
U1[CheckFormat]
U2[IPInfo]
end

subgraph Download
D1[BiliDownloader]
end

subgraph Upload
U3[BiliUploader]
end

subgraph Feed
F1[BiliVideoList]
end

subgraph Login
L1[LoginBili]
L2[LogoutBili]
L3[CheckBiliLogin]
end

subgraph Authenticate
A1[WbiSign]
end

M1 --> DB1
DB1 --> M1

M1 <--> C1
M1 <--> C2
M1 <--> C4

C1 --> D1
C2 --> U3

V1 --> Utility

C3 --> L1
C3 --> L2
C3 --> L3

C4 --> F1

V1 --> C1
V1 --> C2
V1 --> C3
V1 --> A1 --> C4

```

## Major features

- `bilitool login` 记忆存储登录状态
Expand Down Expand Up @@ -81,8 +156,42 @@ options:

### 接口调用方式

正在更新,即将开放。
> 更详细的函数及文档可以参考[项目文档](https://bilitool.timerring.com)。

```python
from bilitool.controller.login_controller import LoginController
from bilitool.controller.upload_controller import UploadController
from bilitool.controller.downl 8FEC oad_controller import DownloadController
from bilitool.controller.feed_controller import FeedController
from bilitool.utils.get_ip_info import IPInfo
from bilitool.utils.check_format import CheckFormat

# 登录
LoginController().login_bilibili(export: bool)
# 退出登录
LoginController().logout_bilibili()
# 检查登录
LoginController().check_bilibili_login()

# 上传
UploadController().upload_video_entry(video_path: str, yaml: str, line: str, copyright: int, tid: int, title: str, desc: str, tag: str, source: str, cover: str, dynamic: str)

# 下载
DownloadController().download_video_entry(vid: str, danmaku: bool, quality: int, chunksize: int, multiple: bool)

# 查询近期投稿列表
FeedController().print_video_list_info(size: int, status: str)

# 查询视频信息
FeedController().print_video_info(vid: str)

# 查询视频编号
CheckFormat().convert_bv_and_av(vid: str)

# 查询 IP 信息
IPInfo.get_ip_address(ip: str)
```

## Acknowledgments

- 感谢 [bilibili-API-collect](https://github.com/SocialSisterYi/bilibili-API-collect) 提供的 API 集合。
- 感谢 [bilibili-API-collect](https://github.com/SocialSisterYi/bilibili-API-collect) 提供的 API 集合。
Loading
0