Skip to main content

将 B 站 XML 弹幕转换为 ASS 弹幕

Project description

biliass

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

biliass,只是 Danmaku2ASS 的 bilili 与 yutto 适配版

原版:https://github.com/m13253/danmaku2ass

仅支持 bilibili 弹幕,支持 XML 弹幕和 Protobuf 弹幕

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 Danmaku2ASS

# xml
Danmaku2ASS(
    xml_text_or_bytes,
    width,
    height,
    input_format="xml",
    reserve_blank=0,
    font_face="sans-serif",
    font_size=width / 40,
    text_opacity=0.8,
    duration_marquee=15.0,
    duration_still=10.0,
    comment_filter=None,
    is_reduce_comments=False,
    progress_callback=None,
)

# protobuf
Danmaku2ASS(
    protobuf_bytes, # only bytes
    width,
    height,
    input_format="protobuf",
    reserve_blank=0,
    font_face="sans-serif",
    font_size=width / 40,
    text_opacity=0.8,
    duration_marquee=15.0,
    duration_still=10.0,
    comment_filter=None,
    is_reduce_comments=False,
    progress_callback=None,
)

TODO

  • 导出 bilibili 网页上的弹幕设置,并导入到 biliass

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

biliass-1.3.7.tar.gz (29.4 kB view hashes)

Uploaded Source

Built Distribution

biliass-1.3.7-py3-none-any.whl (32.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