{"id":24781927,"url":"https://github.com/timerring/bilitool","last_synced_at":"2025-04-09T08:08:11.794Z","repository":{"id":271205859,"uuid":"912694088","full_name":"timerring/bilitool","owner":"timerring","description":"实现持久化登录、下载、查询、上传视频(支持分p投稿）到 b 站等的 cli 工具以及 Python 库。The Python toolkit package and cli designed for interaction with Bilibili.","archived":false,"fork":false,"pushed_at":"2025-04-07T13:19:23.000Z","size":1561,"stargazers_count":60,"open_issues_count":2,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T14:28:08.940Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://bilitool.timerring.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timerring.png","metadata":{"files":{"readme":"README-en.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-06T07:47:46.000Z","updated_at":"2025-04-07T13:19:27.000Z","dependencies_parsed_at":"2025-03-23T15:29:31.513Z","dependency_job_id":"a9e37831-3f2a-4e1b-bade-519d2313f90d","html_url":"https://github.com/timerring/bilitool","commit_stats":null,"previous_names":["timerring/biliup-py","timerring/biliupload","timerring/bilitool"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timerring%2Fbilitool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timerring%2Fbilitool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timerring%2Fbilitool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timerring%2Fbilitool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timerring","download_url":"https://codeload.github.com/timerring/bilitool/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247670630,"owners_count":20976606,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-29T11:02:38.666Z","updated_at":"2025-04-09T08:08:11.789Z","avatar_url":"https://github.com/timerring.png","language":"Python","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"assets/headerDark.svg\" /\u003e\n    \u003cimg src=\"assets/headerLight.svg\" alt=\"bilitool\" /\u003e\n  \u003c/picture\u003e\n  \u003cp\u003e \u003c/p\u003e\n\n[简体中文](./README.md) | English\n\n\u003c/div\u003e\n\n\u003e Welcome to use, provide feedback, and contribute to this project via PRs. Please do not use it for purposes that violate community guidelines.\n\n`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.\n\nThe project is designed following the MVC architecture:\n\n```mermaid\ngraph TD\n    subgraph Model\n        M1[Model]\n    end\n\n    subgraph Database\n        DB1[JSON]\n    end\n\n    subgraph Controller\n        C1[DownloadController]\n        C2[UploadController]\n        C3[LoginController]\n        C4[FeedController]\n    end\n\n    subgraph View\n        V1[CLI]\n    end\n\n    subgraph Utility\n        U1[CheckFormat]\n        U2[IPInfo]\n    end\n\n    subgraph Download\n        D1[BiliDownloader]\n    end\n\n    subgraph Upload\n        U3[BiliUploader]\n    end\n\n    subgraph Feed\n        F1[BiliVideoList]\n    end\n\n    subgraph Login\n        L1[LoginBili]\n        L2[LogoutBili]\n        L3[CheckBiliLogin]\n    end\n\n    subgraph Authenticate\n        A1[WbiSign]\n    end\n\n    M1 --\u003e DB1\n    DB1 --\u003e M1\n\n    M1 \u003c--\u003e C1\n    M1 \u003c--\u003e C2\n    M1 \u003c--\u003e C4\n\n    C1 --\u003e D1\n    C2 --\u003e U3\n\n    V1 --\u003e Utility\n\n    C3 --\u003e L1\n    C3 --\u003e L2\n    C3 --\u003e L3\n\n    C4 --\u003e F1\n\n    V1 --\u003e C1\n    V1 --\u003e C2\n    V1 --\u003e C3\n    V1 --\u003e A1 --\u003e C4\n\n```\n\n## Major Features\n\n- `bilitool login` remembers and stores login status\n  - Supports exporting `cookies.json` for use in other projects\n- `bilitool logout` logs out\n  - Logs out and clears cookies to protect privacy and prevent leaks\n- `bilitool check` checks login status\n- `bilitool upload` uploads videos\n  - Supports various custom parameters for uploading\n  - Supports uploading videos with YAML configuration and parsing\n  - Displays logs and upload progress\n  - Supports **automatic speed test and selection of the best route** (default)\n  - Supports specifying upload lines (`qn`, `bldsa`, `ws`, `bda2`, `tx`)\n  - Supports uploading cover image\n- `bilitool append` appends videos to existing videos (multi-part)\n- `bilitool download` downloads videos\n  - Supports downloading with `bvid` and `avid` identifiers\n  - Supports downloading danmaku (comments)\n  - Supports downloading in multiple qualities\n  - Supports downloading multi-part videos\n  - Displays logs and download progress\n- `bilitool list` queries the status of past uploaded videos\n  - Supports querying videos with various statuses\n  - Displays reasons if video review fails\n- `bilitool convert` converts video identifiers\n  - Supports conversion between `bvid` and `avid`\n- `bilitool show` displays detailed video information\n  - Supports viewing basic video information and interaction data\n- `bilitool ip` displays IP information\n  - Supports querying specified IP addresses\n- Append videos to existing videos (planned support)\n\n\u003e Add `-h` or `--help` to the above commands to view command help information.\n\u003e \n\u003e For more detailed commands, refer to the [project documentation](https://bilitool.timerring.com).\n\n## Installation\n\n\u003e Recommended Python version \u003e= 3.10.\n\n```bash\npip install bilitool\n```\n\nAlternatively, you can download the compiled CLI tool and run it directly [Download Link](https://github.com/timerring/bilitool/releases).\n\n## Usage\n\n### CLI Method\n\n\u003e For more detailed commands, refer to the [project documentation](https://bilitool.timerring.com).\n\nHelp information:\n\n```\nusage: bilitool [-h] [-V] {login,logout,upload,check,download,list,ip} ...\n\nThe Python toolkit package and cli designed for interaction with Bilibili\n\npositional arguments:\n  {login,logout,upload,append,check,download,list,show,convert,ip}\n                        Subcommands\n    login               Login and save the cookie\n    logout              Logout the current account\n    upload              Upload the video\n    append              Append the video\n    check               Check if the user is logged in\n    download            Download the video\n    list                Get the uploaded video list\n    show                Show the video detailed info\n    convert             Convert between avid and bvid\n    ip                  Get the ip info\n\noptions:\n  -h, --help            show this help message and exit\n  -V, --version         Print version information\n```\n\n### API Method\n\n\u003e For more detailed functions and documentation, refer to the [project documentation](https://bilitool.timerring.com).\n\n```python\nfrom bilitool import LoginController, UploadController, DownloadController, FeedController, IPInfo, CheckFormat\n\n# Login\nLoginController().login_bilibili(export: bool)\n# Logout\nLoginController().logout_bilibili()\n# Check login\nLoginController().check_bilibili_login()\n\n# Upload\nUploadController().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, cdn: str)\n\n# Append\nUploadController().append_video_entry(video_path: str, bvid: str, cdn: str)\n\n# Download\nDownloadController().download_video_entry(vid: str, danmaku: bool, quality: int, chunksize: int, multiple: bool)\n\n# Query recent video list\nFeedController().print_video_list_info(size: int, status: str)\n\n# Query video information\nFeedController().print_video_info(vid: str)\n\n# Convert video identifier\nCheckFormat().convert_bv_and_av(vid: str)\n\n# Query IP information\nIPInfo.get_ip_address(ip: str)\n```\n\n## Acknowledgments\n\n- Thanks to [bilibili-API-collect](https://github.com/SocialSisterYi/bilibili-API-collect) for providing the API collection.","funding_links":[],"categories":["开发"],"sub_categories":["直播脚本"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimerring%2Fbilitool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimerring%2Fbilitool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimerring%2Fbilitool/lists"}