Skip to main content

Convert bilibili danmaku file (XML) to styled subtitle file (ASS). 使用bilibili弹幕(XMl)生成ASS字幕文件。

This package works with DenoIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
JSR Score
94%
Published
4 months ago (0.1.0)
function generateASS
generateASS(
text: string,
options?: Options,
): string

使用bilibili弹幕(XMl)生成ASS字幕文件

Examples

Example 1

import fs from 'fs'
  import { generateASS } from 'jsr:@biliy-deno/danmaku2ass'
  const filename = 'example.xml'
	const xmlText = fs.readFileSync(filename, 'utf-8')
	const assText = generateASS(xmlText, { filename, title: 'Quick Example' })
	fs.writeFileSync(`${filename}.ass`, assText, 'utf-8')

Parameters

text: string

XML弹幕文件内容

optional
options: Options

杂项

Return Type

返回ASS字幕文件内容

Add Package

deno add @biliy-deno/danmaku2ass

Import symbol

import { generateASS } from "@biliy-deno/danmaku2ass";

Add Package

npx jsr add @biliy-deno/danmaku2ass

Import symbol

import { generateASS } from "@biliy-deno/danmaku2ass";

Add Package

yarn dlx jsr add @biliy-deno/danmaku2ass

Import symbol

import { generateASS } from "@biliy-deno/danmaku2ass";

Add Package

pnpm dlx jsr add @biliy-deno/danmaku2ass

Import symbol

import { generateASS } from "@biliy-deno/danmaku2ass";

Add Package

bunx jsr add @biliy-deno/danmaku2ass

Import symbol

import { generateASS } from "@biliy-deno/danmaku2ass";