Skip to main content

A BiliBili API library

Project description

bgetlib

GitHub PyPI Documentation Version Issues Coverage License

bgetlib is a bilibili API library.

This is not an official library. Abuse of this library may cause your bilibili account banned.

This repository is not bget.

bget is a command line bilibili video downloader tool developed by the same developer of this library, and it uses bgetlib as its core. If you want an out-of-the-box tool or don't know how to code, please see the bget project: https://github.com/baobao1270/bget

Please note that version 2.x has all API names changed.

Install

pip install bgetlib

Getting Started

Code below is a simple video downloader.

import bgetlib

bapi = bgetlib.BilibiliAPI()
bapi.login("cookies.txt")
downloader = bgetlib.Downloader()
fav_videos = bapi.get_favorites_all(976082846) # The Luo Tianyi's 2021 new songs collection ID

for fav_video in fav_videos:
    video = bapi.get_video(fav_video.avid)
    for part in video.parts:
        fd = downloader.download(video.avid, part.cid, "tmp/")
        transcoder = bgetlib.Transcoder("tmp/", fd)
        transcoder.save_dash("downloads/av{}.mp4".format(video.avid))

API Reference

See: API Reference

Coverage Report

See: Coverage

Change Log

See: CHANGELOG

License

This project is under the MIT License. See: LICENSE

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

bgetlib-2.0.0.tar.gz (9.9 kB view hashes)

Uploaded Source

Built Distribution

bgetlib-2.0.0-py3-none-any.whl (10.6 kB view hashes)

Uploaded Python 3

Supported by

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