|
| 1 | +# biliupload |
| 2 | + |
| 3 | +English | [简体中文](./README.md) |
| 4 | + |
| 5 | +> This is a Python implementation of [biliup-rs](https://github.com/biliup/biliup-rs). |
| 6 | +
|
| 7 | +`biliupload` is a command line tool for logining and uploading videos to bilibili, which can also be used as a library for other projects. |
| 8 | + |
| 9 | +## Features |
| 10 | + |
| 11 | +- Save `cookies.json` for bilibili by scanning QR code or web login |
| 12 | +- `Upload` videos |
| 13 | +- Support uploading videos with yaml config |
| 14 | +- `Append` videos to a existing video (WIP) |
| 15 | +- `Show` the published videos infomation (planned feature) |
| 16 | +- `Download` videos (planned feature) |
| 17 | +- `Renew` the cookies (planned feature) |
| 18 | +- Show the upload progress (planned feature) |
| 19 | + |
| 20 | +> Over the passed few days, I have implemented the `login` and `upload` functions, and will continue to implement the other functions. Welcome to use and give me more feedback. And welcome to contribute to this project. |
| 21 | +
|
| 22 | +## Usage |
| 23 | + |
| 24 | +### Installation |
| 25 | + |
| 26 | +> Recommend Python version >= 3.10. |
| 27 | +
|
| 28 | +```bash |
| 29 | +pip install biliupload |
| 30 | +``` |
| 31 | + |
| 32 | +Help information: |
| 33 | + |
| 34 | +``` |
| 35 | +usage: biliupload [-h] [-V] {login,upload} ... |
| 36 | +
|
| 37 | +Python implementation of biliup |
| 38 | +
|
| 39 | +positional arguments: |
| 40 | + {login,upload} Subcommands |
| 41 | + login login and save the cookies |
| 42 | + upload upload the video |
| 43 | +
|
| 44 | +options: |
| 45 | + -h, --help show this help message and exit |
| 46 | + -V, --version Print version information |
| 47 | +``` |
| 48 | + |
| 49 | +### Login |
| 50 | + |
| 51 | +```bash |
| 52 | +biliupload login |
| 53 | +``` |
| 54 | +Then you can scan the QR code or click the link to login. The `cookie.json` will be saved in the current directory. |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | +### Upload |
| 59 | + |
| 60 | +Help information: |
| 61 | + |
| 62 | +```bash |
| 63 | +$ biliupload upload -h |
| 64 | +usage: biliupload upload [-h] -c COOKIES [-y YAML] [--copyright COPYRIGHT] [--title TITLE] [--desc DESC] [--tid TID] [--tags TAGS] [--line LINE] video_path |
| 65 | + |
| 66 | +positional arguments: |
| 67 | + video_path (required) the path to video file |
| 68 | + |
| 69 | +options: |
| 70 | + -h, --help show this help message and exit |
| 71 | + -c COOKIES, --cookies COOKIES |
| 72 | + The path to cookies |
| 73 | + -y YAML, --yaml YAML The path to yaml file(if yaml file is provided, the arguments below will be ignored) |
| 74 | + --copyright COPYRIGHT |
| 75 | + (default is 2) 1 for original, 2 for reprint |
| 76 | + --title TITLE (default is video name) The title of video |
| 77 | + --desc DESC (default is empty) The description of video |
| 78 | + --tid TID (default is 138) For more info to the type id, refer to https://biliup.github.io/tid-ref.html |
| 79 | + --tags TAGS (default is biliupload) video tags, separated by comma |
| 80 | + --line LINE (default is bda2) line refer to https://biliup.github.io/upload-systems-analysis.html |
| 81 | +``` |
| 82 | + |
| 83 | +Example: |
| 84 | + |
| 85 | +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. |
| 86 | + |
| 87 | +```bash |
| 88 | +# the video path and cookie path are required |
| 89 | +biliupload upload /path/to/your/video.mp4 -c /path/to/your/cookie.json |
| 90 | + |
| 91 | +# upload the video with command line parameters |
| 92 | +biliupload upload /path/to/your/video.mp4 -c /path/to/your/cookie.json --title "test" --desc "test" --tid 138 --tags "test" --line bda2 |
| 93 | + |
| 94 | +# upload the video with yaml config |
| 95 | +biliupload upload /path/to/your/video.mp4 -c /path/to/your/cookie.json -y /path/to/your/upload/template.yaml |
| 96 | +``` |
| 97 | + |
| 98 | +## Acknowledgments |
| 99 | + |
| 100 | +- Thanks to [bilibili-API-collect](https://github.com/SocialSisterYi/bilibili-API-collect) for the API collection. |
| 101 | +- Thanks to [biliup-rs](https://github.com/biliup/biliup-rs) for the inspiration. |
0 commit comments