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.0.tar.gz (21.2 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.0-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bili_scraper-0.2.0.tar.gz
  • Upload date:
  • Size: 21.2 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.0.tar.gz
Algorithm Hash digest
SHA256 508c74fd23a51309afb860552136a7a72566082a046df24a1c3dc17d2a82eb0a
MD5 3b52f9ca517266ad075a73d3af4661d7
BLAKE2b-256 c7604c281fe78fd7d5dc05d685ba83679e94e924822c24689bafc4e3e133ad89

See more details on using hashes here.

Provenance

The following attestation bundles were made for bili_scraper-0.2.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: bili_scraper-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 23.6 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8dc6e125ad62a3473f2ccf9221ae979637d242398c6fc913f45f50cad91a720a
MD5 aa657c2ac2b237254ab6d09e799177d4
BLAKE2b-256 fe433fd7a58d040a98743d43070331799352bdfc82a78829682f15134d929c05

See more details on using hashes here.

Provenance

The following attestation bundles were made for bili_scraper-0.2.0-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