diff --git a/SrcJyAlist.js b/SrcJyAlist.js index 536d7577..aa0a89ff 100644 --- a/SrcJyAlist.js +++ b/SrcJyAlist.js @@ -939,6 +939,43 @@ function alistSet() { setResult(d); } +function getAliPlayUrl(list) { + let urls = []; + let names =[]; + let heads = []; + let task = function(obj) { + let item = obj.item; + let i = obj.id; + try{ + let rurl = JSON.parse(request(item.url, { headers: { 'Referer': 'https://www.aliyundrive.com/' }, onlyHeaders: true, redirect: false, timeout: 3000 })).headers.location[0]; + let url = cacheM3u8(rurl,{headers:{'Referer':'https://www.aliyundrive.com/'}, timeout: 3000},'video'+i+'.m3u8'); + urls.push(url + "#isVideo=true##pre#"); + names.push(transcoding[item.template_id] ? transcoding[item.template_id] : item.template_height); + heads.push({ 'Referer': 'https://www.aliyundrive.com/' }); + }catch(e){} + return 1; + } + let list = datalist.map((item,id)=>{ + return { + func: task, + param: {'item':item,'id':id}, + id: id + } + }); + if(list.length>0){ + be(list, { + func: function(obj, id, error, taskResult) { + }, + param: { + } + }); + } + return { + urls: urls, + names: names, + headers: heads + }; +} function getAliUrl(share_id, file_id, alitoken) { try { function getNowTime() { @@ -1007,13 +1044,13 @@ function getAliUrl(share_id, file_id, alitoken) { 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 })); let playurl = json.video_preview_play_info.live_transcoding_task_list; playurl.reverse(); + /* let urls = []; let names = []; let heads = []; playurl.forEach((item,i) => { let rurl = JSON.parse(request(item.url, { headers: { 'Referer': 'https://www.aliyundrive.com/' }, onlyHeaders: true, redirect: false, timeout: 3000 })).headers.location[0]; let url = cacheM3u8(rurl,{headers:{'Referer':'https://www.aliyundrive.com/'}, timeout: 2000},'video'+i+'.m3u8'); - log(url); urls.push(url + "#isVideo=true##pre#"); names.push(transcoding[item.template_id] ? transcoding[item.template_id] : item.template_height); heads.push({ 'Referer': 'https://www.aliyundrive.com/' }); @@ -1022,7 +1059,8 @@ function getAliUrl(share_id, file_id, alitoken) { urls: urls, names: names, headers: heads - }; + };*/ + return getAliPlayUrl(palyurl); } } } catch (e) {