@involvex/youtube-music-cli 0.0.18 → 0.0.20
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/CHANGELOG.md +8 -0
- package/dist/source/cli.js +123 -8
- package/dist/source/components/import/ImportLayout.d.ts +1 -0
- package/dist/source/components/import/ImportLayout.js +119 -0
- package/dist/source/components/import/ImportProgress.d.ts +6 -0
- package/dist/source/components/import/ImportProgress.js +73 -0
- package/dist/source/components/layouts/MainLayout.js +15 -2
- package/dist/source/components/settings/Settings.js +6 -2
- package/dist/source/services/config/config.service.js +10 -0
- package/dist/source/services/import/import.service.d.ts +44 -0
- package/dist/source/services/import/import.service.js +272 -0
- package/dist/source/services/import/spotify.service.d.ts +40 -0
- package/dist/source/services/import/spotify.service.js +171 -0
- package/dist/source/services/import/track-matcher.service.d.ts +60 -0
- package/dist/source/services/import/track-matcher.service.js +271 -0
- package/dist/source/services/import/youtube-import.service.d.ts +17 -0
- package/dist/source/services/import/youtube-import.service.js +84 -0
- package/dist/source/services/web/static-file.service.d.ts +31 -0
- package/dist/source/services/web/static-file.service.js +163 -0
- package/dist/source/services/web/web-server-manager.d.ts +88 -0
- package/dist/source/services/web/web-server-manager.js +502 -0
- package/dist/source/services/web/web-streaming.service.d.ts +88 -0
- package/dist/source/services/web/web-streaming.service.js +290 -0
- package/dist/source/services/web/websocket.server.d.ts +63 -0
- package/dist/source/services/web/websocket.server.js +267 -0
- package/dist/source/stores/player.store.js +24 -0
- package/dist/source/types/cli.types.d.ts +8 -0
- package/dist/source/types/config.types.d.ts +2 -0
- package/dist/source/types/import.types.d.ts +72 -0
- package/dist/source/types/import.types.js +2 -0
- package/dist/source/types/web.types.d.ts +127 -0
- package/dist/source/types/web.types.js +2 -0
- package/dist/source/utils/constants.d.ts +1 -0
- package/dist/source/utils/constants.js +1 -0
- package/dist/youtube-music-cli.exe +0 -0
- package/package.json +8 -3
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Track } from './youtube-music.types.ts';
|
|
2
|
+
/** Supported import sources */
|
|
3
|
+
export type ImportSource = 'spotify' | 'youtube';
|
|
4
|
+
/** Import operation status */
|
|
5
|
+
export type ImportStatus = 'idle' | 'fetching' | 'matching' | 'creating' | 'completed' | 'failed' | 'cancelled';
|
|
6
|
+
/** Match confidence level */
|
|
7
|
+
export type MatchConfidence = 'high' | 'medium' | 'low' | 'none';
|
|
8
|
+
/** Import progress information */
|
|
9
|
+
export interface ImportProgress {
|
|
10
|
+
status: ImportStatus;
|
|
11
|
+
current: number;
|
|
12
|
+
total: number;
|
|
13
|
+
currentTrack?: string;
|
|
14
|
+
message: string;
|
|
15
|
+
}
|
|
16
|
+
/** Track match result */
|
|
17
|
+
export interface TrackMatch {
|
|
18
|
+
originalTrack: SpotifyTrack | YouTubeTrack;
|
|
19
|
+
matchedTrack: Track | null;
|
|
20
|
+
confidence: MatchConfidence;
|
|
21
|
+
error?: string;
|
|
22
|
+
}
|
|
23
|
+
/** Import result summary */
|
|
24
|
+
export interface ImportResult {
|
|
25
|
+
playlistId: string;
|
|
26
|
+
playlistName: string;
|
|
27
|
+
source: ImportSource;
|
|
28
|
+
total: number;
|
|
29
|
+
matched: number;
|
|
30
|
+
failed: number;
|
|
31
|
+
matches: TrackMatch[];
|
|
32
|
+
errors: string[];
|
|
33
|
+
duration: number;
|
|
34
|
+
}
|
|
35
|
+
/** Spotify track data */
|
|
36
|
+
export interface SpotifyTrack {
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
artists: string[];
|
|
40
|
+
album?: string;
|
|
41
|
+
duration: number;
|
|
42
|
+
trackNumber?: number;
|
|
43
|
+
}
|
|
44
|
+
/** Spotify playlist data */
|
|
45
|
+
export interface SpotifyPlaylist {
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
description?: string;
|
|
49
|
+
tracks: SpotifyTrack[];
|
|
50
|
+
isPublic: boolean;
|
|
51
|
+
owner?: string;
|
|
52
|
+
url?: string;
|
|
53
|
+
}
|
|
54
|
+
/** YouTube track data (for import) */
|
|
55
|
+
export interface YouTubeTrack {
|
|
56
|
+
id: string;
|
|
57
|
+
title: string;
|
|
58
|
+
name: string;
|
|
59
|
+
artists: string[];
|
|
60
|
+
album?: string;
|
|
61
|
+
duration: number;
|
|
62
|
+
thumbnail?: string;
|
|
63
|
+
}
|
|
64
|
+
/** YouTube playlist data (for import) */
|
|
65
|
+
export interface YouTubePlaylist {
|
|
66
|
+
id: string;
|
|
67
|
+
name: string;
|
|
68
|
+
description?: string;
|
|
69
|
+
tracks: YouTubeTrack[];
|
|
70
|
+
channelTitle?: string;
|
|
71
|
+
url?: string;
|
|
72
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { PlayerAction, PlayerState } from './player.types.ts';
|
|
2
|
+
import type { ImportProgress, ImportResult } from './import.types.ts';
|
|
3
|
+
import type { Track, Album, Artist, Playlist } from './youtube-music.types.ts';
|
|
4
|
+
/** WebSocket server message types */
|
|
5
|
+
export type ServerMessage = StateUpdateMessage | EventMessage | ErrorMessage | AuthMessage | ImportProgressMessage | ImportResultMessage | SearchResultsMessage | ConfigUpdateMessage;
|
|
6
|
+
/** Player state update message */
|
|
7
|
+
export interface StateUpdateMessage {
|
|
8
|
+
type: 'state-update';
|
|
9
|
+
state: Partial<PlayerState>;
|
|
10
|
+
}
|
|
11
|
+
/** Event message for one-time events */
|
|
12
|
+
export interface EventMessage {
|
|
13
|
+
type: 'event';
|
|
14
|
+
event: 'connected' | 'disconnected' | 'client-connected' | 'client-disconnected';
|
|
15
|
+
data?: unknown;
|
|
16
|
+
}
|
|
17
|
+
/** Error message from server */
|
|
18
|
+
export interface ErrorMessage {
|
|
19
|
+
type: 'error';
|
|
20
|
+
error: string;
|
|
21
|
+
code?: string;
|
|
22
|
+
}
|
|
23
|
+
/** Authentication message */
|
|
24
|
+
export interface AuthMessage {
|
|
25
|
+
type: 'auth';
|
|
26
|
+
success: boolean;
|
|
27
|
+
message?: string;
|
|
28
|
+
}
|
|
29
|
+
/** Import progress message */
|
|
30
|
+
export interface ImportProgressMessage {
|
|
31
|
+
type: 'import-progress';
|
|
32
|
+
data: ImportProgress;
|
|
33
|
+
}
|
|
34
|
+
/** Import result message */
|
|
35
|
+
export interface ImportResultMessage {
|
|
36
|
+
type: 'import-result';
|
|
37
|
+
data: ImportResult;
|
|
38
|
+
}
|
|
39
|
+
/** Search results message */
|
|
40
|
+
export interface SearchResultsMessage {
|
|
41
|
+
type: 'search-results';
|
|
42
|
+
results: SearchResult[];
|
|
43
|
+
}
|
|
44
|
+
/** Search result item */
|
|
45
|
+
export interface SearchResult {
|
|
46
|
+
type: 'song' | 'album' | 'artist' | 'playlist';
|
|
47
|
+
data: Track | Album | Artist | Playlist;
|
|
48
|
+
}
|
|
49
|
+
/** Configuration update message */
|
|
50
|
+
export interface ConfigUpdateMessage {
|
|
51
|
+
type: 'config-update';
|
|
52
|
+
config: Partial<Config>;
|
|
53
|
+
}
|
|
54
|
+
/** WebSocket client message types */
|
|
55
|
+
export type ClientMessage = CommandMessage | AuthRequestMessage | ImportRequestMessage | SearchRequestMessage | ConfigUpdateRequestMessage;
|
|
56
|
+
/** Command message from client */
|
|
57
|
+
export interface CommandMessage {
|
|
58
|
+
type: 'command';
|
|
59
|
+
action: PlayerAction;
|
|
60
|
+
}
|
|
61
|
+
/** Authentication request from client */
|
|
62
|
+
export interface AuthRequestMessage {
|
|
63
|
+
type: 'auth-request';
|
|
64
|
+
token: string;
|
|
65
|
+
}
|
|
66
|
+
/** Import request from client */
|
|
67
|
+
export interface ImportRequestMessage {
|
|
68
|
+
type: 'import-request';
|
|
69
|
+
source: 'spotify' | 'youtube';
|
|
70
|
+
url: string;
|
|
71
|
+
name?: string;
|
|
72
|
+
}
|
|
73
|
+
/** Search request from client */
|
|
74
|
+
export interface SearchRequestMessage {
|
|
75
|
+
type: 'search-request';
|
|
76
|
+
query: string;
|
|
77
|
+
searchType: 'all' | 'songs' | 'artists' | 'albums' | 'playlists';
|
|
78
|
+
}
|
|
79
|
+
/** Config update request from client */
|
|
80
|
+
export interface ConfigUpdateRequestMessage {
|
|
81
|
+
type: 'config-update';
|
|
82
|
+
config: Partial<Config>;
|
|
83
|
+
}
|
|
84
|
+
/** Configuration interface */
|
|
85
|
+
export interface Config {
|
|
86
|
+
theme: string;
|
|
87
|
+
volume: number;
|
|
88
|
+
repeat: 'off' | 'all' | 'one';
|
|
89
|
+
shuffle: boolean;
|
|
90
|
+
streamQuality: 'low' | 'medium' | 'high';
|
|
91
|
+
audioNormalization: boolean;
|
|
92
|
+
notifications: boolean;
|
|
93
|
+
discordRichPresence: boolean;
|
|
94
|
+
}
|
|
95
|
+
/** WebSocket client information */
|
|
96
|
+
export interface WebSocketClient {
|
|
97
|
+
id: string;
|
|
98
|
+
authenticated: boolean;
|
|
99
|
+
connectedAt: number;
|
|
100
|
+
lastHeartbeat: number;
|
|
101
|
+
}
|
|
102
|
+
/** Web server configuration */
|
|
103
|
+
export interface WebServerConfig {
|
|
104
|
+
enabled: boolean;
|
|
105
|
+
host: string;
|
|
106
|
+
port: number;
|
|
107
|
+
enableCors: boolean;
|
|
108
|
+
allowedOrigins: string[];
|
|
109
|
+
auth: {
|
|
110
|
+
enabled: boolean;
|
|
111
|
+
token?: string;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/** Web server options for CLI flags */
|
|
115
|
+
export interface WebServerOptions {
|
|
116
|
+
enabled: boolean;
|
|
117
|
+
host?: string;
|
|
118
|
+
port?: number;
|
|
119
|
+
webOnly?: boolean;
|
|
120
|
+
auth?: string;
|
|
121
|
+
}
|
|
122
|
+
/** Server statistics */
|
|
123
|
+
export interface ServerStats {
|
|
124
|
+
uptime: number;
|
|
125
|
+
clients: number;
|
|
126
|
+
totalConnections: number;
|
|
127
|
+
}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@involvex/youtube-music-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20",
|
|
4
4
|
"description": "- A Commandline music player for youtube-music",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -51,7 +51,10 @@
|
|
|
51
51
|
"typecheck": "tsc --noEmit",
|
|
52
52
|
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
|
|
53
53
|
"clean": "rimraf dist",
|
|
54
|
-
"release": "powershell -File scripts/release.ps1"
|
|
54
|
+
"release": "powershell -File scripts/release.ps1",
|
|
55
|
+
"build:web": "cd web && bun run build",
|
|
56
|
+
"dev:web": "cd web && bun run dev",
|
|
57
|
+
"build:all": "bun run build && bun run build:web"
|
|
55
58
|
},
|
|
56
59
|
"prettier": "@vdemedes/prettier-config",
|
|
57
60
|
"ava": {
|
|
@@ -73,7 +76,8 @@
|
|
|
73
76
|
"play-sound": "^1.1.6",
|
|
74
77
|
"react": "^19.2.4",
|
|
75
78
|
"youtube-ext": "^1.1.25",
|
|
76
|
-
"youtubei.js": "^16.0.1"
|
|
79
|
+
"youtubei.js": "^16.0.1",
|
|
80
|
+
"ws": "^8.18.0"
|
|
77
81
|
},
|
|
78
82
|
"devDependencies": {
|
|
79
83
|
"@eslint/js": "^10.0.1",
|
|
@@ -81,6 +85,7 @@
|
|
|
81
85
|
"@types/node": "^25.2.3",
|
|
82
86
|
"@types/node-notifier": "^8.0.5",
|
|
83
87
|
"@types/react": "^19.2.14",
|
|
88
|
+
"@types/ws": "^8.5.13",
|
|
84
89
|
"@vdemedes/prettier-config": "^2.0.1",
|
|
85
90
|
"ava": "^6.4.1",
|
|
86
91
|
"chalk": "^5.6.2",
|