-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"main.css": "static/css/main.1ad4f52f.css", | ||
"main.css.map": "static/css/main.1ad4f52f.css.map", | ||
"main.js": "static/js/main.f7aea465.js", | ||
"main.js.map": "static/js/main.f7aea465.js.map" | ||
"main.js": "static/js/main.af305a54.js", | ||
"main.js.map": "static/js/main.af305a54.js.map" | ||
} |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
const fs = require("fs") | ||
const path = require("path") | ||
|
||
const source = path.join(__dirname + '/xml/') | ||
const target = path.join(__dirname + '/json/') | ||
|
||
const main = (dir, newDir) => { | ||
const files = fs.readdirSync(dir); | ||
files.forEach(file => { | ||
if (path.extname(file) === '.xml') { | ||
const danmuku = { | ||
code: 0, | ||
data: [], | ||
} | ||
fs.readFile(dir + file, 'utf8', (err, content) => { | ||
const lines = content.split('\r\n') | ||
for (let line of lines) { | ||
line = line.replace('<d p="', '').replace('</d>', '') | ||
const text = line.split('>')[1] | ||
const time = line.split(',')[0] | ||
const bilibiliType = line.split(',')[1] | ||
const type = bilibiliType === '4' ? 2 : bilibiliType === '5' ? 1 : 0 | ||
const fontSize = line.split(',')[2] | ||
const color = line.split(',')[3] | ||
// const colorRGB = '#' + parseInt(color).toString(16).padStart(6, '0') | ||
const timestamp = line.split(',')[4] | ||
const pool = line.split(',')[5] | ||
const author = line.split(',')[6] | ||
const rowID = line.split(',')[7] | ||
const oneDanmu = [ | ||
parseInt(time, 10) || 0, | ||
parseInt(type) || 0, | ||
parseInt(color) || 16777215, // colorRGB || '#' + (16777215).toString(16), | ||
'bilibili' + author || 'DPlayer', | ||
text || '', | ||
] | ||
danmuku.data.push(oneDanmu) | ||
} | ||
// write file | ||
const newFileName = newDir + file.replace('.xml', '') + '.json' | ||
const newFileContent = JSON.stringify(danmuku) | ||
fs.writeFile(newFileName, newFileContent, err => { | ||
if (err) { | ||
console.log(file + 'fail!') | ||
} else { | ||
console.log('✅ ' + file + ' done!') | ||
} | ||
}) | ||
}) | ||
|
||
} | ||
}) | ||
} | ||
|
||
main(source, target); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
`<d p="0,1,25,16777215,1312863760,0,eff85771,42759017">前排占位置</d>` | ||
|
||
|
||
第一个参数是弹幕出现的时间 以秒数为单位。 | ||
第二个参数是弹幕的模式1..3 滚动弹幕 4底端弹幕 5顶端弹幕 6.逆向弹幕 7精准定位 8高级弹幕 | ||
第三个参数是字号, 12非常小,16特小,18小,25中,36大,45很大,64特别大 | ||
第四个参数是字体的颜色 以HTML颜色的十位数为准 | ||
第五个参数是Unix格式的时间戳。基准时间为 1970-1-1 08:00:00 | ||
第六个参数是弹幕池 0普通池 1字幕池 2特殊池 【目前特殊池为高级弹幕专用】 | ||
第七个参数是发送者的ID,用于“屏蔽此弹幕的发送者”功能 | ||
第八个参数是弹幕在弹幕数据库中rowID 用于“历史弹幕”功能。 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0"?> | ||
<AcPlayConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | ||
<PlayerName>bilibili</PlayerName> | ||
<PlayerUrl>http://static.hdslb.com/play.swf</PlayerUrl> | ||
<WebUrl>http://www.bilibili.tv/video/av208751/index_10.html</WebUrl> | ||
<HttpServerPort>7776</HttpServerPort> | ||
<ProxyServerPort>7777</ProxyServerPort> | ||
<Videos /> | ||
<Subtitles> | ||
<string>第10回.xml</string> | ||
</Subtitles> | ||
<SpeedLimit>0</SpeedLimit> | ||
<ExtraConfig /> | ||
</AcPlayConfiguration> |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0"?> | ||
<AcPlayConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | ||
<PlayerName>bilibili</PlayerName> | ||
<PlayerUrl>http://static.hdslb.com/play.swf</PlayerUrl> | ||
<WebUrl>http://www.bilibili.tv/video/av208751/index_11.html</WebUrl> | ||
<HttpServerPort>7776</HttpServerPort> | ||
<ProxyServerPort>7777</ProxyServerPort> | ||
<Videos /> | ||
<Subtitles> | ||
<string>第11回.xml</string> | ||
</Subtitles> | ||
<SpeedLimit>0</SpeedLimit> | ||
<ExtraConfig /> | ||
</AcPlayConfiguration> |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0"?> | ||
<AcPlayConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | ||
<PlayerName>bilibili</PlayerName> | ||
<PlayerUrl>http://static.hdslb.com/play.swf</PlayerUrl> | ||
<WebUrl>http://www.bilibili.tv/video/av208751/index_12.html</WebUrl> | ||
<HttpServerPort>7776</HttpServerPort> | ||
<ProxyServerPort>7777</ProxyServerPort> | ||
<Videos /> | ||
<Subtitles> | ||
<string>第12回.xml</string> | ||
</Subtitles> | ||
<SpeedLimit>0</SpeedLimit> | ||
<ExtraConfig /> | ||
</AcPlayConfiguration> |