I can't believe I figured out how to emulate ytmusic api calls

This commit is contained in:
Eclypsed
2024-02-24 02:06:02 -05:00
parent c7b9b214b7
commit fe37c8aa6e
12 changed files with 166 additions and 72 deletions

View File

@@ -1,6 +1,7 @@
import type { RequestHandler } from '@sveltejs/kit'
import { SECRET_INTERNAL_API_KEY } from '$env/static/private'
import { Jellyfin } from '$lib/services'
import { Jellyfin, YouTubeMusic } from '$lib/services'
import { google } from 'googleapis'
// This is temporary functionally for the sake of developing the app.
// In the future will implement more robust algorithm for offering recommendations
@@ -33,6 +34,9 @@ export const GET: RequestHandler = async ({ params, fetch }) => {
for (const song of mostPlayedData.Items) recommendations.push(Jellyfin.songFactory(song, connection))
break
case 'youtube-music':
YouTubeMusic.getHome(tokens.accessToken)
break
}
}