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.1.tar.gz (22.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.1-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bili_scraper-0.2.1.tar.gz
  • Upload date:
  • Size: 22.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.1.tar.gz
Algorithm Hash digest
SHA256 3e59bd4b272ff0cb20afd7875d99d7b22fd5e0fc0e81e975aa09ef5fa0c41921
MD5 7240d3e67df7e6dda197926a21eee667
BLAKE2b-256 e508968f8e44cbfce270a7549959d70f5345fb3c6ae1c68289b3c20d0f82aac7

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bili_scraper-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 25.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0a5f4bfbcacd98eace95ac46be8921318249ebf44eb993b6757a5208a1232207
MD5 3d5c3b18c20eb563c1bcd7fa68e44445
BLAKE2b-256 e9fece6be324435febc7a0a6f89839d3fb8bb0e2cb27911b506b9d2b9ee6fec2

See more details on using hashes here.

Provenance

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