feat: add lyric retrieval feature

This commit is contained in:
xtrullor73
2024-05-12 18:19:36 -07:00
parent 02122e6b55
commit caf9d554ef

View File

@@ -0,0 +1,13 @@
import axios from 'axios';
export default async function (artist, title) {
const endpoint = `https://api.lyrics.ovh/v1/${artist}/${title}`;
try {
const response = await axios.get(endpoint);
return response.data.lyrics;
} catch (error) {
console.error('Error fetching lyrics: ', error);
return null;
}
}