@@ -6,7 +6,7 @@ var Kaze = {
6
6
yj : [ ] ,
7
7
bili : [ ]
8
8
} ,
9
- version : '1.3.7 ' ,
9
+ version : '1.3.8 Beta ' ,
10
10
isTest : false ,
11
11
isFrist : true ,
12
12
//请求次数
@@ -17,7 +17,7 @@ var Kaze = {
17
17
setting : {
18
18
time : 15000 ,
19
19
getweibo : true ,
20
- getbili : false ,
20
+ getbili : true ,
21
21
getyj : true ,
22
22
getcho3 : true ,
23
23
getys3 : true ,
@@ -135,7 +135,7 @@ let getAndProcessWeiboData = {
135
135
image : dynamicInfo . bmiddle_pic || dynamicInfo . original_pic ,
136
136
type : that . getdynamicType ( dynamicInfo ) ,
137
137
source : opt . source ,
138
- url : "https://weibo.com/" + weiboId . substring ( ( weiboId . length - 10 ) , weiboId . length ) + "/" + x . mblog . bid ,
138
+ url : "https://weibo.com/" + weiboId . substring ( ( weiboId . length - 10 ) , weiboId . length ) + "/" + x . mblog . bid ,
139
139
} ) ;
140
140
}
141
141
} ) ;
@@ -185,8 +185,8 @@ let getAndProcessWeiboData = {
185
185
}
186
186
187
187
let getBili = {
188
- url : `https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/space_history?host_uid=161775300` ,
189
- // url:`https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/space_history?host_uid=161775300&offset_dynamic_id=0&need_top=0&platform=web`,
188
+
189
+ url : `https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/space_history?host_uid=161775300&offset_dynamic_id=0&need_top=0&platform=web` ,
190
190
dturl : `https://space.bilibili.com/161775300/dynamic` ,
191
191
// B站:动态列表
192
192
cardlist : [ ] ,
@@ -199,14 +199,27 @@ let getBili = {
199
199
if ( data . code == 0 && data . data != null && data . data . cards != null && data . data . cards . length > 0 ) {
200
200
data . data . cards . map ( x => {
201
201
let dynamicInfo = JSON . parse ( x . card ) ;
202
- that . cardlist . push ( {
203
- time : x . desc . timestamp ,
204
- dynamicInfo : that . GetdynamicInfo ( dynamicInfo ) ,
205
- image : that . GetdynamicImage ( dynamicInfo ) ,
206
- type : that . GetdynamicType ( dynamicInfo ) ,
202
+ let card = {
207
203
source : 0 ,
208
- url : dynamicInfo . short_link || that . dturl
209
- } ) ;
204
+ time : x . desc . timestamp ,
205
+ type : x . desc . type
206
+ } ;
207
+ // desc.type 8 是视频 64是专栏 2是动态
208
+ // todo 等微博数据分析完毕 就添加titile
209
+ if ( x . desc . type == 2 ) {
210
+ card . image = ( dynamicInfo . item . pictures && dynamicInfo . item . pictures . length > 0 ) ? dynamicInfo . item . pictures [ 0 ] . img_src : null ;
211
+ card . dynamicInfo = dynamicInfo . item . description ;
212
+ card . url = `https://t.bilibili.com/${ x . desc . dynamic_id_str } `
213
+ } else if ( x . desc . type == 8 ) {
214
+ card . image = dynamicInfo . pic ;
215
+ card . dynamicInfo = dynamicInfo . dynamic ;
216
+ card . url = `https://t.bilibili.com/${ x . desc . dynamic_id_str } `
217
+ } else if ( x . desc . type == 64 ) {
218
+ card . image = ( dynamicInfo . image_urls && dynamicInfo . image_urls . length > 0 ) ? dynamicInfo . image_urls [ 0 ] : null ;
219
+ card . dynamicInfo = dynamicInfo . summary ;
220
+ card . url = `https://t.bilibili.com/${ x . desc . dynamic_id_str } `
221
+ }
222
+ that . cardlist . push ( card ) ;
210
223
} ) ;
211
224
that . cardlist . sort ( ( x , y ) => x . time < y . time ? 1 : - 1 ) ;
212
225
that . JudgmentNew ( that . cardlist ) ;
@@ -216,41 +229,6 @@ let getBili = {
216
229
}
217
230
, { name : "Bilibili动态" , type : 'getbili' } ) ;
218
231
} ,
219
- GetdynamicType ( dynamic ) {
220
- // 0为视频 1为动态
221
- let type = - 1 ;
222
- if ( dynamic . hasOwnProperty ( 'item' ) ) {
223
- type = 1 ;
224
- }
225
- else {
226
- type = 0 ;
227
- }
228
- return type ;
229
- } ,
230
- GetdynamicInfo ( dynamic ) {
231
- // 0为视频 1为动态
232
- let dynamicInfo = '' ;
233
- if ( dynamic . hasOwnProperty ( 'item' ) ) {
234
- dynamicInfo = dynamic . item . description || dynamic . item . content ;
235
- }
236
- else {
237
- dynamicInfo = dynamic . desc || dynamic . title ;
238
- }
239
- return dynamicInfo ;
240
- } ,
241
- GetdynamicImage ( dynamic ) {
242
- // 0为视频 1为动态
243
- let dynamicInfo = null ;
244
- if ( dynamic . hasOwnProperty ( 'item' ) ) {
245
- if ( dynamic . item . hasOwnProperty ( 'pictures' ) ) {
246
- dynamicInfo = dynamic . item . pictures . length > 0 ? dynamic . item . pictures [ 0 ] . img_src : null ;
247
- }
248
- }
249
- else {
250
- dynamicInfo = dynamic . pic || dynamic . pic ;
251
- }
252
- return dynamicInfo ;
253
- } ,
254
232
JudgmentNew ( dynamiclist ) {
255
233
let oldcardlist = Kaze . cardlistdm . bili
256
234
if ( oldcardlist . length > 0 && oldcardlist [ 0 ] . time != dynamiclist [ 0 ] . time && dynamiclist [ 0 ] . time > oldcardlist [ 0 ] . time ) {
0 commit comments