@forward-widget/danmu-universe 0.1.0 → 0.1.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/dist/danmu-universe.js +42 -21
- package/package.json +1 -1
package/dist/danmu-universe.js
CHANGED
|
@@ -2523,6 +2523,8 @@ const $ZodJWT = $constructor("$ZodJWT", (e, t)=>{
|
|
|
2523
2523
|
inst: e
|
|
2524
2524
|
}), n;
|
|
2525
2525
|
};
|
|
2526
|
+
}), $ZodAny = $constructor("$ZodAny", (e, t)=>{
|
|
2527
|
+
$ZodType.init(e, t), e._zod.parse = (e)=>e;
|
|
2526
2528
|
}), $ZodUnknown = $constructor("$ZodUnknown", (e, t)=>{
|
|
2527
2529
|
$ZodType.init(e, t), e._zod.parse = (e)=>e;
|
|
2528
2530
|
}), $ZodNever = $constructor("$ZodNever", (e, t)=>{
|
|
@@ -3302,6 +3304,11 @@ function _boolean(e, t) {
|
|
|
3302
3304
|
...normalizeParams(t)
|
|
3303
3305
|
});
|
|
3304
3306
|
}
|
|
3307
|
+
function _any(e) {
|
|
3308
|
+
return new e({
|
|
3309
|
+
type: "any"
|
|
3310
|
+
});
|
|
3311
|
+
}
|
|
3305
3312
|
function _unknown(e) {
|
|
3306
3313
|
return new e({
|
|
3307
3314
|
type: "unknown"
|
|
@@ -3624,6 +3631,12 @@ const ZodBoolean = $constructor("ZodBoolean", (e, t)=>{
|
|
|
3624
3631
|
function schemas_boolean(e) {
|
|
3625
3632
|
return _boolean(ZodBoolean, e);
|
|
3626
3633
|
}
|
|
3634
|
+
const ZodAny = $constructor("ZodAny", (e, t)=>{
|
|
3635
|
+
$ZodAny.init(e, t), ZodType.init(e, t);
|
|
3636
|
+
});
|
|
3637
|
+
function any() {
|
|
3638
|
+
return _any(ZodAny);
|
|
3639
|
+
}
|
|
3627
3640
|
const ZodUnknown = $constructor("ZodUnknown", (e, t)=>{
|
|
3628
3641
|
$ZodUnknown.init(e, t), ZodType.init(e, t);
|
|
3629
3642
|
});
|
|
@@ -5486,24 +5499,32 @@ const iqiyiIdSchema = schemas_object({
|
|
|
5486
5499
|
}
|
|
5487
5500
|
})), safeParseVideo = (e)=>{
|
|
5488
5501
|
let t = iqiyiEpisodeTabDataVideoSchema.safeParse(e);
|
|
5489
|
-
return t.success ? t.data : (console.warn("\u7231\u5947\u827A: \u89E3\u6790\u5206\u96C6\u6570\u636E\u65F6\u53D1\u751F\u9519\u8BEF:", t.error
|
|
5490
|
-
},
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5502
|
+
return t.success ? t.data : (console.warn("\u7231\u5947\u827A: \u89E3\u6790\u5206\u96C6\u6570\u636E\u65F6\u53D1\u751F\u9519\u8BEF:", prettifyError(t.error), e), null);
|
|
5503
|
+
}, iqiyiTvTabSchema = schemas_object({
|
|
5504
|
+
bk_id: literal("selector_bk"),
|
|
5505
|
+
bk_type: literal("album_episodes"),
|
|
5506
|
+
data: schemas_object({
|
|
5507
|
+
data: schemas_array(unknown().transform((e)=>schemas_object({
|
|
5508
|
+
videos: schemas_object({
|
|
5509
|
+
feature_paged: record(any(), schemas_array(unknown().transform((e)=>safeParseVideo(e)))).optional().transform((e)=>compact(Object.values(null != e ? e : {}).flat()))
|
|
5510
|
+
}).optional()
|
|
5511
|
+
}).transform((e)=>{
|
|
5512
|
+
var t;
|
|
5513
|
+
return null == (t = e.videos) ? void 0 : t.feature_paged;
|
|
5514
|
+
}).safeParse(e).data)).transform((e)=>compact(e.flat()))
|
|
5515
|
+
})
|
|
5516
|
+
}), iqiyiMovieTabSchema = schemas_object({
|
|
5517
|
+
bk_id: literal("film_feature_bk"),
|
|
5518
|
+
bk_type: literal("video_list"),
|
|
5500
5519
|
data: schemas_object({
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
})
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5520
|
+
data: schemas_object({
|
|
5521
|
+
videos: schemas_array(unknown().transform((e)=>safeParseVideo(e)))
|
|
5522
|
+
}).transform((e)=>compact(e.videos))
|
|
5523
|
+
})
|
|
5524
|
+
}), iqiyiEpisodeTabSchema = union([
|
|
5525
|
+
iqiyiTvTabSchema,
|
|
5526
|
+
iqiyiMovieTabSchema
|
|
5527
|
+
]).transform((e)=>e.data.data), iqiyiV3ApiResponseSchema = schemas_object({
|
|
5507
5528
|
status_code: schemas_number(),
|
|
5508
5529
|
data: schemas_object({
|
|
5509
5530
|
base_data: schemas_object({
|
|
@@ -5635,10 +5656,10 @@ class IqiyiScraper extends BaseScraper {
|
|
|
5635
5656
|
url: e.play_url
|
|
5636
5657
|
}))) ? o : [];
|
|
5637
5658
|
if (!c.length) {
|
|
5638
|
-
let t = null == e || null == (u = e.data) || null == (a = u.template) || null == (s = a.tabs) ? void 0 : s.flatMap((e)=>e.blocks || []).find((e)=>
|
|
5639
|
-
if (!n) return console.warn(`\u{7231}\u{5947}\u{827A}: \u{89E3}\u{6790}\u{5206}\u{96C6}\u{6570}\u{636E}\u{65F6}\u{53D1}\u{751F}\u{9519}\u{8BEF}:`, prettifyError(i), t), [];
|
|
5659
|
+
let t = null == e || null == (u = e.data) || null == (a = u.template) || null == (s = a.tabs) ? void 0 : s.flatMap((e)=>e.blocks || []).find((e)=>iqiyiEpisodeTabSchema.safeParse(e).success), { success: n, data: r, error: i } = iqiyiEpisodeTabSchema.safeParse(t);
|
|
5660
|
+
if (!n) return console.warn(`\u{7231}\u{5947}\u{827A}: \u{89E3}\u{6790}\u{5206}\u{96C6}\u{5217}\u{8868}\u{6570}\u{636E}\u{65F6}\u{53D1}\u{751F}\u{9519}\u{8BEF}:`, prettifyError(i), t), [];
|
|
5640
5661
|
let o = this.getEpisodeBlacklistPattern(), f = 1;
|
|
5641
|
-
for (let e of r
|
|
5662
|
+
for (let e of r){
|
|
5642
5663
|
if (17 === e.mark_type_show) continue;
|
|
5643
5664
|
let t = this.videoIdToEntityId(e.videoId);
|
|
5644
5665
|
t && (null != o && o.test(e.title) || (c.push({
|
|
@@ -6309,7 +6330,7 @@ class scrapers_Scraper {
|
|
|
6309
6330
|
});
|
|
6310
6331
|
}
|
|
6311
6332
|
}
|
|
6312
|
-
const widgetVersion = "0.1.
|
|
6333
|
+
const widgetVersion = "0.1.1";
|
|
6313
6334
|
WidgetMetadata = {
|
|
6314
6335
|
id: "baranwang.danmu.universe",
|
|
6315
6336
|
title: "\u901A\u7528\u5F39\u5E55",
|