|
|
|
@ -221,10 +221,25 @@ function aliMyPlayUrl(file_id, drive_id) { |
|
|
|
|
let userId = userinfo.user_id; |
|
|
|
|
headers['authorization'] = authorization; |
|
|
|
|
headers['x-device-id'] = deviceId; |
|
|
|
|
if (getItem('aliyun_playMode', '智能') == "智能" || getItem('aliyun_playMode') == "原画") { |
|
|
|
|
let file_url = aliOpenPlayUrl(file_id, undefined, drive_id); |
|
|
|
|
if (file_url) { |
|
|
|
|
if (getItem('yundisk_updateRecord') == "1") { |
|
|
|
|
let opentoken = getOpenToken(authorization); |
|
|
|
|
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=6#":"")); |
|
|
|
|
names.unshift("原始 画质"); |
|
|
|
|
heads.unshift({ 'Referer': 'https://www.aliyundrive.com/' }); |
|
|
|
|
} else { |
|
|
|
|
clearMyVar('opentokenChecktime'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if ((getItem('aliyun_playMode', '智能') == "智能" && urls.length == 0) || getItem('aliyun_playMode') == "转码") { |
|
|
|
|
let aliecc = createsession(headers, deviceId, userId); |
|
|
|
|
if (aliecc.success) { |
|
|
|
|
headers['x-signature'] = aliecc.signature; |
|
|
|
|
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 || []; |
|
|
|
@ -243,21 +258,6 @@ function aliMyPlayUrl(file_id, drive_id) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (getItem('aliyun_playMode', '智能') == "智能" || getItem('aliyun_playMode') == "原画") { |
|
|
|
|
let file_url = aliOpenPlayUrl(file_id, undefined, drive_id); |
|
|
|
|
if (file_url) { |
|
|
|
|
if (getItem('yundisk_updateRecord') == "1") { |
|
|
|
|
let opentoken = getOpenToken(authorization); |
|
|
|
|
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=6#":"")); |
|
|
|
|
names.unshift("原始 画质"); |
|
|
|
|
heads.unshift({ 'Referer': 'https://www.aliyundrive.com/' }); |
|
|
|
|
} else { |
|
|
|
|
clearMyVar('opentokenChecktime'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return { |
|
|
|
|
urls: urls, |
|
|
|
|
names: names, |
|
|
|
|