wyzie-lib 1.0.0 → 1.0.2
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/dist/wyzie-lib.es.js +17 -17
- package/dist/wyzie-lib.umd.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ pnpm install wyzie-lib
|
|
|
20
20
|
```ts
|
|
21
21
|
import { type SubtitleData, searchSubtitles } from 'wyzie-lib';
|
|
22
22
|
|
|
23
|
-
const data: SubtitleData[] = await
|
|
23
|
+
const data: SubtitleData[] = await searchSubtitles({ tmdb_id: 286217, language: "en" });
|
|
24
24
|
console.log(data[0].id);
|
|
25
25
|
```
|
|
26
26
|
|
package/dist/wyzie-lib.es.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
async function h(
|
|
2
|
-
const { tmdb_id:
|
|
3
|
-
id:
|
|
4
|
-
season:
|
|
1
|
+
async function h(r) {
|
|
2
|
+
const { tmdb_id: t, imdb_id: o, season: a, episode: c, language: i, format: u } = r, e = new URL("https://subs.wyzie.ru/search"), s = {
|
|
3
|
+
id: t || o,
|
|
4
|
+
season: a,
|
|
5
5
|
episode: c,
|
|
6
6
|
language: i,
|
|
7
7
|
format: u
|
|
8
8
|
};
|
|
9
9
|
return Object.keys(s).forEach((n) => {
|
|
10
|
-
s[n] !== void 0 &&
|
|
11
|
-
}),
|
|
10
|
+
s[n] !== void 0 && e.searchParams.append(n, String(s[n]));
|
|
11
|
+
}), e;
|
|
12
12
|
}
|
|
13
|
-
async function f(
|
|
14
|
-
const
|
|
15
|
-
if (!
|
|
16
|
-
throw new Error(`HTTP error! status: ${
|
|
17
|
-
return await
|
|
13
|
+
async function f(r) {
|
|
14
|
+
const t = await fetch(r.toString());
|
|
15
|
+
if (!t.ok)
|
|
16
|
+
throw new Error(`HTTP error! status: ${t.status}`);
|
|
17
|
+
return await t.json();
|
|
18
18
|
}
|
|
19
|
-
async function w(
|
|
19
|
+
async function w(r) {
|
|
20
20
|
try {
|
|
21
|
-
const
|
|
22
|
-
return await f(
|
|
23
|
-
} catch (
|
|
24
|
-
throw console.error("Error fetching subtitles:",
|
|
21
|
+
const t = await h(r);
|
|
22
|
+
return await f(t);
|
|
23
|
+
} catch (t) {
|
|
24
|
+
throw console.error("Error fetching subtitles:", t), t;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
export {
|
|
28
|
-
w as
|
|
28
|
+
w as searchSubtitles
|
|
29
29
|
};
|
package/dist/wyzie-lib.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,r){typeof exports=="object"&&typeof module<"u"?r(exports):typeof define=="function"&&define.amd?define(["exports"],r):(e=typeof globalThis<"u"?globalThis:e||self,r(e.WyzieLib={}))})(this,function(e){"use strict";async function r(n){const{tmdb_id:t,imdb_id:u,season:f,episode:d,language:h,format:l}=n,i=new URL("https://subs.wyzie.ru/search"),
|
|
1
|
+
(function(e,r){typeof exports=="object"&&typeof module<"u"?r(exports):typeof define=="function"&&define.amd?define(["exports"],r):(e=typeof globalThis<"u"?globalThis:e||self,r(e.WyzieLib={}))})(this,function(e){"use strict";async function r(n){const{tmdb_id:t,imdb_id:u,season:f,episode:d,language:h,format:l}=n,i=new URL("https://subs.wyzie.ru/search"),s={id:t||u,season:f,episode:d,language:h,format:l};return Object.keys(s).forEach(o=>{s[o]!==void 0&&i.searchParams.append(o,String(s[o]))}),i}async function a(n){const t=await fetch(n.toString());if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.json()}async function c(n){try{const t=await r(n);return await a(t)}catch(t){throw console.error("Error fetching subtitles:",t),t}}e.searchSubtitles=c,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|