Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

genius-lyrics-ts

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

genius-lyrics-ts - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

11

dist/index.js

@@ -42,5 +42,10 @@ "use strict";

const reqUrl = `${searchUrl}${encodeURIComponent(song + " lyrics")}`;
const response = await fetch(reqUrl);
const response = await fetch(reqUrl, {
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 6.3; Win64; x64)"
}
});
const html = await response.text();
const htmlDocument = (0, import_node_html_parser.parse)(html);
console.log({ response, html, htmlDocument });
let lyrics = htmlDocument.querySelector("[data-lyricid]")?.innerText?.trim();

@@ -50,4 +55,4 @@ if (!lyrics)

return lyrics;
} catch (e) {
throw e;
} catch (error) {
throw error;
}

@@ -54,0 +59,0 @@ }

{
"name": "genius-lyrics-ts",
"version": "0.2.2",
"version": "0.2.3",
"description": "Get lyrics from google with Typescript, Javascript, or Node",

@@ -28,3 +28,3 @@ "main": "dist/index.js",

"dependencies": {
"happy-dom": "^9.20.3",
"effect": "2.0.0-next.20",
"node-html-parser": "^6.1.5"

@@ -31,0 +31,0 @@ },

@@ -0,0 +0,0 @@ # genius-lyrics-ts

@@ -17,5 +17,10 @@ import { parse } from "node-html-parser";

const response = await fetch(reqUrl);
const response = await fetch(reqUrl, {
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 6.3; Win64; x64)",
},
});
const html = await response.text();
const htmlDocument = parse(html);
console.log({ response, html, htmlDocument });
let lyrics = htmlDocument

@@ -27,4 +32,4 @@ .querySelector("[data-lyricid]")

return lyrics;
} catch (e) {
throw e;
} catch (error) {
throw error;
}

@@ -31,0 +36,0 @@ }

import getLyrics from "./getLyrics";
export default getLyrics;

@@ -0,0 +0,0 @@ export const getTitle = (title: string, artist?: string) => {

@@ -0,0 +0,0 @@ {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc