@mkterswingman/5mghost-yonder 0.0.17 โ 0.0.18
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/cli/index.js +2 -2
- package/dist/cli/setup.js +16 -8
- package/dist/cli/setupCookies.d.ts +5 -1
- package/dist/cli/setupCookies.js +9 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -82,8 +82,8 @@ async function main() {
|
|
|
82
82
|
break;
|
|
83
83
|
}
|
|
84
84
|
case "setup-cookies": {
|
|
85
|
-
const { runSetupCookies } = await import("./setupCookies.js");
|
|
86
|
-
await runSetupCookies();
|
|
85
|
+
const { runSetupCookies, parseSetupCookiesArgs } = await import("./setupCookies.js");
|
|
86
|
+
await runSetupCookies({}, parseSetupCookiesArgs(process.argv.slice(3)));
|
|
87
87
|
break;
|
|
88
88
|
}
|
|
89
89
|
case "uninstall": {
|
package/dist/cli/setup.js
CHANGED
|
@@ -122,6 +122,9 @@ export function getCookieSetupDeferredHint() {
|
|
|
122
122
|
];
|
|
123
123
|
}
|
|
124
124
|
export async function runSetup() {
|
|
125
|
+
const installerMode = process.env.YT_MCP_INSTALLER_MODE === "1";
|
|
126
|
+
const skipCookieStep = installerMode || process.env.YT_MCP_SETUP_SKIP_COOKIES === "1";
|
|
127
|
+
const quietSummary = installerMode || process.env.YT_MCP_SETUP_QUIET_SUMMARY === "1";
|
|
125
128
|
console.log("\n๐ yt-mcp setup\n");
|
|
126
129
|
ensureConfigDir();
|
|
127
130
|
const hasBrowser = canOpenBrowser();
|
|
@@ -235,7 +238,10 @@ export async function runSetup() {
|
|
|
235
238
|
}
|
|
236
239
|
// โโ Step 4: YouTube Cookies โโ
|
|
237
240
|
console.log("Step 4/5: YouTube cookies...");
|
|
238
|
-
if (
|
|
241
|
+
if (skipCookieStep) {
|
|
242
|
+
console.log(" โน๏ธ Deferred to installer cookie flow");
|
|
243
|
+
}
|
|
244
|
+
else if (!hasBrowser) {
|
|
239
245
|
for (const line of getCookieSetupDeferredHint()) {
|
|
240
246
|
console.log(line);
|
|
241
247
|
}
|
|
@@ -329,12 +335,14 @@ export async function runSetup() {
|
|
|
329
335
|
console.log(" - Output path: ~/Downloads/yt-mcp/YYYY-MM-DD_<video_id>");
|
|
330
336
|
console.log(" - `ffmpeg` is required for video download modes");
|
|
331
337
|
console.log("");
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
+
if (!quietSummary) {
|
|
339
|
+
console.log("โ
Setup complete!");
|
|
340
|
+
if (hasBrowser) {
|
|
341
|
+
console.log(' Open your AI client and try: "ๆ็ดข Python ๆ็จ"');
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
console.log(" Set YT_MCP_TOKEN in your MCP env config, then restart your AI client.");
|
|
345
|
+
}
|
|
346
|
+
console.log("");
|
|
338
347
|
}
|
|
339
|
-
console.log("");
|
|
340
348
|
}
|
|
@@ -51,6 +51,9 @@ export interface SetupCookiesDeps {
|
|
|
51
51
|
runManualCookieSetup: typeof runManualCookieSetup;
|
|
52
52
|
log: (message: string) => void;
|
|
53
53
|
}
|
|
54
|
+
export interface SetupCookiesOptions {
|
|
55
|
+
importOnly?: boolean;
|
|
56
|
+
}
|
|
54
57
|
type SetupCookiesChromium = Awaited<ReturnType<SetupCookiesDeps["loadChromium"]>>;
|
|
55
58
|
interface CdpCookie {
|
|
56
59
|
name: string;
|
|
@@ -76,5 +79,6 @@ export declare function runManualCookieSetup(chromium: SetupCookiesChromium, dep
|
|
|
76
79
|
/**
|
|
77
80
|
* Interactive cookie setup โ opens a visible browser for user to log in.
|
|
78
81
|
*/
|
|
79
|
-
export declare function
|
|
82
|
+
export declare function parseSetupCookiesArgs(argv: string[]): SetupCookiesOptions;
|
|
83
|
+
export declare function runSetupCookies(overrides?: Partial<SetupCookiesDeps>, options?: SetupCookiesOptions): Promise<void>;
|
|
80
84
|
export {};
|
package/dist/cli/setupCookies.js
CHANGED
|
@@ -361,7 +361,12 @@ export async function runManualCookieSetup(chromium, deps) {
|
|
|
361
361
|
/**
|
|
362
362
|
* Interactive cookie setup โ opens a visible browser for user to log in.
|
|
363
363
|
*/
|
|
364
|
-
export
|
|
364
|
+
export function parseSetupCookiesArgs(argv) {
|
|
365
|
+
return {
|
|
366
|
+
importOnly: argv.includes("--import-only"),
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
export async function runSetupCookies(overrides = {}, options = {}) {
|
|
365
370
|
const deps = buildSetupCookiesDeps(overrides);
|
|
366
371
|
deps.log("\n๐ช YouTube Cookie Setup\n");
|
|
367
372
|
deps.ensureConfigDir();
|
|
@@ -376,5 +381,8 @@ export async function runSetupCookies(overrides = {}) {
|
|
|
376
381
|
if (imported) {
|
|
377
382
|
return;
|
|
378
383
|
}
|
|
384
|
+
if (options.importOnly) {
|
|
385
|
+
throw new Error("No reusable YouTube session found in local Chrome/Edge profiles");
|
|
386
|
+
}
|
|
379
387
|
await deps.runManualCookieSetup(chromium, deps);
|
|
380
388
|
}
|