Skip to content

Guoziqi329/bili-scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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__':
    with open("cookie.json", "r", encoding="utf-8") as f:
        cookie = json.load(f)['cookie']

    bilibili = BiliScraper(cookie)

    # Get video
    bilibili.getVideo('BV1Jd1oB3EGD')

    # Get video comments
    comments = bilibili.getVideoComments('BV1Jd1oB3EGD', 'img', 1)
    with open("test.json", "w", encoding="utf-8") as f:
        json.dump(comments, f, ensure_ascii=False)
    
    # Get video Dm
    print(bilibili.getVideoDm("BV1vxPReEERx"))

    # Get Article
    bilibili.getArticle("1102463389176692741", 'doc', 'doc.docx', 'img/test/')

Thanks

This project uses code from:

feedback

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

About

The goal of this tool is to scrape data from the Bilibili website.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages