Skip to main content

Bilibili website crawler that can download videos, dm, comments, articles, and more.

Project description

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

MIT 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:

feedback

If you have any feedback, please contact us:guoziqi329@gmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bili_scraper-0.2.2.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bili_scraper-0.2.2-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file bili_scraper-0.2.2.tar.gz.

File metadata

  • Download URL: bili_scraper-0.2.2.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bili_scraper-0.2.2.tar.gz
Algorithm Hash digest
SHA256 c2deb3e9a4f94e6b213374aaee335d78b632ef1cd0da1c33df9495581bf4e9b8
MD5 3b447ab80cf0e3e469833688a24e33c6
BLAKE2b-256 bd8311b12dc753d70227ef7de7cbd509bf86ec04714e6753fd7e6422fd2a5266

See more details on using hashes here.

Provenance

The following attestation bundles were made for bili_scraper-0.2.2.tar.gz:

Publisher: python-publish.yml on Guoziqi329/bili-scraper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bili_scraper-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: bili_scraper-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 25.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bili_scraper-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 44484d9f166ee2899715c64b0c51e3b09618d13582ff52b22f05586637857320
MD5 d36c4c114f3e6be362ec22fb4c588c5c
BLAKE2b-256 82805f9ee274b00a5e05acb0cea8c29ba065bad3e6a81d77d25958b561950171

See more details on using hashes here.

Provenance

The following attestation bundles were made for bili_scraper-0.2.2-py3-none-any.whl:

Publisher: python-publish.yml on Guoziqi329/bili-scraper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page