@heavstaltech/api 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,634 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var axios3 = require('axios');
6
+ var cheerio3 = require('cheerio');
7
+ var ytdl = require('@distube/ytdl-core');
8
+ var yts = require('yt-search');
9
+ var FormData = require('form-data');
10
+ var https = require('https');
11
+
12
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
13
+
14
+ function _interopNamespace(e) {
15
+ if (e && e.__esModule) return e;
16
+ var n = Object.create(null);
17
+ if (e) {
18
+ Object.keys(e).forEach(function (k) {
19
+ if (k !== 'default') {
20
+ var d = Object.getOwnPropertyDescriptor(e, k);
21
+ Object.defineProperty(n, k, d.get ? d : {
22
+ enumerable: true,
23
+ get: function () { return e[k]; }
24
+ });
25
+ }
26
+ });
27
+ }
28
+ n.default = e;
29
+ return Object.freeze(n);
30
+ }
31
+
32
+ var axios3__default = /*#__PURE__*/_interopDefault(axios3);
33
+ var cheerio3__namespace = /*#__PURE__*/_interopNamespace(cheerio3);
34
+ var ytdl__default = /*#__PURE__*/_interopDefault(ytdl);
35
+ var yts__default = /*#__PURE__*/_interopDefault(yts);
36
+ var FormData__default = /*#__PURE__*/_interopDefault(FormData);
37
+ var https__default = /*#__PURE__*/_interopDefault(https);
38
+
39
+ // src/dl/tiktok.ts
40
+
41
+ // src/types.ts
42
+ var AUTHOR = {
43
+ name: "HEAVSTAL TECH",
44
+ source: "https://heavstal-tech.vercel.app"
45
+ };
46
+
47
+ // src/dl/tiktok.ts
48
+ var USER_AGENTS = [
49
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36",
50
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",
51
+ "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Mobile Safari/537.36",
52
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1"
53
+ ];
54
+ var getRandomHeaders = () => ({
55
+ "User-Agent": USER_AGENTS[Math.floor(Math.random() * USER_AGENTS.length)],
56
+ "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
57
+ "Accept": "application/json, text/javascript, */*; q=0.01"
58
+ });
59
+ var cleanText = (str) => str ? str.replace(/(<br?\s?\/?>)/gi, " \n").replace(/(<([^>]+)>)/gi, "").trim() : "";
60
+ var cleanUrl = (url) => url ? url.replace("https:", "http:") : "";
61
+ var lovetikFallback = async (url) => {
62
+ try {
63
+ const { data } = await axios3__default.default.post(
64
+ "https://lovetik.com/api/ajax/search",
65
+ new URLSearchParams({ query: url }),
66
+ { headers: getRandomHeaders() }
67
+ );
68
+ if (!data.links) throw new Error("Lovetik: No links found");
69
+ return {
70
+ author: AUTHOR,
71
+ status: true,
72
+ title: cleanText(data.desc),
73
+ cover: cleanUrl(data.cover),
74
+ no_watermark: cleanUrl(data.links.find((l) => l.a && !l.s)?.a),
75
+ // Usually the first link is No WM
76
+ watermark: cleanUrl(data.links.find((l) => l.s?.includes("Watermark"))?.a),
77
+ music: cleanUrl(data.links.find((l) => l.t?.includes("Audio"))?.a),
78
+ author_name: cleanText(data.author),
79
+ views: "N/A"
80
+ };
81
+ } catch (error) {
82
+ throw new Error(`Fallback Failed: ${error.message}`);
83
+ }
84
+ };
85
+ var tiktok = async (input) => {
86
+ return new Promise(async (resolve, reject) => {
87
+ try {
88
+ const isUrl = input.match(/tiktok\.com/i);
89
+ let data;
90
+ try {
91
+ if (isUrl) {
92
+ const apiUrl = `https://www.tikwm.com/api/?url=${encodeURIComponent(input)}`;
93
+ const response = await axios3__default.default.get(apiUrl, { headers: getRandomHeaders() });
94
+ if (response.data.code !== 0) throw new Error("Private video or Invalid URL");
95
+ data = response.data.data;
96
+ } else {
97
+ const apiUrl = `https://www.tikwm.com/api/feed/search`;
98
+ const response = await axios3__default.default.post(
99
+ apiUrl,
100
+ new URLSearchParams({
101
+ keywords: input,
102
+ count: "1",
103
+ cursor: "0",
104
+ HD: "1"
105
+ }),
106
+ { headers: { ...getRandomHeaders(), "Cookie": "current_language=en" } }
107
+ );
108
+ if (!response.data.data?.videos || response.data.data.videos.length === 0) {
109
+ throw new Error(`No results found for: ${input}`);
110
+ }
111
+ data = response.data.data.videos[0];
112
+ }
113
+ const result = {
114
+ author: AUTHOR,
115
+ status: true,
116
+ title: data.title,
117
+ cover: data.cover,
118
+ origin_cover: data.origin_cover,
119
+ no_watermark: data.play,
120
+ watermark: data.wmplay,
121
+ music: data.music,
122
+ views: data.play_count,
123
+ likes: data.digg_count,
124
+ comments: data.comment_count,
125
+ shares: data.share_count,
126
+ downloads: data.download_count
127
+ };
128
+ resolve(result);
129
+ } catch (primaryError) {
130
+ if (isUrl) {
131
+ console.warn("Primary TikTok API failed, switching to fallback...");
132
+ const fallbackData = await lovetikFallback(input);
133
+ resolve(fallbackData);
134
+ } else {
135
+ throw primaryError;
136
+ }
137
+ }
138
+ } catch (error) {
139
+ reject({
140
+ author: AUTHOR,
141
+ status: false,
142
+ message: error.message || "TikTok processing failed"
143
+ });
144
+ }
145
+ });
146
+ };
147
+ var tiktokSlide = async (url) => {
148
+ try {
149
+ const response = await axios3__default.default.post("https://api.ttsave.app/", {
150
+ id: url,
151
+ hash: "1e3a27c51eb6370b0db6f9348a481d69",
152
+ mode: "slide",
153
+ locale: "en",
154
+ loading_indicator_url: "https://ttsave.app/images/slow-down.gif",
155
+ unlock_url: "https://ttsave.app/en/unlock"
156
+ }, {
157
+ headers: getRandomHeaders()
158
+ });
159
+ const $ = cheerio3__namespace.load(response.data);
160
+ const $element = $("div.flex.flex-col.items-center.justify-center.mt-2.mb-5");
161
+ if ($element.length === 0) throw new Error("Slide not found or service unavailable");
162
+ const statsDiv = $element.find("div.flex.flex-row.items-center.justify-center");
163
+ return {
164
+ author: AUTHOR,
165
+ status: true,
166
+ uniqueId: $element.find("input#unique-id").attr("value"),
167
+ title: $element.find("div.flex.flex-row.items-center.justify-center h2").text().trim(),
168
+ profileImage: $element.find("a").first().find("img").attr("src"),
169
+ profileUrl: $element.find("a").first().attr("href"),
170
+ hashtags: $element.find("p.text-gray-600").text().split(" ").filter(Boolean),
171
+ likes: statsDiv.eq(0).find("span").text().trim(),
172
+ comments: statsDiv.eq(1).find("span").text().trim(),
173
+ shares: statsDiv.eq(2).find("span").text().trim(),
174
+ downloads: statsDiv.eq(3).find("span").text().trim(),
175
+ views: statsDiv.eq(4).find("span").text().trim()
176
+ };
177
+ } catch (error) {
178
+ return {
179
+ author: AUTHOR,
180
+ status: false,
181
+ title: "Error",
182
+ views: error.message
183
+ };
184
+ }
185
+ };
186
+ var USER_AGENTS2 = [
187
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36",
188
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",
189
+ "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Mobile Safari/537.36",
190
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1"
191
+ ];
192
+ var getRandomHeaders2 = () => ({
193
+ "User-Agent": USER_AGENTS2[Math.floor(Math.random() * USER_AGENTS2.length)],
194
+ "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
195
+ "Accept-Language": "en-US,en;q=0.5",
196
+ "Accept-Encoding": "gzip, deflate, br",
197
+ "Connection": "keep-alive"
198
+ });
199
+ var fbdl = async (url) => {
200
+ return new Promise(async (resolve, reject) => {
201
+ try {
202
+ const { data } = await axios3__default.default.post(
203
+ "https://getmyfb.com/process",
204
+ new URLSearchParams({
205
+ id: url,
206
+ locale: "en"
207
+ }),
208
+ {
209
+ headers: {
210
+ ...getRandomHeaders2(),
211
+ "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
212
+ "Cookie": "PHPSESSID=mtkljtmk74aiej5h6d846gjbo4; __cflb=04dToeZfC9vebXjRcJCMjjSQh5PprejufZXs2vHCt5; _token=K5Qobnj4QvoYKeLCW6uk"
213
+ //s
214
+ }
215
+ }
216
+ );
217
+ const $ = cheerio3__namespace.load(data);
218
+ const results = [];
219
+ const title = $("div.results-item-text").eq(0).text().trim();
220
+ const thumbnail = $(".results-item-image-wrapper img").attr("src") || "";
221
+ $("a.btn-download").each((i, el) => {
222
+ const link = $(el).attr("href");
223
+ if (link) {
224
+ results.push({
225
+ author: AUTHOR,
226
+ status: true,
227
+ type: "video",
228
+ title: title || "Facebook Video",
229
+ thumbnail,
230
+ url: link
231
+ });
232
+ }
233
+ });
234
+ if (results.length === 0) {
235
+ const singleLink = $("a").attr("href");
236
+ if (singleLink && singleLink.startsWith("http")) {
237
+ results.push({
238
+ author: AUTHOR,
239
+ status: true,
240
+ type: "video",
241
+ title,
242
+ thumbnail,
243
+ url: singleLink
244
+ });
245
+ } else {
246
+ reject(new Error("No Facebook video found (Private or Invalid URL)"));
247
+ return;
248
+ }
249
+ }
250
+ resolve(results);
251
+ } catch (error) {
252
+ reject({
253
+ author: AUTHOR,
254
+ status: false,
255
+ message: error.message || "Facebook Download Failed"
256
+ });
257
+ }
258
+ });
259
+ };
260
+ var igdl = async (url) => {
261
+ return new Promise(async (resolve, reject) => {
262
+ try {
263
+ const initialResponse = await axios3__default.default.get("https://indown.io/", {
264
+ headers: getRandomHeaders2()
265
+ });
266
+ const _$ = cheerio3__namespace.load(initialResponse.data);
267
+ const referer = _$("input[name=referer]").val();
268
+ const locale = _$("input[name=locale]").val();
269
+ const _token = _$("input[name=_token]").val();
270
+ const cookies = initialResponse.headers["set-cookie"]?.join(" ") || "";
271
+ if (!_token) throw new Error("Failed to fetch Instagram token");
272
+ const { data } = await axios3__default.default.post(
273
+ "https://indown.io/download",
274
+ new URLSearchParams({
275
+ link: url,
276
+ referer,
277
+ locale,
278
+ _token
279
+ }),
280
+ {
281
+ headers: {
282
+ ...getRandomHeaders2(),
283
+ "Content-Type": "application/x-www-form-urlencoded",
284
+ "Cookie": cookies,
285
+ "Origin": "https://indown.io",
286
+ "Referer": "https://indown.io/"
287
+ }
288
+ }
289
+ );
290
+ const $ = cheerio3__namespace.load(data);
291
+ const result = [];
292
+ $("video").each(function() {
293
+ const $$ = $(this);
294
+ const src = $$.find("source").attr("src");
295
+ const poster = $$.attr("poster");
296
+ if (src) {
297
+ result.push({
298
+ author: AUTHOR,
299
+ status: true,
300
+ type: "video",
301
+ thumbnail: poster,
302
+ url: src
303
+ });
304
+ }
305
+ });
306
+ $("img.img-fluid").each(function() {
307
+ const $$ = $(this);
308
+ const src = $$.attr("src");
309
+ if (src) {
310
+ result.push({
311
+ author: AUTHOR,
312
+ status: true,
313
+ type: "image",
314
+ thumbnail: src,
315
+ url: src
316
+ });
317
+ }
318
+ });
319
+ if (result.length === 0) {
320
+ $(".btn-group a").each((i, el) => {
321
+ const link = $(el).attr("href");
322
+ if (link && link !== "#") {
323
+ result.push({
324
+ author: AUTHOR,
325
+ status: true,
326
+ type: "video",
327
+ url: link
328
+ });
329
+ }
330
+ });
331
+ }
332
+ if (result.length === 0) {
333
+ const errorMsg = $(".alert-danger").text().trim();
334
+ reject(new Error(errorMsg || "No media found. Account might be private."));
335
+ } else {
336
+ resolve(result);
337
+ }
338
+ } catch (error) {
339
+ reject({
340
+ author: AUTHOR,
341
+ status: false,
342
+ message: error.message || "Instagram Download Failed"
343
+ });
344
+ }
345
+ });
346
+ };
347
+ var search = async (query) => {
348
+ return new Promise(async (resolve, reject) => {
349
+ try {
350
+ const result = await yts__default.default(query);
351
+ if (!result.all || result.all.length === 0) {
352
+ return reject(new Error("No results found on YouTube."));
353
+ }
354
+ const data = result.all.map((item) => {
355
+ return {
356
+ type: item.type,
357
+ url: item.url,
358
+ title: item.title,
359
+ description: item.description,
360
+ image: item.image,
361
+ thumbnail: item.thumbnail,
362
+ seconds: item.seconds,
363
+ timestamp: item.timestamp,
364
+ views: item.views,
365
+ ago: item.ago,
366
+ author: item.author ? {
367
+ name: item.author.name,
368
+ url: item.author.url
369
+ } : void 0
370
+ };
371
+ });
372
+ resolve(data);
373
+ } catch (error) {
374
+ reject({
375
+ message: error.message || "YouTube Search Failed"
376
+ });
377
+ }
378
+ });
379
+ };
380
+ var ytmp3 = async (url) => {
381
+ return new Promise(async (resolve, reject) => {
382
+ try {
383
+ if (!ytdl__default.default.validateURL(url)) {
384
+ throw new Error("Invalid YouTube URL");
385
+ }
386
+ const info = await ytdl__default.default.getInfo(url);
387
+ const format = ytdl__default.default.chooseFormat(info.formats, {
388
+ quality: "highestaudio",
389
+ filter: "audioonly"
390
+ });
391
+ if (!format) throw new Error("No audio stream found");
392
+ const result = {
393
+ author: AUTHOR,
394
+ title: info.videoDetails.title,
395
+ thumbnail: info.videoDetails.thumbnails[info.videoDetails.thumbnails.length - 1].url,
396
+ // Highest res
397
+ channel: info.videoDetails.ownerChannelName,
398
+ published: info.videoDetails.publishDate,
399
+ views: info.videoDetails.viewCount,
400
+ duration: info.videoDetails.lengthSeconds,
401
+ url: format.url
402
+ };
403
+ resolve(result);
404
+ } catch (error) {
405
+ reject({
406
+ author: AUTHOR,
407
+ status: false,
408
+ message: error.message || "YouTube MP3 Failed"
409
+ });
410
+ }
411
+ });
412
+ };
413
+ var ytmp4 = async (url) => {
414
+ return new Promise(async (resolve, reject) => {
415
+ try {
416
+ if (!ytdl__default.default.validateURL(url)) {
417
+ throw new Error("Invalid YouTube URL");
418
+ }
419
+ const info = await ytdl__default.default.getInfo(url);
420
+ const format = ytdl__default.default.chooseFormat(info.formats, {
421
+ quality: "highest",
422
+ filter: (f) => f.hasAudio === true && f.hasVideo === true && f.container === "mp4"
423
+ });
424
+ const finalFormat = format || ytdl__default.default.chooseFormat(info.formats, {
425
+ quality: "highest",
426
+ filter: (f) => f.hasAudio === true && f.hasVideo === true
427
+ });
428
+ if (!finalFormat) throw new Error("No video stream found");
429
+ const result = {
430
+ author: AUTHOR,
431
+ title: info.videoDetails.title,
432
+ thumbnail: info.videoDetails.thumbnails[info.videoDetails.thumbnails.length - 1].url,
433
+ channel: info.videoDetails.ownerChannelName,
434
+ published: info.videoDetails.publishDate,
435
+ views: info.videoDetails.viewCount,
436
+ duration: info.videoDetails.lengthSeconds,
437
+ url: finalFormat.url
438
+ };
439
+ resolve(result);
440
+ } catch (error) {
441
+ reject({
442
+ author: AUTHOR,
443
+ status: false,
444
+ message: error.message || "YouTube MP4 Failed"
445
+ });
446
+ }
447
+ });
448
+ };
449
+ var play = async (query, type = "mp3") => {
450
+ try {
451
+ const searchResults = await yts__default.default(query);
452
+ const videos = searchResults.all.filter((v) => v.type === "video");
453
+ if (videos.length === 0) {
454
+ throw new Error(`No video results found for: ${query}`);
455
+ }
456
+ const firstVideo = videos[0];
457
+ if (type === "mp4") {
458
+ return await ytmp4(firstVideo.url);
459
+ } else {
460
+ return await ytmp3(firstVideo.url);
461
+ }
462
+ } catch (error) {
463
+ throw new Error(`Play Failed: ${error.message}`);
464
+ }
465
+ };
466
+ var HEADERS = {
467
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36",
468
+ "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
469
+ };
470
+ var ignoreSSL = new https__default.default.Agent({
471
+ rejectUnauthorized: false,
472
+ servername: "inferenceengine.vyro.ai"
473
+ });
474
+ var ssweb = async (url, device = "desktop") => {
475
+ return new Promise(async (resolve, reject) => {
476
+ try {
477
+ const baseURL = "https://www.screenshotmachine.com";
478
+ const param = { url, device, cacheLimit: 0 };
479
+ const { data, headers } = await axios3__default.default.post(
480
+ `${baseURL}/capture.php`,
481
+ new URLSearchParams(param),
482
+ {
483
+ headers: { "content-type": "application/x-www-form-urlencoded; charset=UTF-8", "User-Agent": HEADERS["User-Agent"] }
484
+ }
485
+ );
486
+ if (data.status !== "success") throw new Error("Screenshot generation failed");
487
+ const cookies = headers["set-cookie"]?.join("") || "";
488
+ const imageResponse = await axios3__default.default.get(`${baseURL}/${data.link}`, {
489
+ headers: { "cookie": cookies, "User-Agent": HEADERS["User-Agent"] },
490
+ responseType: "arraybuffer"
491
+ });
492
+ resolve(imageResponse.data);
493
+ } catch (error) {
494
+ reject(new Error(`SSWeb Failed: ${error.message}`));
495
+ }
496
+ });
497
+ };
498
+ var remini = async (imageUrl, method = "enhance") => {
499
+ return new Promise(async (resolve, reject) => {
500
+ try {
501
+ const validMethods = ["enhance", "recolor", "dehaze"];
502
+ const selectedMethod = validMethods.includes(method) ? method : "enhance";
503
+ const imgBuffer = await axios3__default.default.get(imageUrl, { responseType: "arraybuffer" });
504
+ const form = new FormData__default.default();
505
+ form.append("model_version", 1, {
506
+ header: { "Content-Transfer-Encoding": "binary", "contentType": "multipart/form-data; charset=utf-8" }
507
+ });
508
+ form.append("image", Buffer.from(imgBuffer.data), {
509
+ filename: "enhance_image_body.jpg",
510
+ contentType: "image/jpeg"
511
+ });
512
+ const url = `https://inferenceengine.vyro.ai/${selectedMethod}`;
513
+ const response = await axios3__default.default.post(url, form, {
514
+ headers: {
515
+ ...form.getHeaders(),
516
+ "User-Agent": "okhttp/4.9.3",
517
+ "Connection": "Keep-Alive",
518
+ "Accept-Encoding": "gzip"
519
+ },
520
+ responseType: "arraybuffer",
521
+ httpsAgent: ignoreSSL
522
+ });
523
+ resolve(response.data);
524
+ } catch (error) {
525
+ reject(new Error(`Remini Failed: ${error.message}`));
526
+ }
527
+ });
528
+ };
529
+ var styleText = async (text) => {
530
+ return new Promise(async (resolve, reject) => {
531
+ try {
532
+ const { data } = await axios3__default.default.get(`http://qaz.wtf/u/convert.cgi?text=${encodeURIComponent(text)}`);
533
+ const $ = cheerio3__namespace.load(data);
534
+ const result = [];
535
+ $("table > tbody > tr").each((i, el) => {
536
+ const name = $(el).find("td").first().text().trim();
537
+ const styled = $(el).find("td").eq(1).text().trim();
538
+ if (name && styled) {
539
+ result.push({ author: AUTHOR, name, result: styled });
540
+ }
541
+ });
542
+ resolve(result);
543
+ } catch (error) {
544
+ reject(new Error(`StyleText Failed: ${error.message}`));
545
+ }
546
+ });
547
+ };
548
+ var wattpad = async (query) => {
549
+ try {
550
+ const { data } = await axios3__default.default.get(`https://www.wattpad.com/search/${encodeURIComponent(query)}`, { headers: HEADERS });
551
+ const $ = cheerio3__namespace.load(data);
552
+ const results = [];
553
+ $(".story-card").each((i, el) => {
554
+ const title = $(el).find(".story-title").text().trim();
555
+ const image = $(el).find(".cover img").attr("src");
556
+ const link = "https://www.wattpad.com" + $(el).find("a.story-card-data").attr("href");
557
+ const reads = $(el).find(".read-count").text().trim();
558
+ if (title) results.push({ author: AUTHOR, title, image, link, reads });
559
+ });
560
+ if (results.length === 0) {
561
+ $("div.cover").each((i, el) => {
562
+ results.push({ author: AUTHOR, image: $(el).find("img").attr("src") });
563
+ });
564
+ }
565
+ return results;
566
+ } catch (error) {
567
+ throw new Error(`Wattpad Failed: ${error.message}`);
568
+ }
569
+ };
570
+ var chords = async (query) => {
571
+ try {
572
+ const searchUrl = `https://www.gitagram.com/?s=${encodeURIComponent(query).replace(/%20/g, "+")}`;
573
+ const { data } = await axios3__default.default.get(searchUrl, { headers: HEADERS });
574
+ const $ = cheerio3__namespace.load(data);
575
+ const firstResultUrl = $("table.table > tbody > tr").eq(0).find("td").eq(0).find("a").eq(0).attr("href");
576
+ if (!firstResultUrl) throw new Error("No chords found");
577
+ const songPage = await axios3__default.default.get(firstResultUrl, { headers: HEADERS });
578
+ const $song = cheerio3__namespace.load(songPage.data);
579
+ const $hcontent = $song("div.hcontent");
580
+ const artist = $hcontent.find("div > a > span.subtitle").text().trim();
581
+ const title = $hcontent.find("h1.title").text().trim();
582
+ const content = $song("div.content > pre").text().trim();
583
+ return { author: AUTHOR, title, artist, url: firstResultUrl, chord: content };
584
+ } catch (error) {
585
+ throw new Error(`Chords Failed: ${error.message}`);
586
+ }
587
+ };
588
+
589
+ // src/index.ts
590
+ var downloader = {
591
+ tiktok,
592
+ tiktokSlide,
593
+ igdl,
594
+ fbdl,
595
+ ytmp3,
596
+ ytmp4,
597
+ play
598
+ };
599
+ var search2 = {
600
+ youtube: search,
601
+ wattpad,
602
+ chords
603
+ };
604
+ var tools = {
605
+ ssweb,
606
+ remini,
607
+ styleText
608
+ };
609
+ var index_default = {
610
+ downloader,
611
+ search: search2,
612
+ tools
613
+ };
614
+
615
+ exports.AUTHOR = AUTHOR;
616
+ exports.chords = chords;
617
+ exports.default = index_default;
618
+ exports.downloader = downloader;
619
+ exports.fbdl = fbdl;
620
+ exports.igdl = igdl;
621
+ exports.play = play;
622
+ exports.remini = remini;
623
+ exports.search = search2;
624
+ exports.ssweb = ssweb;
625
+ exports.styleText = styleText;
626
+ exports.tiktok = tiktok;
627
+ exports.tiktokSlide = tiktokSlide;
628
+ exports.tools = tools;
629
+ exports.wattpad = wattpad;
630
+ exports.ytSearch = search;
631
+ exports.ytmp3 = ytmp3;
632
+ exports.ytmp4 = ytmp4;
633
+ //# sourceMappingURL=index.js.map
634
+ //# sourceMappingURL=index.js.map