From d996ce21d9d4d2e48550e1a2874982834a0bcfa1 Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Tue, 7 Mar 2023 21:02:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'SrcJyAlist.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SrcJyAlist.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/SrcJyAlist.js b/SrcJyAlist.js index 8597db8f..745c3582 100644 --- a/SrcJyAlist.js +++ b/SrcJyAlist.js @@ -331,13 +331,16 @@ function alistUrl(alistapi,path,sign,subtitle,provider) { playurl.reverse(); let urls = []; let names = []; + let heads = []; playurl.forEach(item => { urls.push(item.url+"#isVideo=true##pre#"); names.push(transcoding[item.template_id]?transcoding[item.template_id]:item.template_height); + heads.push({'Referer':'https://www.aliyundrive.com/'}); }) return JSON.stringify({ urls: urls, names: names, + headers: heads, subtitle: subtitle }); } @@ -369,12 +372,10 @@ function alistUrl(alistapi,path,sign,subtitle,provider) { }; let refresh_token = alistconfig.alitoken; let userinfo = JSON.parse(request('https://auth.aliyundrive.com/v2/account/token',{headers:headers,body:{"refresh_token":refresh_token,"grant_type":"refresh_token"},method:'POST',timeout:3000})); - log(userinfo); let authorization = 'Bearer '+userinfo.access_token; let userId = userinfo.user_id; let deviceId = userinfo.device_id; let getaliecc = JSON.parse(request('http://124.221.241.174:87/api',{body:'did='+deviceId+'&uid='+userId,method:'POST',timeout:3000})); - log(getaliecc); let signature; let public_key; if(getaliecc.code==200){ @@ -403,24 +404,26 @@ function alistUrl(alistapi,path,sign,subtitle,provider) { "get_subtitle_info":true } let json = JSON.parse(request('https://api.aliyundrive.com/v2/file/get_share_link_video_preview_play_info',{headers:headers,body:data,method:'POST',timeout:3000})); - log(json); let playurl = json.video_preview_play_info.live_transcoding_task_list; playurl.reverse(); let urls = []; let names = []; + let heads = []; playurl.forEach(item => { - let rurl = JSON.parse(request(item.url,{onlyHeaders:true,redirect:false,timeout:3000})).headers.location[0]; + let rurl = JSON.parse(request(item.url,{headers:{'Referer':'https://www.aliyundrive.com/'},onlyHeaders:true,redirect:false,timeout:3000})).headers.location[0]; urls.push(rurl+"#isVideo=true##pre#"); names.push(transcoding[item.template_id]?transcoding[item.template_id]:item.template_height); + heads.push({'Referer':'https://www.aliyundrive.com/'}); }) return JSON.stringify({ urls: urls, names: names, + headers: heads, subtitle: subtitle }); } }catch(e){ - log('获取共享链接播放地址>'+e.message); + log('获取共享链接播放地址失败>'+e.message); } } url = url + (music.test(suffix)?"#isMusic=true#":"#isVideo=true#") + (url.indexOf('baidu.com')>-1? ';{User-Agent@Lavf/57.83.100}':'');