feat: update podcast and tts services for next.js
This commit is contained in:
@ -7,15 +7,12 @@ export async function updatePodcastRSS() {
|
|||||||
|
|
||||||
const channelTitle = "自動生成ポッドキャスト";
|
const channelTitle = "自動生成ポッドキャスト";
|
||||||
const channelLink = "https://your-domain.com/podcast";
|
const channelLink = "https://your-domain.com/podcast";
|
||||||
const channelDescription =
|
const channelDescription = "RSSフィードから自動生成されたポッドキャストです。";
|
||||||
"RSSフィードから自動生成されたポッドキャストです。";
|
|
||||||
const lastBuildDate = new Date().toUTCString();
|
const lastBuildDate = new Date().toUTCString();
|
||||||
|
|
||||||
let itemsXml = "";
|
let itemsXml = "";
|
||||||
for (const ep of episodes) {
|
for (const ep of episodes) {
|
||||||
const fileUrl = `https://your-domain.com/static/podcast_audio/${path.basename(
|
const fileUrl = `https://your-domain.com/podcast_audio/${path.basename(ep.audioPath)}`;
|
||||||
ep.audioPath,
|
|
||||||
)}`;
|
|
||||||
const pubDate = new Date(ep.pubDate).toUTCString();
|
const pubDate = new Date(ep.pubDate).toUTCString();
|
||||||
itemsXml += `
|
itemsXml += `
|
||||||
<item>
|
<item>
|
||||||
|
@ -21,7 +21,7 @@ export async function generateTTS(
|
|||||||
throw new Error("TTSのAudioStreamが空です");
|
throw new Error("TTSのAudioStreamが空です");
|
||||||
}
|
}
|
||||||
|
|
||||||
const outputDir = path.join(__dirname, "../static/podcast_audio");
|
const outputDir = path.join(__dirname, "../public/podcast_audio");
|
||||||
if (!fs.existsSync(outputDir)) {
|
if (!fs.existsSync(outputDir)) {
|
||||||
fs.mkdirSync(outputDir, { recursive: true });
|
fs.mkdirSync(outputDir, { recursive: true });
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user