vidup 1.0.19 → 1.0.21
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/bin/cli.js +2 -3
- package/dist/lib/index.d.ts +0 -6
- package/dist/lib/index.js +1 -1
- package/dist/{lib-D5PZ18VU.js → lib-vuAW453K.js} +6 -11
- package/package.json +19 -18
- package/readme.md +33 -14
package/dist/bin/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as version, n as stripVideoMetadataInDirectory, r as setLogger, t as syncVideoInDirectory } from "../lib-
|
|
2
|
+
import { i as version, n as stripVideoMetadataInDirectory, r as setLogger, t as syncVideoInDirectory } from "../lib-vuAW453K.js";
|
|
3
3
|
import { log, setDefaultLogOptions } from "lognow";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import prettyMilliseconds from "pretty-ms";
|
|
@@ -7,7 +7,7 @@ import untildify from "untildify";
|
|
|
7
7
|
import yargs from "yargs";
|
|
8
8
|
import { hideBin } from "yargs/helpers";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// src/bin/cli.ts
|
|
11
11
|
setLogger(log);
|
|
12
12
|
const startTime = performance.now();
|
|
13
13
|
const yargsInstance = yargs(hideBin(process.argv));
|
|
@@ -82,5 +82,4 @@ await yargsInstance.scriptName("vidup").usage("$0 [command]", "Run a vidup comma
|
|
|
82
82
|
process.exitCode = 0;
|
|
83
83
|
}).demandCommand(1).alias("h", "help").version(version).alias("v", "version").help().wrap(process.stdout.isTTY ? Math.min(120, yargsInstance.terminalWidth()) : 0).parse();
|
|
84
84
|
|
|
85
|
-
//#endregion
|
|
86
85
|
export { };
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ILogBasic, ILogLayer } from "lognow";
|
|
2
|
-
//#region src/lib/log.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Set the logger instance for the library. Library consumers can call this to
|
|
5
4
|
* inject their own logger. Calling it with no argument silences the library.
|
|
@@ -8,8 +7,6 @@ import { ILogBasic, ILogLayer } from "lognow";
|
|
|
8
7
|
* Stream-like log target
|
|
9
8
|
*/
|
|
10
9
|
export declare function setLogger(logger?: ILogBasic | ILogLayer<unknown>): void;
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/lib/strip.d.ts
|
|
13
10
|
type StripOptions = {
|
|
14
11
|
dryRun?: boolean;
|
|
15
12
|
};
|
|
@@ -19,8 +16,6 @@ type StripOptions = {
|
|
|
19
16
|
* @returns List of file paths with metadata that were stripped
|
|
20
17
|
*/
|
|
21
18
|
export declare function stripVideoMetadataInDirectory(directory: string, options?: StripOptions): Promise<string[]>;
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region src/lib/sync.d.ts
|
|
24
19
|
type Service = 'bunny' | 'cloudflare' | 'mux';
|
|
25
20
|
type SyncReport = Array<{
|
|
26
21
|
action: 'Create' | 'Delete' | 'None' | 'Update';
|
|
@@ -44,5 +39,4 @@ type SyncOptions = {
|
|
|
44
39
|
* change if a dry run)
|
|
45
40
|
*/
|
|
46
41
|
export declare function syncVideoInDirectory(directory: string, options: SyncOptions): Promise<SyncReport>;
|
|
47
|
-
//#endregion
|
|
48
42
|
export type { Service, StripOptions, SyncOptions, SyncReport };
|
package/dist/lib/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as stripVideoMetadataInDirectory, r as setLogger, t as syncVideoInDirectory } from "../lib-
|
|
1
|
+
import { n as stripVideoMetadataInDirectory, r as setLogger, t as syncVideoInDirectory } from "../lib-vuAW453K.js";
|
|
2
2
|
|
|
3
3
|
export { setLogger, stripVideoMetadataInDirectory, syncVideoInDirectory };
|
|
@@ -9,12 +9,11 @@ import { JSONFilePreset } from "lowdb/node";
|
|
|
9
9
|
import { createReadStream } from "node:fs";
|
|
10
10
|
import { oraPromise } from "ora";
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
// package.json
|
|
13
13
|
var name = "vidup";
|
|
14
|
-
var version = "1.0.
|
|
14
|
+
var version = "1.0.21";
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
//#region src/lib/log.ts
|
|
16
|
+
// src/lib/log.ts
|
|
18
17
|
/**
|
|
19
18
|
* The default logger instance for the library.
|
|
20
19
|
*/
|
|
@@ -30,8 +29,7 @@ function setLogger(logger) {
|
|
|
30
29
|
log$1 = injectionHelper(logger);
|
|
31
30
|
}
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
//#region src/lib/utilities/video.ts
|
|
32
|
+
// src/lib/utilities/video.ts
|
|
35
33
|
/**
|
|
36
34
|
* List the video files directly inside a directory. Matches by extension (.mp4,
|
|
37
35
|
* .mov, .avi, .mkv) and does not recurse into subdirectories.
|
|
@@ -97,8 +95,7 @@ async function stripVideoMetadata(filename) {
|
|
|
97
95
|
}
|
|
98
96
|
}
|
|
99
97
|
|
|
100
|
-
|
|
101
|
-
//#region src/lib/strip.ts
|
|
98
|
+
// src/lib/strip.ts
|
|
102
99
|
/**
|
|
103
100
|
* Strip metadata from video files in a directory
|
|
104
101
|
*
|
|
@@ -126,8 +123,7 @@ async function stripVideoMetadataInFiles(files, options = {}) {
|
|
|
126
123
|
return localVideosWithMetadata;
|
|
127
124
|
}
|
|
128
125
|
|
|
129
|
-
|
|
130
|
-
//#region src/lib/sync.ts
|
|
126
|
+
// src/lib/sync.ts
|
|
131
127
|
/**
|
|
132
128
|
* Synchronize a remote streaming service to mirror the contents of a local
|
|
133
129
|
* directory
|
|
@@ -247,5 +243,4 @@ async function withSpinner(promise, text) {
|
|
|
247
243
|
});
|
|
248
244
|
}
|
|
249
245
|
|
|
250
|
-
//#endregion
|
|
251
246
|
export { version as i, stripVideoMetadataInDirectory as n, setLogger as r, syncVideoInDirectory as t };
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vidup",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"description": "Synchronize a local directory of video files to remote streaming services.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bunnycdn-stream",
|
|
7
7
|
"bunnycdn",
|
|
8
8
|
"cli",
|
|
9
|
+
"homebrew-formula",
|
|
9
10
|
"npm-package",
|
|
10
11
|
"sync",
|
|
11
12
|
"upload",
|
|
@@ -38,42 +39,42 @@
|
|
|
38
39
|
"vidup": "dist/bin/cli.js"
|
|
39
40
|
},
|
|
40
41
|
"files": [
|
|
41
|
-
"dist
|
|
42
|
+
"dist"
|
|
42
43
|
],
|
|
43
44
|
"dependencies": {
|
|
44
45
|
"@types/yargs": "^17.0.35",
|
|
45
46
|
"bunnycdn-stream": "^2.5.5",
|
|
46
|
-
"execa": "^10.
|
|
47
|
+
"execa": "^10.2.1",
|
|
47
48
|
"ffmpeg-static": "^5.3.0",
|
|
48
49
|
"hasha": "^7.0.0",
|
|
49
|
-
"lognow": "^0.8.
|
|
50
|
+
"lognow": "^0.8.7",
|
|
50
51
|
"lowdb": "^7.0.1",
|
|
51
|
-
"ora": "^
|
|
52
|
-
"pretty-ms": "^
|
|
52
|
+
"ora": "^10.0.0",
|
|
53
|
+
"pretty-ms": "^10.0.0",
|
|
53
54
|
"untildify": "^6.0.0",
|
|
54
55
|
"yargs": "^18.2.0"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
57
58
|
"@arethetypeswrong/core": "^0.18.5",
|
|
58
|
-
"@kitschpatrol/shared-config": "^8.
|
|
59
|
-
"@types/node": "~24.13.
|
|
60
|
-
"brewpub": "^0.
|
|
59
|
+
"@kitschpatrol/shared-config": "^8.14.0",
|
|
60
|
+
"@types/node": "~24.13.6",
|
|
61
|
+
"brewpub": "^0.5.0",
|
|
61
62
|
"bumpp": "^12.3.0",
|
|
62
|
-
"mdat-plugin-cli-help": "^3.
|
|
63
|
-
"publint": "^0.3.
|
|
63
|
+
"mdat-plugin-cli-help": "^3.4.1",
|
|
64
|
+
"publint": "^0.3.25",
|
|
64
65
|
"shx": "^0.4.0",
|
|
65
|
-
"tsdown": "^0.23.
|
|
66
|
-
"typescript": "
|
|
67
|
-
"vitest": "^5.0.
|
|
66
|
+
"tsdown": "^0.23.4",
|
|
67
|
+
"typescript": "~6.0.3",
|
|
68
|
+
"vitest": "^5.0.5"
|
|
68
69
|
},
|
|
69
70
|
"engines": {
|
|
70
|
-
"node": "
|
|
71
|
+
"node": "^24.16.0 || >=26.3.0"
|
|
71
72
|
},
|
|
72
73
|
"scripts": {
|
|
73
74
|
"build": "tsdown",
|
|
74
|
-
"clean-deep": "shx rm -f pnpm-lock.yaml && git clean -fdX
|
|
75
|
-
"fix": "ksc fix",
|
|
76
|
-
"lint": "ksc lint",
|
|
75
|
+
"clean-deep": "shx rm -f pnpm-lock.yaml && git clean -fdX",
|
|
76
|
+
"fix": "pnpm build && ksc fix",
|
|
77
|
+
"lint": "pnpm build && ksc lint",
|
|
77
78
|
"release": "bumpp --commit 'Release: %s' && pnpm build && pnpm publish --otp $(op item get npm --otp) && brewpub --tap kitschpatrol/tap",
|
|
78
79
|
"test": "vitest run"
|
|
79
80
|
}
|
package/readme.md
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
[](https://www.npmjs.com/package/vidup)
|
|
10
10
|
[](https://opensource.org/license/mit)
|
|
11
11
|
[](https://github.com/kitschpatrol/vidup/actions/workflows/ci.yml)
|
|
12
|
+
[](https://github.com/kitschpatrol/homebrew-tap/blob/HEAD/Formula/vidup.rb)
|
|
12
13
|
|
|
13
14
|
<!-- /badges -->
|
|
14
15
|
|
|
@@ -31,56 +32,74 @@ Currently, only Bunny.net's [Bunny Stream](https://bunny.net/stream/) service is
|
|
|
31
32
|
|
|
32
33
|
## Getting started
|
|
33
34
|
|
|
35
|
+
<!-- dependencies -->
|
|
36
|
+
|
|
34
37
|
### Dependencies
|
|
35
38
|
|
|
36
|
-
|
|
39
|
+
- [Node.js](https://nodejs.org/) 24.16.0 or newer (specifically `^24.16.0 || >=26.3.0`)
|
|
40
|
+
|
|
41
|
+
<!-- /dependencies -->
|
|
42
|
+
|
|
43
|
+
The exported APIs are ESM-only. Vidup is implemented in TypeScript and bundles type definitions.
|
|
37
44
|
|
|
38
45
|
A [Bunny Stream](https://bunny.net/stream/) account, API key, and library ID are required.
|
|
39
46
|
|
|
47
|
+
<!-- install -->
|
|
48
|
+
|
|
40
49
|
### Installation
|
|
41
50
|
|
|
42
|
-
|
|
51
|
+
There are several ways to install vidup depending on how you're planning to use it:
|
|
52
|
+
|
|
53
|
+
#### CLI
|
|
54
|
+
|
|
55
|
+
Run it once without installing:
|
|
43
56
|
|
|
44
57
|
```sh
|
|
45
58
|
npx vidup
|
|
46
59
|
```
|
|
47
60
|
|
|
48
|
-
Or
|
|
61
|
+
Or install it globally with Homebrew:
|
|
49
62
|
|
|
50
63
|
```sh
|
|
51
|
-
|
|
64
|
+
brew install kitschpatrol/tap/vidup
|
|
52
65
|
```
|
|
53
66
|
|
|
54
|
-
Or
|
|
67
|
+
Or install it globally with npm:
|
|
55
68
|
|
|
56
69
|
```sh
|
|
57
|
-
|
|
70
|
+
npm install --global vidup
|
|
58
71
|
```
|
|
59
72
|
|
|
60
|
-
|
|
73
|
+
#### Library
|
|
74
|
+
|
|
75
|
+
Add it to your project to import the TypeScript API. This also puts the `vidup` CLI on your project's path:
|
|
61
76
|
|
|
62
77
|
```sh
|
|
63
|
-
npm install
|
|
78
|
+
npm install vidup
|
|
64
79
|
```
|
|
65
80
|
|
|
81
|
+
<!-- /install -->
|
|
82
|
+
|
|
66
83
|
## Usage
|
|
67
84
|
|
|
68
85
|
Vidup treats local videos' file names as keys, and will look for a file with the same name / title on the remote streaming service.
|
|
69
86
|
|
|
70
87
|
Any video files present in the local folder that aren't matched to a video on the remote service will be uploaded.
|
|
71
88
|
|
|
72
|
-
If you change the name of a local video file, the remote video with the previous name will be deleted, and a new remote video (with a
|
|
89
|
+
If you change the name of a local video file, the remote video with the previous name will be deleted, and a new remote video (with a new GUID) will be created.
|
|
73
90
|
|
|
74
91
|
Vidup tracks the content hash of each local video. If you replace a local video file with another of the same name, the change in content will be detected and the remote video will be updated.
|
|
75
92
|
(_Note that this is currently equivalent to deleting / creating a new remote video since Bunny.net doesn't support in-place video updates. The GUID will change, so you'll need to update any embeds accordingly._)
|
|
76
93
|
|
|
77
94
|
Any videos present on the remote service that aren't matched to a video file in the local folder **will be deleted from the remote service**.
|
|
78
95
|
|
|
79
|
-
### CLI
|
|
96
|
+
### CLI usage
|
|
80
97
|
|
|
81
98
|
<!-- cli-help -->
|
|
82
99
|
|
|
83
|
-
####
|
|
100
|
+
#### Commands
|
|
101
|
+
|
|
102
|
+
##### Command: `vidup`
|
|
84
103
|
|
|
85
104
|
Run a vidup command.
|
|
86
105
|
|
|
@@ -100,7 +119,7 @@ vidup [command]
|
|
|
100
119
|
|
|
101
120
|
_See the sections below for more information on each subcommand._
|
|
102
121
|
|
|
103
|
-
|
|
122
|
+
##### Subcommand: `vidup sync`
|
|
104
123
|
|
|
105
124
|
Synchronize a remote video streaming service to mirror the contents of a local directory. Warning: This command will irrevocably delete remote videos that are not present in the local directory.
|
|
106
125
|
|
|
@@ -153,7 +172,7 @@ vidup . --json --dry-run --service bunny --key <BUNNY_API_KEY> --library <BUNNY_
|
|
|
153
172
|
|
|
154
173
|
The JSON version of the output provides some extra info.
|
|
155
174
|
|
|
156
|
-
### Library
|
|
175
|
+
### Library usage
|
|
157
176
|
|
|
158
177
|
#### API
|
|
159
178
|
|
|
@@ -180,7 +199,7 @@ A `stripVideoMetadataInDirectory` function is also exported, which will remove m
|
|
|
180
199
|
```ts
|
|
181
200
|
async function stripVideoMetadataInDirectory(
|
|
182
201
|
directory: string,
|
|
183
|
-
options
|
|
202
|
+
options?: {
|
|
184
203
|
dryRun?: boolean // Defaults to false
|
|
185
204
|
},
|
|
186
205
|
): Promise<string[]>
|