diff --git a/SrcJyAliPublic.js b/SrcJyAliPublic.js index 5810eda..5ddf3aa 100644 --- a/SrcJyAliPublic.js +++ b/SrcJyAliPublic.js @@ -150,7 +150,7 @@ function getAliUrl(share_id, file_id, share_pwd) { if (getItem('aliyun_playMode', '智能') == "智能" || getItem('aliyun_playMode') == "原画") { let openUrl = aliOpenPlayUrl(file_id, { sharetoken: sharetoken, share_id: share_id }); if (openUrl) { - urls.push(openUrl + "#isVideo=true##pre#" + (getItem('fastPlayMode')=="1"?"#fastPlayMode##threads=10#":"")); + urls.push(openUrl + "#isVideo=true##pre#" + (getItem('fastPlayMode')=="1"?"#fastPlayMode##threads=6#":"")); names.push("原始 画质"); heads.push({ 'Referer': 'https://www.aliyundrive.com/' }); } else { @@ -213,34 +213,36 @@ function getSubtitle(share_id, sub_file_id, share_pwd) { function aliMyPlayUrl(file_id, drive_id) { try { + let urls = []; + let names = []; + let heads = []; drive_id = drive_id || alidrive_id; let deviceId = userinfo.device_id; let userId = userinfo.user_id; headers['authorization'] = authorization; headers['x-device-id'] = deviceId; let aliecc = createsession(headers, deviceId, userId); - let aliyunUrl = []; if (aliecc.success) { headers['x-signature'] = aliecc.signature; - let data = { "drive_id": drive_id, "file_id": file_id, "category": "live_transcoding", "template_id": "", "get_subtitle_info": true } - let json = JSON.parse(request('https://api.aliyundrive.com/v2/file/get_video_preview_play_info', { headers: headers, body: data, method: 'POST', timeout: 3000 })); - aliyunUrl = json.video_preview_play_info.live_transcoding_task_list; - aliyunUrl.reverse(); - } - let urls = []; - let names = []; - let heads = []; - if (aliyunUrl.length > 0) { - aliyunUrl.forEach((item) => { - if(item.url){ - 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/' }); + if (getItem('aliyun_playMode', '智能') == "智能" || getItem('aliyun_playMode') == "转码") { + let data = { "drive_id": drive_id, "file_id": file_id, "category": "live_transcoding", "template_id": "", "get_subtitle_info": true } + let json = JSON.parse(request('https://api.aliyundrive.com/v2/file/get_video_preview_play_info', { headers: headers, body: data, method: 'POST', timeout: 8000 })); + let aliyunUrl = json.video_preview_play_info.live_transcoding_task_list || []; + aliyunUrl.reverse(); + if (aliyunUrl.length > 0) { + aliyunUrl.forEach((item) => { + if(item.url){ + 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/' }); + } + }) + } else { + log('未获取阿里转码播放地址,建议重进软件再试一次') } - }) - } else { - log('未获取阿里转码播放地址,建议重进软件再试一次') + } } + if (getItem('aliyun_playMode', '智能') == "智能" || getItem('aliyun_playMode') == "原画") { let file_url = aliOpenPlayUrl(file_id, undefined, drive_id); if (file_url) { @@ -249,8 +251,7 @@ function aliMyPlayUrl(file_id, drive_id) { headers['authorization'] = 'Bearer ' + opentoken; fetch('https://openapi.aliyundrive.com/adrive/v1.0/openFile/video/updateRecord', { headers: headers, body: { "duration": "0", "drive_id": drive_id, "file_id": file_id, "play_cursor": "0" }, method: 'POST' }); } - - urls.unshift(file_url + "#isVideo=true##pre#" + (getItem('fastPlayMode')=="1"?"#fastPlayMode##threads=10#":"")); + urls.unshift(file_url + "#isVideo=true##pre#" + (getItem('fastPlayMode')=="1"?"#fastPlayMode##threads=6#":"")); names.unshift("原始 画质"); heads.unshift({ 'Referer': 'https://www.aliyundrive.com/' }); } else {