ChatGPTBox v2.0.0

This commit is contained in:
josc146
2023-03-15 17:09:28 +08:00
parent e642f2b922
commit f9ef9620ac
11 changed files with 38 additions and 25 deletions
@@ -24,7 +24,10 @@ export default {
})
).text()
let subtitleUrl = docText.substring(docText.indexOf('https://www.youtube.com/api/timedtext'))
const subtitleUrlStartAt = docText.indexOf('https://www.youtube.com/api/timedtext')
if (subtitleUrlStartAt === -1) return
let subtitleUrl = docText.substring(subtitleUrlStartAt)
subtitleUrl = subtitleUrl.substring(0, subtitleUrl.indexOf('"'))
subtitleUrl = subtitleUrl.replaceAll('\\u0026', '&')
@@ -32,6 +35,7 @@ export default {
title = title.substring(0, title.indexOf('","'))
const subtitleResponse = await fetch(subtitleUrl)
if (!subtitleResponse.ok) return
let subtitleData = await subtitleResponse.text()
let subtitleContent = ''
@@ -44,7 +48,7 @@ export default {
return cropText(
`Provide a brief summary of the video using concise language and incorporating the video title.` +
`The video title is:"${title}".The subtitle content is as follows:\n${subtitleContent}`,
`The video title is:"${title}".The subtitle content is as follows:\n${subtitleContent}`,
)
} catch (e) {
console.log(e)
+3 -3
View File
@@ -1,7 +1,7 @@
{
"name": "ChatGPT for Search Engine",
"description": "Display ChatGPT response alongside Search Engine results",
"version": "1.26.1",
"name": "ChatGPTBox",
"description": "Integrating ChatGPT into your browser deeply, everything you need is here",
"version": "2.0.0",
"manifest_version": 3,
"icons": {
"16": "logo.png",
+3 -3
View File
@@ -1,7 +1,7 @@
{
"name": "ChatGPT for Search Engine",
"description": "Display ChatGPT response alongside Search Engine results",
"version": "1.26.1",
"name": "ChatGPTBox",
"description": "Integrating ChatGPT into your browser deeply, everything you need is here",
"version": "2.0.0",
"manifest_version": 2,
"icons": {
"16": "logo.png",
+1 -1
View File
@@ -1,6 +1,6 @@
<html>
<head>
<title>ChatGPT for Search Engine</title>
<title>ChatGPTBox</title>
<link rel="stylesheet" href="popup.css" />
<meta charset="UTF-8">
</head>