wyzie-lib 2.4.0 → 2.5.1
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/README.md +1 -1
- package/lib/main.amd.js +7 -1
- package/lib/main.cjs +7 -1
- package/lib/main.d.ts +6 -3
- package/lib/main.iife.js +7 -1
- package/lib/main.js +7 -1
- package/lib/main.umd.cjs +7 -1
- package/package.json +3 -2
package/README.md
CHANGED
package/lib/main.amd.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
define(["exports"], function(exports) {
|
|
2
2
|
"use strict";
|
|
3
3
|
const config = {
|
|
4
|
-
baseUrl: "https://sub.wyzie.
|
|
4
|
+
baseUrl: "https://sub.wyzie.io"
|
|
5
5
|
};
|
|
6
6
|
function configure(options) {
|
|
7
7
|
if (options.baseUrl) {
|
|
8
8
|
config.baseUrl = options.baseUrl.replace(/\/$/, "");
|
|
9
9
|
}
|
|
10
|
+
if (options.key !== void 0) {
|
|
11
|
+
config.key = options.key;
|
|
12
|
+
}
|
|
10
13
|
}
|
|
11
14
|
async function constructUrl({
|
|
12
15
|
tmdb_id,
|
|
@@ -65,6 +68,9 @@ define(["exports"], function(exports) {
|
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
70
|
});
|
|
71
|
+
if (!url.searchParams.has("key") && config.key) {
|
|
72
|
+
url.searchParams.append("key", config.key);
|
|
73
|
+
}
|
|
68
74
|
return url;
|
|
69
75
|
}
|
|
70
76
|
async function fetchSubtitles(url) {
|
package/lib/main.cjs
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const config = {
|
|
4
|
-
baseUrl: "https://sub.wyzie.
|
|
4
|
+
baseUrl: "https://sub.wyzie.io"
|
|
5
5
|
};
|
|
6
6
|
function configure(options) {
|
|
7
7
|
if (options.baseUrl) {
|
|
8
8
|
config.baseUrl = options.baseUrl.replace(/\/$/, "");
|
|
9
9
|
}
|
|
10
|
+
if (options.key !== void 0) {
|
|
11
|
+
config.key = options.key;
|
|
12
|
+
}
|
|
10
13
|
}
|
|
11
14
|
async function constructUrl({
|
|
12
15
|
tmdb_id,
|
|
@@ -65,6 +68,9 @@ async function constructUrl({
|
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
70
|
});
|
|
71
|
+
if (!url.searchParams.has("key") && config.key) {
|
|
72
|
+
url.searchParams.append("key", config.key);
|
|
73
|
+
}
|
|
68
74
|
return url;
|
|
69
75
|
}
|
|
70
76
|
async function fetchSubtitles(url) {
|
package/lib/main.d.ts
CHANGED
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
* Type for the configuration options for the library.
|
|
3
3
|
*/
|
|
4
4
|
export declare type ConfigurationOptions = {
|
|
5
|
-
/** The API's hostname (default: sub.wyzie.
|
|
6
|
-
baseUrl
|
|
5
|
+
/** The API's hostname (default: sub.wyzie.io) */
|
|
6
|
+
baseUrl?: string;
|
|
7
|
+
/** Your Wyzie Subs API key. Get one at https://sub.wyzie.io/redeem */
|
|
8
|
+
key?: string;
|
|
7
9
|
};
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* Configure the library settings.
|
|
11
13
|
*
|
|
12
14
|
* @param {ConfigurationOptions} options - Config options for the library.
|
|
13
|
-
* @throws {Error} Throws an error if the baseUrl is not provided.
|
|
14
15
|
*/
|
|
15
16
|
export declare function configure(options: ConfigurationOptions): void;
|
|
16
17
|
|
|
@@ -142,6 +143,8 @@ export declare type SearchSubtitlesParams = (
|
|
|
142
143
|
origin?: string | string[];
|
|
143
144
|
/** Bypass cache and fetch fresh results from sources. */
|
|
144
145
|
refresh?: boolean;
|
|
146
|
+
/** Your Wyzie Subs API key (required). Get one at https://sub.wyzie.io/redeem */
|
|
147
|
+
key?: string;
|
|
145
148
|
/** Additional parameters that can be used for filtering or other purposes. */
|
|
146
149
|
[key: string]: any;
|
|
147
150
|
} & (
|
package/lib/main.iife.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
var main = function(exports) {
|
|
2
2
|
"use strict";
|
|
3
3
|
const config = {
|
|
4
|
-
baseUrl: "https://sub.wyzie.
|
|
4
|
+
baseUrl: "https://sub.wyzie.io"
|
|
5
5
|
};
|
|
6
6
|
function configure(options) {
|
|
7
7
|
if (options.baseUrl) {
|
|
8
8
|
config.baseUrl = options.baseUrl.replace(/\/$/, "");
|
|
9
9
|
}
|
|
10
|
+
if (options.key !== void 0) {
|
|
11
|
+
config.key = options.key;
|
|
12
|
+
}
|
|
10
13
|
}
|
|
11
14
|
async function constructUrl({
|
|
12
15
|
tmdb_id,
|
|
@@ -65,6 +68,9 @@ var main = function(exports) {
|
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
70
|
});
|
|
71
|
+
if (!url.searchParams.has("key") && config.key) {
|
|
72
|
+
url.searchParams.append("key", config.key);
|
|
73
|
+
}
|
|
68
74
|
return url;
|
|
69
75
|
}
|
|
70
76
|
async function fetchSubtitles(url) {
|
package/lib/main.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
const config = {
|
|
2
|
-
baseUrl: "https://sub.wyzie.
|
|
2
|
+
baseUrl: "https://sub.wyzie.io"
|
|
3
3
|
};
|
|
4
4
|
function configure(options) {
|
|
5
5
|
if (options.baseUrl) {
|
|
6
6
|
config.baseUrl = options.baseUrl.replace(/\/$/, "");
|
|
7
7
|
}
|
|
8
|
+
if (options.key !== void 0) {
|
|
9
|
+
config.key = options.key;
|
|
10
|
+
}
|
|
8
11
|
}
|
|
9
12
|
async function constructUrl({
|
|
10
13
|
tmdb_id,
|
|
@@ -63,6 +66,9 @@ async function constructUrl({
|
|
|
63
66
|
}
|
|
64
67
|
}
|
|
65
68
|
});
|
|
69
|
+
if (!url.searchParams.has("key") && config.key) {
|
|
70
|
+
url.searchParams.append("key", config.key);
|
|
71
|
+
}
|
|
66
72
|
return url;
|
|
67
73
|
}
|
|
68
74
|
async function fetchSubtitles(url) {
|
package/lib/main.umd.cjs
CHANGED
|
@@ -3,12 +3,15 @@
|
|
|
3
3
|
})(this, function(exports2) {
|
|
4
4
|
"use strict";
|
|
5
5
|
const config = {
|
|
6
|
-
baseUrl: "https://sub.wyzie.
|
|
6
|
+
baseUrl: "https://sub.wyzie.io"
|
|
7
7
|
};
|
|
8
8
|
function configure(options) {
|
|
9
9
|
if (options.baseUrl) {
|
|
10
10
|
config.baseUrl = options.baseUrl.replace(/\/$/, "");
|
|
11
11
|
}
|
|
12
|
+
if (options.key !== void 0) {
|
|
13
|
+
config.key = options.key;
|
|
14
|
+
}
|
|
12
15
|
}
|
|
13
16
|
async function constructUrl({
|
|
14
17
|
tmdb_id,
|
|
@@ -67,6 +70,9 @@
|
|
|
67
70
|
}
|
|
68
71
|
}
|
|
69
72
|
});
|
|
73
|
+
if (!url.searchParams.has("key") && config.key) {
|
|
74
|
+
url.searchParams.append("key", config.key);
|
|
75
|
+
}
|
|
70
76
|
return url;
|
|
71
77
|
}
|
|
72
78
|
async function fetchSubtitles(url) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wyzie-lib",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"icon": "https://i.postimg.cc/L5ppKYC5/cclogo.png",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -57,11 +57,12 @@
|
|
|
57
57
|
},
|
|
58
58
|
"repository": {
|
|
59
59
|
"type": "git",
|
|
60
|
-
"url": "git+https://github.com/
|
|
60
|
+
"url": "git+https://github.com/wyziedevs/wyzie-lib.git"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"dev": "vite",
|
|
64
64
|
"build": "vite build && tsc",
|
|
65
|
+
"prepublishOnly": "npm run build",
|
|
65
66
|
"test": "npx vitest",
|
|
66
67
|
"format": "prettier --log-level warn --write \"{src/**/*.{ts},*.{ts,js,html,css,json,md,xml}}\"",
|
|
67
68
|
"preview": "vite preview"
|