@spira-lab/cli 0.0.10 → 0.0.11
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.cjs +21 -31
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -21365,18 +21365,10 @@ var commandDefinitions = [
|
|
|
21365
21365
|
arguments: [{ name: "url", description: "Public post or video URL.", required: true }],
|
|
21366
21366
|
options: [
|
|
21367
21367
|
{
|
|
21368
|
-
name: "
|
|
21369
|
-
flag: "--
|
|
21370
|
-
description: "
|
|
21371
|
-
type: "
|
|
21372
|
-
minimum: 144
|
|
21373
|
-
},
|
|
21374
|
-
{
|
|
21375
|
-
name: "quality",
|
|
21376
|
-
flag: "--quality <mode>",
|
|
21377
|
-
description: "compatible (default) grabs H.264 MP4 that any editor opens; best grabs the highest resolution, which may be WebM/AV1.",
|
|
21378
|
-
type: "string",
|
|
21379
|
-
enumValues: ["compatible", "best"]
|
|
21368
|
+
name: "formatId",
|
|
21369
|
+
flag: "--format-id <id>",
|
|
21370
|
+
description: "A format_id from `spira media info`. Omit for the best rung that plays everywhere. Every rung is delivered with audio.",
|
|
21371
|
+
type: "string"
|
|
21380
21372
|
},
|
|
21381
21373
|
{
|
|
21382
21374
|
name: "output",
|
|
@@ -21391,15 +21383,14 @@ var commandDefinitions = [
|
|
|
21391
21383
|
authRequired: true,
|
|
21392
21384
|
body: [
|
|
21393
21385
|
{ name: "url", source: "argument", from: "url" },
|
|
21394
|
-
{ name: "
|
|
21395
|
-
{ name: "quality", source: "option", from: "quality" }
|
|
21386
|
+
{ name: "formatId", source: "option", from: "formatId" }
|
|
21396
21387
|
]
|
|
21397
21388
|
},
|
|
21398
21389
|
resultType: "mediaAsset",
|
|
21399
21390
|
examples: [
|
|
21400
21391
|
"spira media video https://www.tiktok.com/@user/video/123",
|
|
21401
|
-
"spira media video https://www.youtube.com/watch?v=dQw4w9WgXcQ --
|
|
21402
|
-
"spira media video https://www.
|
|
21392
|
+
"spira media video https://www.youtube.com/watch?v=dQw4w9WgXcQ --output ./downloads/",
|
|
21393
|
+
"spira media video https://www.tiktok.com/@user/video/123 --format-id bytevc1_1080p_612574-0"
|
|
21403
21394
|
],
|
|
21404
21395
|
relatedCommands: ["spira media info <url>", "spira media thumbnail <url>"]
|
|
21405
21396
|
},
|
|
@@ -22549,7 +22540,7 @@ function formatMediaDuration(value) {
|
|
|
22549
22540
|
}
|
|
22550
22541
|
function renderMediaInfo(data) {
|
|
22551
22542
|
const info = objectRecord2(objectRecord2(data).info);
|
|
22552
|
-
const
|
|
22543
|
+
const options = Array.isArray(info.options) ? info.options.map(objectRecord2) : [];
|
|
22553
22544
|
const lines = [
|
|
22554
22545
|
`platform: ${valueToText(info.platform)}`,
|
|
22555
22546
|
`title: ${compactText(info.title)}`,
|
|
@@ -22561,21 +22552,20 @@ function renderMediaInfo(data) {
|
|
|
22561
22552
|
`url: ${valueToText(info.webpage_url ?? info.url)}`,
|
|
22562
22553
|
`suggestedFilename: ${valueToText(info.suggested_filename)}`
|
|
22563
22554
|
];
|
|
22564
|
-
if (
|
|
22555
|
+
if (options.length === 0) return `${lines.join("\n")}
|
|
22565
22556
|
`;
|
|
22566
|
-
const rows =
|
|
22567
|
-
format_id:
|
|
22568
|
-
|
|
22569
|
-
|
|
22570
|
-
fps:
|
|
22571
|
-
size: formatByteSize(
|
|
22572
|
-
|
|
22557
|
+
const rows = options.map((option) => ({
|
|
22558
|
+
format_id: option.format_id,
|
|
22559
|
+
resolution: option.label,
|
|
22560
|
+
codec: option.codec,
|
|
22561
|
+
fps: option.fps,
|
|
22562
|
+
size: formatByteSize(option.filesize),
|
|
22563
|
+
plays: option.compatible === true ? "anywhere" : "limited",
|
|
22564
|
+
audio: option.audio_source
|
|
22573
22565
|
}));
|
|
22574
|
-
if (rows.length === 0) return `${lines.join("\n")}
|
|
22575
|
-
`;
|
|
22576
22566
|
return `${lines.join("\n")}
|
|
22577
|
-
|
|
22578
|
-
${renderRows(rows, ["format_id", "
|
|
22567
|
+
downloadOptions (${rows.length}):
|
|
22568
|
+
${renderRows(rows, ["format_id", "resolution", "codec", "fps", "size", "plays", "audio"])}`;
|
|
22579
22569
|
}
|
|
22580
22570
|
function renderMediaAsset(data) {
|
|
22581
22571
|
const asset = objectRecord2(objectRecord2(data).asset);
|
|
@@ -23074,8 +23064,8 @@ function renderCommandIndex() {
|
|
|
23074
23064
|
`;
|
|
23075
23065
|
}
|
|
23076
23066
|
async function packageVersion() {
|
|
23077
|
-
if ("0.0.
|
|
23078
|
-
return "0.0.
|
|
23067
|
+
if ("0.0.11".length > 0) {
|
|
23068
|
+
return "0.0.11";
|
|
23079
23069
|
}
|
|
23080
23070
|
try {
|
|
23081
23071
|
const packageUrl = new URL("../package.json", import_meta.url);
|