You've already forked bilibili-subtitle
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a5808d8385 | ||
![]() |
e005c5e214 | ||
![]() |
e7e8758716 | ||
![]() |
49e311a9ed | ||
![]() |
a1462ae2f2 | ||
![]() |
2b0d294c2a | ||
![]() |
2825f9355a |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -25,3 +25,5 @@ dist-ssr
|
|||||||
*.sw?
|
*.sw?
|
||||||
|
|
||||||
stats.html
|
stats.html
|
||||||
|
dist.zip
|
||||||
|
360/
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "哔哩哔哩字幕列表",
|
"name": "哔哩哔哩字幕列表",
|
||||||
"description": "显示B站视频的字幕列表,可点击跳转与下载字幕,并支持翻译和总结字幕!",
|
"description": "显示B站视频的字幕列表,可点击跳转与下载字幕,并支持翻译和总结字幕!",
|
||||||
"version": "1.7.3",
|
"version": "1.7.4",
|
||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"storage"
|
"storage"
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
"name": "bilibili-subtitle",
|
"name": "bilibili-subtitle",
|
||||||
"version": "1.7.3",
|
"version": "1.7.4",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "哔哩哔哩字幕列表",
|
"description": "哔哩哔哩字幕列表",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
BIN
public/youtube-subtitle.png
Normal file
BIN
public/youtube-subtitle.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
1
push.sh
1
push.sh
@@ -25,6 +25,7 @@ echo "Version updated to: $new_version"
|
|||||||
# build
|
# build
|
||||||
pnpm run build_chrome
|
pnpm run build_chrome
|
||||||
# zip dist
|
# zip dist
|
||||||
|
rm -f dist.zip
|
||||||
cd dist
|
cd dist
|
||||||
zip -r ../dist.zip ./*
|
zip -r ../dist.zip ./*
|
||||||
cd ../
|
cd ../
|
||||||
|
@@ -176,6 +176,14 @@ const Body = () => {
|
|||||||
<div className='text-sm desc px-2'>可以尝试将<span className='text-amber-600 font-semibold'>概览</span>生成的内容粘贴到<span className='text-secondary/75 font-semibold'>视频评论</span>里,发布后看看有什么效果🥳</div>
|
<div className='text-sm desc px-2'>可以尝试将<span className='text-amber-600 font-semibold'>概览</span>生成的内容粘贴到<span className='text-secondary/75 font-semibold'>视频评论</span>里,发布后看看有什么效果🥳</div>
|
||||||
{(segments?.length??0) > 0 && <button className='mt-1.5 btn btn-xs btn-info' onClick={onCopy}>点击复制生成的{SUMMARIZE_TYPES[curSummaryType].name}<RiFileCopy2Line/></button>}
|
{(segments?.length??0) > 0 && <button className='mt-1.5 btn btn-xs btn-info' onClick={onCopy}>点击复制生成的{SUMMARIZE_TYPES[curSummaryType].name}<RiFileCopy2Line/></button>}
|
||||||
</div>
|
</div>
|
||||||
|
<div className='flex flex-col items-center text-center py-2 mx-4 border-t border-t-base-300'>
|
||||||
|
<div className='font-semibold text-accent flex items-center gap-1'><img src='/youtube-subtitle.png' alt='youtube subtitle' className='w-8 h-8'/>Youtube Subtitle</div>
|
||||||
|
<div className='text-sm px-2 desc'>这是<span className='text-amber-600 font-semibold text-base'>Youtube</span>版的字幕列表</div>
|
||||||
|
<div className='flex gap-2'>
|
||||||
|
<a title='Chrome商店' href='https://chromewebstore.google.com/detail/fiaeclpicddpifeflpmlgmbjgaedladf' className='link text-sm text-accent'>Chrome商店</a>
|
||||||
|
<a title='Edge商店' href='https://microsoftedge.microsoft.com/addons/detail/galeejdehabppfgooagmkclpppnbccpc' className='link text-sm text-accent'>Edge商店</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
@@ -259,6 +259,16 @@ const MoreBtn = (props: Props) => {
|
|||||||
微信公众号(IndieKKY)
|
微信公众号(IndieKKY)
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li className='hover:bg-accent'>
|
||||||
|
<a className='flex items-center' onClick={(e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
e.stopPropagation()
|
||||||
|
openUrl('https://chromewebstore.google.com/detail/fiaeclpicddpifeflpmlgmbjgaedladf')
|
||||||
|
}}>
|
||||||
|
<img alt='youtube subtitle' src='/youtube-subtitle.png' className='w-[20px] h-[20px] bg-white rounded-sm p-0.5'/>
|
||||||
|
Youtube Subtitle
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<li className='hover:bg-accent'>
|
<li className='hover:bg-accent'>
|
||||||
<a className='flex items-center' onClick={(e) => {
|
<a className='flex items-center' onClick={(e) => {
|
||||||
dispatch(setPage(PAGE_SETTINGS))
|
dispatch(setPage(PAGE_SETTINGS))
|
||||||
|
@@ -203,12 +203,13 @@ export const parseTranscript = (filename: string, text: string | ArrayBuffer): T
|
|||||||
if (filename.toLowerCase().endsWith('.srt')) {
|
if (filename.toLowerCase().endsWith('.srt')) {
|
||||||
const lines = text.split('\n\n')
|
const lines = text.split('\n\n')
|
||||||
for (const line of lines) {
|
for (const line of lines) {
|
||||||
const lines = line.split('\n')
|
try {
|
||||||
if (lines.length >= 3) {
|
const linesInner = line.trim().split('\n')
|
||||||
const time = lines[1].split(' --> ')
|
if (linesInner.length >= 3) {
|
||||||
|
const time = linesInner[1].split(' --> ')
|
||||||
const from = parseTime(time[0])
|
const from = parseTime(time[0])
|
||||||
const to = parseTime(time[1])
|
const to = parseTime(time[1])
|
||||||
const content = lines.slice(2).join('\n')
|
const content = linesInner.slice(2).join('\n')
|
||||||
items.push({
|
items.push({
|
||||||
from,
|
from,
|
||||||
to,
|
to,
|
||||||
@@ -216,6 +217,9 @@ export const parseTranscript = (filename: string, text: string | ArrayBuffer): T
|
|||||||
idx: items.length,
|
idx: items.length,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error('parse error', line)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// .vtt:
|
// .vtt:
|
||||||
|
Reference in New Issue
Block a user