mirror of
https://github.com/xtrll/MusicMetaFinder.git
synced 2026-04-17 23:54:08 +02:00
feat: add lyric retrieval feature
This commit is contained in:
13
src/api/lyricsRetrieval.js
Normal file
13
src/api/lyricsRetrieval.js
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user