Skip to content

Commit

Permalink
Merge pull request farshed#30 from Tweak4141/patch-2
Browse files Browse the repository at this point in the history
Update getSongById.js
  • Loading branch information
farshed authored Dec 5, 2022
2 parents 682aa1d + 3f32916 commit 5068303
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/getSongById.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ const url = 'https://api.genius.com/songs/';
*/
module.exports = async function (id, apiKey) {
if (!id) throw 'No id was provided';
if (!apiKey) throw 'No apiKey was provided';
try {
let {
data: {
response: { song }
}
} = await axios.get(`${url}${id}&access_token=${apiKey}`);
} = await axios.get(`${url}${id}?access_token=${apiKey}`);
let lyrics = await extractLyrics(song.url);
return {
id: song.id,
Expand Down

0 comments on commit 5068303

Please sign in to comment.