Element Bug Fixes

This commit is contained in:
2025-12-01 05:18:27 +00:00
parent 1167c686e2
commit e0bcba74d5
24 changed files with 875 additions and 228 deletions

View File

@@ -0,0 +1,25 @@
import ytpl from 'ytpl';
/** @type {import('./$types').PageServerLoad} */
export async function load({ params }) {
const playlistUrl = 'https://music.youtube.com/playlist?list=PLHqPHHvmOjJ6JwiYc3Fg-O5JGbVppI1VR&si=CIb9WIKhjKsRV3p3';
const playlist = await ytpl(playlistUrl, { limit: Infinity });
const songs = playlist.items.map((item, index) => {
return {
index: index + 1,
title: item.title,
duration: item.duration, // format is usually mm:ss
author: item.author.name,
isLive: item.isLive,
url: item.shortUrl
};
});
return {
songs
};
}