{"id":15305485,"url":"https://github.com/alenvelocity/ultra-lyrics","last_synced_at":"2025-04-04T22:12:07.589Z","repository":{"id":107769797,"uuid":"393947066","full_name":"AlenVelocity/ultra-lyrics","owner":"AlenVelocity","description":"Genius Scraper and API Wraper","archived":false,"fork":false,"pushed_at":"2021-08-09T15:18:26.000Z","size":358,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T15:42:28.390Z","etag":null,"topics":["genius","genius-api","lyrics","music"],"latest_commit_sha":null,"homepage":"https://alensaito1.github.io/ultra-lyrics/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlenVelocity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-08T11:57:30.000Z","updated_at":"2022-06-10T10:38:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"097f4838-0e6c-4cc9-87a7-1d69865a7604","html_url":"https://github.com/AlenVelocity/ultra-lyrics","commit_stats":null,"previous_names":["alensaito1/ultra-lyrics"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlenVelocity%2Fultra-lyrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlenVelocity%2Fultra-lyrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlenVelocity%2Fultra-lyrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlenVelocity%2Fultra-lyrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlenVelocity","download_url":"https://codeload.github.com/AlenVelocity/ultra-lyrics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256116,"owners_count":20909240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["genius","genius-api","lyrics","music"],"created_at":"2024-10-01T08:00:44.725Z","updated_at":"2025-04-04T22:12:07.564Z","avatar_url":"https://github.com/AlenVelocity.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ultra-Lyrics\n\n\u003cimg src=\"https://img.icons8.com/color/96/000000/music--v2.png\" alt=\"ultra\" align=\"right\" /\u003e\n\nUltra-Lyrics is a package which fetches the [Genius](https://img.icons8.com/color/144/000000/music--v2.png) API and uses the data to scrap the lyrics from the actual website. Occasionally paired with [Spotifydl-Core](https://www.npmjs.com/package/spotifydl-core)\n\nRead Docs Here: [Docs](https://alensaito1.github.io/ultra-lyrics/)\n\n## Install\n\n```\nnpm i ultra-lyrics\n```\n\n## Usage\n\n\u003e Note:\n\u003e To authenticate with a [Genius access token](https://docs.genius.com/#/authentication-h1), you need to add it to [`process.env`](https://nodejs.org/dist/latest-v14.x/docs/api/process.html#process_process_env) as an ENV Variable or usign [`dotenv`](https://www.npmjs.com/package/dotenv) wth the name as `GENIUS_ACCESS_TOKEN`\n\n\u003e Search for songs\n\n```TS\nimport { search } from 'ultra-lyrics'\n// const { search } = require('ultra-lyrics')\n(async () =\u003e {\n    const { data, error } = await search('Blue Clapper')\n    if (error instanceof Error) console.error('An error occurred', error)\n    else console.log('Results', data)\n})()\n```\n\n\u003e Get Lyrics\n\n```TS\nimport { search, getLyrics } from 'ultra-lyrics'\n// const { search } = require('ultra-lyrics')\n(async () =\u003e {\n    let { data: results, error } = await search('Precious Photographs')\n    if (error instanceof Error) console.error('An error occurred while searching', error)\n    else {\n        const { data, error } = await getLyrics(results[0]) // you can also pass the title too\n        if (error) console.error('An error occurred while fetching lyrics', error)\n        else console.log('Lyrics', data)\n    }\n})()\n```\n\n\u003e Get Song\n\n```TS\nimport { getSong } from 'ultra-lyrics'\n// const { search } = require('ultra-lyrics')\n(async () =\u003e {\n    const { data, error } = await getSong('Dreaming Days')\n    if (error instanceof Error) console.error('An error occurred', error)\n    else console.log('Song', data)\n})()\n```\n\nAs of right now, ultra-lyrics exports 3 functions. All of them will return a Promise of the object of type [`UltraLyricsFunctionReturnType`](https://github.com/AlenSaito1/ultralife/blob/61f6e6f6d125b64d76bc81ad00a608760ab5ab72/src/Types.ts#L88). It has 2 Properties, `error` and `data`. The error property will contain an instance of the [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) class if there was an error. The data property will contain the data returned by the function IF NO ERROR OCCURED. This helps in avoidng the `\"try-catch hell\"`. Full Credits[Jeff Delaney](https://github.com/codediodeio) for this idea. Watch this video by [fireship](https://www.youtube.com/channel/UCsBjURrPoezykLs9EqgamOA) for more info: [Async Await try-catch hell](https://youtu.be/ITogH7lJTyE)\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falenvelocity%2Fultra-lyrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falenvelocity%2Fultra-lyrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falenvelocity%2Fultra-lyrics/lists"}