Skip to content

Commit 285c74c

Browse files
committed
replace terminal-link with hyperlinker
1 parent c0175f1 commit 285c74c

File tree

4 files changed

+21
-30
lines changed

4 files changed

+21
-30
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
"colorette": "^2.0.19",
2424
"ffmpeg-static": "^5.1.0",
2525
"fluent-ffmpeg": "^2.1.2",
26+
"hyperlinker": "^1.0.0",
2627
"inquirer": "^8.2.4",
2728
"inquirer-select-directory": "^1.2.0",
2829
"sanitize-filename": "^1.6.3",
2930
"spotify-web-api-node": "^5.0.2",
30-
"terminal-link": "^2.1.1",
3131
"undici": "^5.10.0",
3232
"youtubei.js": "^2.0.0",
3333
"ytdl-core": "^4.11.2"

src/lib/Daunroda.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { blueBright, cyanBright, greenBright, yellowBright } from "colorette";
22
import { EventEmitter } from "node:stream";
3-
import terminalLink from "terminal-link";
43
import { ensureDir } from "./fs-utils";
54
import { Spotify } from "./Spotify";
65
import { YouTube } from "./YouTube";
76

7+
// eslint-disable-next-line @typescript-eslint/no-var-requires
8+
const hyperlinker = require("hyperlinker");
9+
810
export class Daunroda extends EventEmitter {
911
public config: Config;
1012
public constructor(config: Config) {
@@ -51,7 +53,7 @@ export class Daunroda extends EventEmitter {
5153
this.emit(
5254
"info",
5355
`${yellowBright(
54-
terminalLink(
56+
hyperlinker(
5557
"Success!",
5658
"https://www.myinstants.com/media/instants_images/boratgs.jpg"
5759
)

src/lib/YouTube.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { tmpdir } from "node:os";
1717
import { join } from "node:path";
1818
import type { Readable } from "node:stream";
1919
import sanitize from "sanitize-filename";
20-
import terminalLink from "terminal-link";
2120
import { request } from "undici";
2221
import { Innertube } from "youtubei.js";
2322
import type MusicResponsiveListItem from "youtubei.js/dist/src/parser/classes/MusicResponsiveListItem";
@@ -26,6 +25,9 @@ import type { Daunroda } from "./Daunroda";
2625
import { ensureDir, exists } from "./fs-utils";
2726
import type { Processed } from "./Spotify";
2827

28+
// eslint-disable-next-line @typescript-eslint/no-var-requires
29+
const hyperlinker = require("hyperlinker");
30+
2931
ffmpeg.setFfmpegPath(ffmpegPath!);
3032

3133
const reject = [
@@ -86,7 +88,7 @@ export class YouTube {
8688
const progress = new cliProgress.SingleBar(
8789
{
8890
format: `Downloading ${blackBright(
89-
terminalLink(playlist.name, playlist.url)
91+
hyperlinker(playlist.name, playlist.url)
9092
)} [{bar}] ${greenBright("{percentage}%")} | ETA: ${yellowBright(
9193
"{eta}s"
9294
)} | ${blueBright("{value}/{total}")}`
@@ -180,12 +182,12 @@ export class YouTube {
180182
)}/${cyanBright(
181183
playlist.songs.length
182184
)} songs from the "${blackBright(
183-
terminalLink(playlist.name, playlist.url)
185+
hyperlinker(playlist.name, playlist.url)
184186
)}" playlist in ${cyan(this.stopwatch.toString())}!\n`
185187
: `Found and downloaded all songs (${cyanBright(
186188
playlist.songs.length
187189
)}) from the "${blackBright(
188-
terminalLink(playlist.name, playlist.url)
190+
hyperlinker(playlist.name, playlist.url)
189191
)}" playlist in ${cyan(this.stopwatch.toString())}!\n`
190192
);
191193
}
@@ -202,7 +204,7 @@ export class YouTube {
202204
download.res.name ?? download.res.title ?? ""
203205
)}) but it was rejected because of ${
204206
download.reason
205-
}. Do you want to download ${terminalLink(
207+
}. Do you want to download ${hyperlinker(
206208
yellowBright("this"),
207209
`https://music.youtube.com/watch?v=${download.res.id}`
208210
)} anyway?`

yarn.lock

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -855,13 +855,13 @@ __metadata:
855855
ffmpeg-static: ^5.1.0
856856
fluent-ffmpeg: ^2.1.2
857857
husky: ^8.0.0
858+
hyperlinker: ^1.0.0
858859
inquirer: ^8.2.4
859860
inquirer-select-directory: ^1.2.0
860861
pinst: ^3.0.0
861862
prettier: ^2.7.1
862863
sanitize-filename: ^1.6.3
863864
spotify-web-api-node: ^5.0.2
864-
terminal-link: ^2.1.1
865865
typescript: ^4.8.2
866866
undici: ^5.10.0
867867
youtubei.js: ^2.0.0
@@ -1567,6 +1567,13 @@ __metadata:
15671567
languageName: node
15681568
linkType: hard
15691569

1570+
"hyperlinker@npm:^1.0.0":
1571+
version: 1.0.0
1572+
resolution: "hyperlinker@npm:1.0.0"
1573+
checksum: f6d020ac552e9d048668206c805a737262b4c395546c773cceea3bc45252c46b4fa6eeb67c5896499dad00d21cb2f20f89fdd480a4529cfa3d012da2957162f9
1574+
languageName: node
1575+
linkType: hard
1576+
15701577
"iconv-lite@npm:^0.4.24":
15711578
version: 0.4.24
15721579
resolution: "iconv-lite@npm:0.4.24"
@@ -2681,7 +2688,7 @@ __metadata:
26812688
languageName: node
26822689
linkType: hard
26832690

2684-
"supports-color@npm:^7.0.0, supports-color@npm:^7.1.0":
2691+
"supports-color@npm:^7.1.0":
26852692
version: 7.2.0
26862693
resolution: "supports-color@npm:7.2.0"
26872694
dependencies:
@@ -2690,26 +2697,6 @@ __metadata:
26902697
languageName: node
26912698
linkType: hard
26922699

2693-
"supports-hyperlinks@npm:^2.0.0":
2694-
version: 2.3.0
2695-
resolution: "supports-hyperlinks@npm:2.3.0"
2696-
dependencies:
2697-
has-flag: ^4.0.0
2698-
supports-color: ^7.0.0
2699-
checksum: 9ee0de3c8ce919d453511b2b1588a8205bd429d98af94a01df87411391010fe22ca463f268c84b2ce2abad019dfff8452aa02806eeb5c905a8d7ad5c4f4c52b8
2700-
languageName: node
2701-
linkType: hard
2702-
2703-
"terminal-link@npm:^2.1.1":
2704-
version: 2.1.1
2705-
resolution: "terminal-link@npm:2.1.1"
2706-
dependencies:
2707-
ansi-escapes: ^4.2.1
2708-
supports-hyperlinks: ^2.0.0
2709-
checksum: ce3d2cd3a438c4a9453947aa664581519173ea40e77e2534d08c088ee6dda449eabdbe0a76d2a516b8b73c33262fedd10d5270ccf7576ae316e3db170ce6562f
2710-
languageName: node
2711-
linkType: hard
2712-
27132700
"text-table@npm:^0.2.0":
27142701
version: 0.2.0
27152702
resolution: "text-table@npm:0.2.0"

0 commit comments

Comments
 (0)