yutto/packages/biliass
renovate[bot] 8e37466fc0
⬆️ deps: Update dependencies (non-major) (#498)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-18 16:28:51 +00:00
..
rust ⬆️ deps: Update dependencies (non-major) (#498) 2025-04-18 16:28:51 +00:00
src/biliass 🔖 release: biliass@2.2.2, fix missing LICENSE file in v2.2.1 2025-04-04 01:19:43 +08:00
LICENSE ♻️ refactor: integrate `biliass` as a sub package (#301) 2024-09-12 03:20:26 +08:00
README.md 📝 docs(biliass): update README for biliass 2024-11-03 16:24:11 +08:00
pyproject.toml ⚰️ refactor!: drop python3.9 support (#488) 2025-04-05 02:07:37 +08:00

README.md

biliass

PyPI - Python Version pypi PyPI - Downloads Build Status LICENSE Gitmoji CodSpeed Badge

biliass高性能且易于使用的 bilibili 弹幕转换工具XML/Protobuf 格式转 ASS基于 Danmaku2ASS,使用 rust 重写

Install

pip install biliass

Usage

# XML 弹幕
biliass danmaku.xml -s 1920x1080 -o danmaku.ass
# protobuf 弹幕
biliass danmaku.pb -s 1920x1080 -f protobuf -o danmaku.ass
from biliass import convert_to_ass

# xml
convert_to_ass(
    xml_text_or_bytes,
    1920,
    1080,
    input_format="xml",
    display_region_ratio=1.0,
    font_face="sans-serif",
    font_size=25,
    text_opacity=0.8,
    duration_marquee=15.0,
    duration_still=10.0,
    block_options=None,
    reduce_comments=False,
)

# protobuf
convert_to_ass(
    protobuf_bytes, # only bytes
    1920,
    1080,
    input_format="protobuf",
    display_region_ratio=1.0,
    font_face="sans-serif",
    font_size=25,
    text_opacity=0.8,
    duration_marquee=15.0,
    duration_still=10.0,
    block_options=None,
    reduce_comments=False,
)