Homepage

GitHub CHANGELOG PyPI Issues License

bgetlib is a bilibili API library.

Install

pip install bgetlib

Quickstart

import bgetlib

bapi = bgetlib.BilibiliAPI("bilibili.com_cookies.txt")
# https://space.bilibili.com/36081646/favlist?fid=976082846
videos = bapi.get_favorites_all(976082846)

for video in videos:
    video_detail = bapi.get_video(video["id"])
    for part in video_detail["pages"]:
        bapi.video_stream_to_file(video_detail["aid"], part["cid"],
                                  "av{}-P{}.mp4".format(video_detail["aid"], part["page"]))

Manual