Revert "fix(route): remove useless encodeURIComponent (#19931)" (#19965)

This reverts commit 6304717934.
This commit is contained in:
Stephen Zhou 2025-09-04 11:52:02 +08:00 committed by GitHub
parent 03269329de
commit d8dd83c266
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -286,7 +286,7 @@ const getVideoSubtitle = async (
const getVideoSubtitleAttachment = async (bvid: string) => {
const subtitles = await getVideoSubtitle(bvid);
return subtitles.map((subtitle) => ({
url: `data:text/plain;charset=utf-8,${subtitle.content}`,
url: `data:text/plain;charset=utf-8,${encodeURIComponent(subtitle.content)}`,
mime_type: 'text/srt',
title: `字幕 - ${subtitle.lan_doc}`,
}));

View File

@ -74,7 +74,7 @@ export const getDataByChannelId = async ({ channelId, embed }: { channelId: stri
.filter((video) => 'video_id' in video)
.map(async (video) => {
const srt = await getSubtitlesByVideoId(video.video_id);
const dataUrl = `data:text/plain;charset=utf-8,${srt}`;
const dataUrl = `data:text/plain;charset=utf-8,${encodeURIComponent(srt)}`;
const img = 'best_thumbnail' in video ? video.best_thumbnail?.url : 'thumbnails' in video ? video.thumbnails?.[0]?.url : undefined;