1- import dayjs from "dayjs/esm"
21import { myFetch } from "#/utils/fetch"
32import { defineSource } from "#/utils/source"
43
@@ -46,68 +45,13 @@ const hotRankList = defineSource(async () => {
4645 } )
4746
4847 return resp ?. items [ 0 ] ?. video [ 0 ] ?. data . map ( ( item ) => {
49- const creator = item . creator ?. map ( a => a . name ) . join ( " " )
50- const contributor = item . contributor ?. map ( a => a . name ) . join ( " " )
51- const info = [ item . desc , creator , contributor ] . filter ( Boolean ) . join ( "|" )
5248 return {
5349 id : item . entity_id ,
5450 title : item . title ,
5551 url : item . page_url ,
5652 pubDate : item ?. showDate ,
5753 extra : {
58- info,
59- hover : item . description ,
60- tag : item . tag ,
61- } ,
62- }
63- } )
64- } )
65-
66- interface WarpCartoon {
67- code : number
68- cname : string
69- items : {
70- order : number
71- channel : string
72- temp : any
73- video : {
74- basisDataUrls : string
75- title : string
76- block_id : string
77- card_source : string
78- links : any [ ]
79- data : VideoInfo [ ]
80- adverts : any [ ]
81- config : any [ ]
82- } [ ]
83- lib_keys : any
84- } [ ]
85- extData : any
86- }
87-
88- const cartoonToday = defineSource ( async ( ) => {
89- const url = "https://mesh.if.iqiyi.com/portal/lw/v7/channel/cartoon"
90- const resp = await myFetch < WarpCartoon > ( url , {
91- headers : { Referer : "https://www.iqiyi.com" } ,
92- } )
93-
94- // items[2] 为追番表数据
95- const items = resp ?. items [ 2 ]
96- // 获取今天是一周的第几天
97- const weekday = dayjs ( ) . day ( ) || 7
98- // 获取今天的追番表数据
99- const videos = items ?. video [ weekday - 1 ] // 减去1是因为数组索引从0开始
100- return videos ?. data . map ( ( item ) => {
101- const creator = item . creator ?. map ( a => a . name ) . join ( " " )
102- const contributor = item . contributor ?. map ( a => a . name ) . join ( " " )
103- const info = [ item . desc , item . dq_updatestatus , creator , contributor ] . filter ( Boolean ) . join ( "|" )
104- return {
105- id : item . entity_id ,
106- title : item . title ,
107- url : item . page_url ,
108- pubDate : item ?. showDate ,
109- extra : {
110- info,
54+ info : item . desc ,
11155 hover : item . description ,
11256 tag : item . tag ,
11357 } ,
@@ -117,5 +61,4 @@ const cartoonToday = defineSource(async () => {
11761
11862export default defineSource ( {
11963 "iqiyi-hot-ranklist" : hotRankList ,
120- "iqiyi-cartoon-today" : cartoonToday ,
12164} )
0 commit comments