From 4e8d0fe3f919d299838b58ae16b40d3f60c4bac5 Mon Sep 17 00:00:00 2001 From: Ashley Date: Thu, 18 Aug 2022 13:48:10 +0200 Subject: [PATCH] Delete 'p/lyrics.js' --- p/lyrics.js | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 p/lyrics.js diff --git a/p/lyrics.js b/p/lyrics.js deleted file mode 100644 index 1083b001..00000000 --- a/p/lyrics.js +++ /dev/null @@ -1,47 +0,0 @@ -const fetch = require('node-fetch'); - const htmlToText = require('html-to-text'); - const encoding = require('encoding'); - const delim1 = '
'; - const delim2 = '
'; - const url = "https://www.google.com/search?q="; - - async function main(e="", d="") { - let i; - try { - i = await fetch(`${url}${encodeURIComponent(d + " " + e)}+lyrics`); - i = await i.textConverted(); - [, i] = i.split(delim1); - [i] = i.split(delim2); - } catch (m) { - try { - i = await fetch(`${url}${encodeURIComponent(d + " " + e)}+song+lyrics`); - i = await i.textConverted(); - [, i] = i.split(delim1); - [i] = i.split(delim2); - } catch (n) { - try { - i = await fetch(`${url}${encodeURIComponent(d + " " + e)}+song`); - i = await i.textConverted(); - [, i] = i.split(delim1); - [i] = i.split(delim2); - } catch (o) { - try { - i = await fetch(`${url}${encodeURIComponent(d + " " + e)}`); - i = await i.textConverted(); - [, i] = i.split(delim1); - [i] = i.split(delim2); - } catch (p) { - i = ''; - } - } - } - } - const ret = i.split('\n'); - let final = ''; - for (let j = 0; j < ret.length; j += 1) { - final = `${final}${htmlToText.fromString(ret[j])}\n`; - } - return String(encoding.convert(final)).trim(); - } - - module.exports = main; \ No newline at end of file