Skip to content

Commit

Permalink
fix: remove the bvd / issue
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyLv committed Feb 27, 2023
1 parent 742337c commit e05c98c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions pages/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const Home: NextPage = () => {
}, [router.isReady, urlState]);

const curUrl = String(curVideo.split(".com")[1]);
console.log('========curUrl========', curUrl)

const generateSummary = async (url?: string) => {
setSummary("");
Expand Down
4 changes: 2 additions & 2 deletions pages/api/summarize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if (!process.env.OPENAI_API_KEY) {
export default async function handler(req: Request) {
const { url, apiKey } = (await req.json()) as {
url?: string;
apiKey?: string
apiKey?: string;
};

if (!url) {
Expand All @@ -24,7 +24,7 @@ export default async function handler(req: Request) {
const matchResult = url.match(/\/video\/(.*)/);
let bvId: string | undefined;
if (matchResult) {
bvId = matchResult[1];
bvId = matchResult[1].replace("/", "");
}
const response = await fetch(
`https://api.bilibili.com/x/web-interface/view?bvid=${bvId}`,
Expand Down

1 comment on commit e05c98c

@vercel
Copy link

@vercel vercel bot commented on e05c98c Feb 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.