8000 build: build version 0.0.2 by timerring · Pull Request #6 · timerring/bilitool · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

build: build version 0.0.2 #6

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 11, 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
Loading
Diff view
Diff view
34 changes: 24 additions & 10 deletions README-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,48 +53,62 @@ options:
```bash
biliupload login
```
Then you can scan the QR code or click the link to login. The `cookie.json` will be saved in the current directory.

Then you can scan the QR code or click the link to login. If you add the `--export` parameter when inputting the command, the `cookie.json` file will be exported to the current directory (the `cookie.json` file can be used for other projects).

![](https://cdn.jsdelivr.net/gh/timerring/scratchpad2023/2024/2025-01-08-11-54-34.png)

`biliupload login -h ` print help information:

```
usage: biliupload login [-h] [--export]

options:
-h, --help show this help message and exit
--export (default is false) export the login cookie file
```

### Upload

Help information:
`biliupload upload -h ` print help information:

```bash
$ biliupload upload -h
usage: biliupload upload [-h] -c COOKIES [-y YAML] [--copyright COPYRIGHT] [--title TITLE] [--desc DESC] [--tid TID] [--tag TAG] [--line LINE] video_path
usage: biliupload upload [-h] [-y YAML] [--copyright COPYRIGHT] [--title TITLE] [--desc DESC] [--tid TID] [--tag TAG] [--line LINE] [--source SOURCE] [--cover COVER]
[--dynamic DYNAMIC]
video_path

positional arguments:
video_path (required) the path to video file

options:
-h, --help show this help message and exit
-c COOKIES, --cookies COOKIES
The path to cookies
-y YAML, --yaml YAML The path to yaml file(if yaml file is provided, the arguments below will be ignored)
--copyright COPYRIGHT
(default is 2) 1 for original, 2 for reprint
--title TITLE (default is video name) The title of video
--desc DESC (default is empty) The description of video
--tid TID (default is 138) For more info to the type id, refer to https://biliup.github.io/tid-ref.html
--tag TAG (default is biliupload) video tags, separated by comma
--tag TAG (default is biliupload) video tags, separated by comma
--line LINE (default is bda2) line refer to https://biliup.github.io/upload-systems-analysis.html
--source SOURCE (default is 来源于网络) The source of video (if your video is re-print)
--cover COVER (default is empty) The cover of video (if you want to customize, set it as the path to your cover image)
--dynamic DYNAMIC (default is empty) The dynamic information
```

Example:

your can refer the [`template/example-config.yaml`](https://github.com/timerring/biliupload/tree/main/template/example-config.yaml) to know more about the yaml template.

```bash
# the video path and cookie path are required
biliupload upload /path/to/your/video.mp4 -c /path/to/your/cookie.json
# the video path is required
biliupload upload /path/to/your/video.mp4

# upload the video with command line parameters
biliupload upload /path/to/your/video.mp4 -c /path/to/your/cookie.json --title "test" --desc "test" --tid 138 --tag "test" --line bda2
biliupload upload /path/to/your/video.mp4 --title "test" --desc "test" --tid 138 --tag "test" --line bda2

# upload the video with yaml config
biliupload upload /path/to/your/video.mp4 -c /path/to/your/cookie.json -y /path/to/your/upload/template.yaml
biliupload upload /path/to/your/video.mp4 -y /path/to/your/upload/template.yaml
```

## Acknowledgments
Expand Down
40 changes: 28 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

## 功能

- 保存 `cookies.json` 用于 bilibili 登录
- 持久记忆存储登录状态,同样可以导出 `cookies.json` 用于其他项目
- 上传视频
- 支持上传视频的 yaml 配置
- 更新 cookies(正在开发)
- 下载视频(正在开发)
- 显示上传进度(正在开发)
- 追加视频到已有的视频(正在开发)
- 显示已发布的视频信息(预计支持)
- 下载视频(预计支持)
- 更新 cookies(预计支持)
- 显示上传进度(预计支持)

> 目前我实现了 `login` 和 `upload` 功能,并会继续实现其他功能。欢迎使用并给我更多反馈。欢迎贡献此项目。

Expand Down Expand Up @@ -53,25 +53,38 @@ options:
```bash
biliupload login
```
然后你可以扫描二维码或点击链接登录,`cookie.json` 将保存在当前目录。

然后你可以扫描二维码或点击链接登录,如果输入命令时加上 `--export` 参数,则会导出 `cookie.json` 文件到当前目录(cookie.json 文件可以用于其他项目)。

![](https://cdn.jsdelivr.net/gh/timerring/scratchpad2023/2024/2025-01-08-11-54-34.png)

`biliupload login -h ` 打印帮助信息:

```
usage: biliupload login [-h] [--export]

options:
-h, --help show this help message and exit
--export (default is false) export the login cookie file
```

### 上传

> 注意:上传功能需要先登录,登录后会记忆登录状态,下次上传时不需要再次登录。

`biliupload upload -h ` 打印帮助信息:

```bash
$ biliupload upload -h
usage: biliupload upload [-h] -c COOKIES [-y YAML] [--copyright COPYRIGHT] [--title TITLE] [--desc DESC] [--tid TID] [--tag TAG] [--line LINE] video_path
usage: biliupload upload [-h] [-y YAML] [--copyright COPYRIGHT] [--title TITLE] [--desc DESC] [--tid TID] [--tag TAG] [--line LINE] [--source SOURCE] [--cover COVER]
[--dynamic DYNAMIC]
video_path

positional arguments:
video_path (required) the path to video file

options:
-h, --help show this help message and exit
-c COOKIES, --cookies COOKIES
The path to cookies
-y YAML, --yaml YAML The path to yaml file(if yaml file is provided, the arguments below will be ignored)
--copyright COPYRIGHT
(default is 2) 1 for original, 2 for reprint
Expand All @@ -80,21 +93,24 @@ options:
--tid TID (default is 138) For more info to the type id, refer to https://biliup.github.io/tid-ref.html
--tag TAG (default is biliupload) video tags, separated by comma
--line LINE (default is bda2) line refer to https://biliup.github.io/upload-systems-analysis.html
--source SOURCE (default is 来源于网络) The source of video (if your video is re-print)
--cover COVER (default is empty) The cover of video (if you want to customize, set it as the path to your cover image)
--dynamic DYNAMIC (defa 8000 ult is empty) The dynamic information
```

示例:

你可以参考 [`template/example-config.yaml`](https://github.com/timerring/biliupload/tree/main/template/example-config.yaml) 了解更多的 yaml 模板。

```bash
# 视频路径和 cookie 路径是必需的
biliupload upload /path/to/your/video.mp4 -c /path/to/your/cookie.json
# 视频路径是必需的
biliupload upload /path/to/your/video.mp4

# 使用命令行参数上传视频
biliupload upload /path/to/your/video.mp4 -c /path/to/your/cookie.json --title "test" --desc "test" --tid 138 --tag "test" --line bda2
biliupload upload /path/to/your/video.mp4 --title "test" --desc "test" --tid 138 --tag "test" --line bda2

# 使用 yaml 配置上传视频
biliupload upload /path/to/your/video.mp4 -c /path/to/your/cookie.json -y /path/to/your/upload/template.yaml
biliupload upload /path/to/your/video.mp4 -y /path/to/your/upload/template.yaml
```

## Acknowledgments
Expand Down
2 changes: 1 addition & 1 deletion biliupload/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def cli():
level=logging.INFO
)
parser = argparse.ArgumentParser(description='Python implementation of biliup')
parser.add_argument('-V', '--version', action='version', version='biliupload 1.0', help='Print version information')
parser.add_argument('-V', '--version', action='version', version='biliupload 0.0.2', help='Print version information')

subparsers = parser.add_subparsers(dest='subcommand', help='Subcommands')

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "biliupload" # make sure your module name is unique
version = "0.0.1"
version = "0.0.2"
authors = [
{ name="timerring"},
]
Expand Down
0