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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file bgetlib-2.0.0.tar.gz.

File metadata

  • Download URL: bgetlib-2.0.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/56.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.0

File hashes

Hashes for bgetlib-2.0.0.tar.gz
Algorithm Hash digest
SHA256 88a2b8c3a96f334ccf6bd08145967f7d1ac9a1e0b806c1a9d32514ee801b6d3c
MD5 50ab75d5e5b49e311bafe01e1e67437a
BLAKE2b-256 7ba08a5a5b5ff2003e5980a71628b87878f90a33f0c821141f9a645dfbb3daf8

See more details on using hashes here.

File details

Details for the file bgetlib-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: bgetlib-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/56.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.0

File hashes

Hashes for bgetlib-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 106111a38f3181eea535440caa844a40aa319a080579d507527e695ebf559493
MD5 8b44d52c6fbd3847a5172e13d4a0f76f
BLAKE2b-256 3a6825371274be5a0abeba45ed6370e8f4c5db1aa14a7743abd03c5f71a44acc

See more details on using hashes here.

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