You've already forked bilibili-subtitle
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0b4890399a | ||
![]() |
51bf522eeb | ||
![]() |
a5808d8385 | ||
![]() |
e005c5e214 | ||
![]() |
e7e8758716 | ||
![]() |
49e311a9ed | ||
![]() |
a1462ae2f2 | ||
![]() |
2b0d294c2a | ||
![]() |
2825f9355a |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -25,3 +25,5 @@ dist-ssr
|
||||
*.sw?
|
||||
|
||||
stats.html
|
||||
dist.zip
|
||||
360/
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "哔哩哔哩字幕列表",
|
||||
"description": "显示B站视频的字幕列表,可点击跳转与下载字幕,并支持翻译和总结字幕!",
|
||||
"version": "1.7.3",
|
||||
"version": "1.7.5",
|
||||
"manifest_version": 3,
|
||||
"permissions": [
|
||||
"storage"
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "bilibili-subtitle",
|
||||
"version": "1.7.3",
|
||||
"version": "1.7.5",
|
||||
"type": "module",
|
||||
"description": "哔哩哔哩字幕列表",
|
||||
"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
|
||||
pnpm run build_chrome
|
||||
# zip dist
|
||||
rm -f dist.zip
|
||||
cd dist
|
||||
zip -r ../dist.zip ./*
|
||||
cd ../
|
||||
|
@@ -18,6 +18,7 @@ import {HEADER_HEIGHT, PAGE_SETTINGS, SUMMARIZE_ALL_THRESHOLD, SUMMARIZE_TYPES,
|
||||
import {FaClipboardList} from 'react-icons/fa'
|
||||
import useTranslate from '../hooks/useTranslate'
|
||||
import {getSummarize} from '../util/biz_util'
|
||||
import {openUrl} from '@kky002/kky-util'
|
||||
|
||||
const Body = () => {
|
||||
const dispatch = useAppDispatch()
|
||||
@@ -176,6 +177,20 @@ 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>
|
||||
{(segments?.length??0) > 0 && <button className='mt-1.5 btn btn-xs btn-info' onClick={onCopy}>点击复制生成的{SUMMARIZE_TYPES[curSummaryType].name}<RiFileCopy2Line/></button>}
|
||||
</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' onClick={(e) => {
|
||||
e.preventDefault()
|
||||
openUrl('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' onClick={e => {
|
||||
e.preventDefault()
|
||||
openUrl('https://microsoftedge.microsoft.com/addons/detail/galeejdehabppfgooagmkclpppnbccpc')
|
||||
}} className='link text-sm text-accent'>Edge商店</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
@@ -259,6 +259,16 @@ const MoreBtn = (props: Props) => {
|
||||
微信公众号(IndieKKY)
|
||||
</a>
|
||||
</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'>
|
||||
<a className='flex items-center' onClick={(e) => {
|
||||
dispatch(setPage(PAGE_SETTINGS))
|
||||
|
@@ -203,12 +203,13 @@ export const parseTranscript = (filename: string, text: string | ArrayBuffer): T
|
||||
if (filename.toLowerCase().endsWith('.srt')) {
|
||||
const lines = text.split('\n\n')
|
||||
for (const line of lines) {
|
||||
const lines = line.split('\n')
|
||||
if (lines.length >= 3) {
|
||||
const time = lines[1].split(' --> ')
|
||||
try {
|
||||
const linesInner = line.trim().split('\n')
|
||||
if (linesInner.length >= 3) {
|
||||
const time = linesInner[1].split(' --> ')
|
||||
const from = parseTime(time[0])
|
||||
const to = parseTime(time[1])
|
||||
const content = lines.slice(2).join('\n')
|
||||
const content = linesInner.slice(2).join('\n')
|
||||
items.push({
|
||||
from,
|
||||
to,
|
||||
@@ -216,6 +217,9 @@ export const parseTranscript = (filename: string, text: string | ArrayBuffer): T
|
||||
idx: items.length,
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('parse error', line)
|
||||
}
|
||||
}
|
||||
}
|
||||
// .vtt:
|
||||
|
Reference in New Issue
Block a user