bili-scraper
Bilibili website crawler that can download videos, dm, comments, articles, and more.
This project is for learning purposes only, please don’t use it for commercial purposes.
本项目仅用于学习目的,请勿用于商业用途。
License
Author
start
You can install it using the pip install bili-scraper command
Demo
from bili_scraper import BiliScraper
import json
if __name__ == '__main__':
bilibili = BiliScraper()
# with open('cookie.json', 'r') as f:
# cookie = json.load(f)
# bilibili.set_cookies(cookie)
bilibili.Login()
with open('cookie.json', 'w') as f:
json.dump(dict(bilibili.getCookie()), f)
bilibili.getVideo('BV15bdmBNEZr', output_dir='./video', quick_splicing=True)
comments = bilibili.getVideoComments('BV15bdmBNEZr', './img', 1)
with open("comments.json", "w", encoding="utf-8") as f:
json.dump(comments, f, ensure_ascii=False)
dm = bilibili.getVideoDm("BV15bdmBNEZr")
with open('dm.json', 'w', encoding='utf-8') as f:
json.dump(dm, f, ensure_ascii=False)
bilibili.getArticle("1199888451663560745", 'doc', 'doc.docx', './article/img/')
Thanks
This project uses code from:
- bilibili-API-collect by [@SocialSisterYi], licensed under CC-BY-NC 4.0
feedback
If you have any feedback, please contact us:guoziqi329@gmail.com
Metadata
Release files for bili-scraper 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bili_scraper-0.2.2.tar.gz | 22.6 kB | With provenance | Details for bili_scraper-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bili_scraper-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for bili_scraper-0.2.2-py3-none-any.whl |
Total release size: 48.4 kB
Release files / bili_scraper-0.2.2.tar.gz
| Download URL | bili_scraper-0.2.2.tar.gz |
|---|---|
| Size | 22.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c2deb3e9a4f94e6b213374aaee335d78b632ef1cd0da1c33df9495581bf4e9b8
|
|
BLAKE2b-256 checksum How to use checksums |
bd8311b12dc753d70227ef7de7cbd509bf86ec04714e6753fd7e6422fd2a5266
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 15, 2026.
Transparency logRelease files / bili_scraper-0.2.2-py3-none-any.whl
| Download URL | bili_scraper-0.2.2-py3-none-any.whl |
|---|---|
| Size | 25.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
44484d9f166ee2899715c64b0c51e3b09618d13582ff52b22f05586637857320
|
|
BLAKE2b-256 checksum How to use checksums |
82805f9ee274b00a5e05acb0cea8c29ba065bad3e6a81d77d25958b561950171
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 15, 2026.
Transparency logSecurity for bili-scraper 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for bili_scraper-0.2.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 15, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.