fix: 修复 Failed to fetch video data

- 修正正则匹配方法
This commit is contained in:
ApplePine 2025-06-29 13:08:17 +08:00
parent 2f635006ea
commit 042e66a777
2 changed files with 10 additions and 4 deletions

View File

@ -1,5 +1,11 @@
# Vue 3 + Vite
To install dependencies:
```sh
bun install
```
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
To run:
```sh
bun run dev
```
Learn more about IDE Support for Vue in the [Vue Docs Scaling up Guide](https://vuejs.org/guide/scaling-up/tooling.html#ide-support).
open http://localhost:5173

View File

@ -62,7 +62,7 @@ app.post('/api/parse', async (c) => {
return c.json({ error: 'Failed to fetch video data' }, 500)
}
const html = await response.text()
const routerDataMatch = html.match(/_ROUTER_DATA\s*=\s*(\{.*?\});/)
const routerDataMatch = html.match(/_ROUTER_DATA\s*=\s*(\{.*?\})</)
if (!routerDataMatch) {
return c.json({ error: 'Failed to extract router data' }, 500)
}