|
|
@ -150,7 +150,7 @@ function getAliUrl(share_id, file_id, share_pwd) { |
|
|
|
if (getItem('aliyun_playMode', '智能') == "智能" || getItem('aliyun_playMode') == "原画") { |
|
|
|
if (getItem('aliyun_playMode', '智能') == "智能" || getItem('aliyun_playMode') == "原画") { |
|
|
|
let openUrl = aliOpenPlayUrl(file_id, { sharetoken: sharetoken, share_id: share_id }); |
|
|
|
let openUrl = aliOpenPlayUrl(file_id, { sharetoken: sharetoken, share_id: share_id }); |
|
|
|
if (openUrl) { |
|
|
|
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=10#":"")); |
|
|
|
names.push("原始 画质"); |
|
|
|
names.push("原始 画质"); |
|
|
|
heads.push({ 'Referer': 'https://www.aliyundrive.com/' }); |
|
|
|
heads.push({ 'Referer': 'https://www.aliyundrive.com/' }); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -174,7 +174,7 @@ function getAliUrl(share_id, file_id, share_pwd) { |
|
|
|
playUrlList.reverse(); |
|
|
|
playUrlList.reverse(); |
|
|
|
playUrlList.forEach((item) => { |
|
|
|
playUrlList.forEach((item) => { |
|
|
|
if(item.url){ |
|
|
|
if(item.url){ |
|
|
|
urls.push(item.url + "#isVideo=true##pre#" + getItem('fastPlayMode')=="1"?"#fastPlayMode##threads=10#":""); |
|
|
|
urls.push(item.url + "#isVideo=true##pre#" + (getItem('fastPlayMode')=="1"?"#fastPlayMode##threads=10#":"")); |
|
|
|
names.push(transcoding[item.template_id] ? transcoding[item.template_id] : item.template_height); |
|
|
|
names.push(transcoding[item.template_id] ? transcoding[item.template_id] : item.template_height); |
|
|
|
heads.push({ 'Referer': 'https://www.aliyundrive.com/' }); |
|
|
|
heads.push({ 'Referer': 'https://www.aliyundrive.com/' }); |
|
|
|
} |
|
|
|
} |
|
|
@ -231,9 +231,10 @@ function aliMyPlayUrl(file_id, drive_id) { |
|
|
|
let names = []; |
|
|
|
let names = []; |
|
|
|
let heads = []; |
|
|
|
let heads = []; |
|
|
|
if (aliyunUrl.length > 0) { |
|
|
|
if (aliyunUrl.length > 0) { |
|
|
|
|
|
|
|
log(aliyunUrl); |
|
|
|
aliyunUrl.forEach((item) => { |
|
|
|
aliyunUrl.forEach((item) => { |
|
|
|
if(item.url){ |
|
|
|
if(item.url){ |
|
|
|
urls.push(item.url + "#isVideo=true##pre#" + getItem('fastPlayMode')=="1"?"#fastPlayMode##threads=10#":""); |
|
|
|
urls.push(item.url + "#isVideo=true##pre#" + (getItem('fastPlayMode')=="1"?"#fastPlayMode##threads=10#":"")); |
|
|
|
names.push(transcoding[item.template_id] ? transcoding[item.template_id] : item.template_height); |
|
|
|
names.push(transcoding[item.template_id] ? transcoding[item.template_id] : item.template_height); |
|
|
|
heads.push({ 'Referer': 'https://www.aliyundrive.com/' }); |
|
|
|
heads.push({ 'Referer': 'https://www.aliyundrive.com/' }); |
|
|
|
} |
|
|
|
} |
|
|
@ -250,7 +251,7 @@ function aliMyPlayUrl(file_id, drive_id) { |
|
|
|
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' }); |
|
|
|
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=10#":"")); |
|
|
|
names.unshift("原始 画质"); |
|
|
|
names.unshift("原始 画质"); |
|
|
|
heads.unshift({ 'Referer': 'https://www.aliyundrive.com/' }); |
|
|
|
heads.unshift({ 'Referer': 'https://www.aliyundrive.com/' }); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -369,7 +370,7 @@ function getOpenToken(authorization) { |
|
|
|
} |
|
|
|
} |
|
|
|
function tvOpenApi(refresh_token) { |
|
|
|
function tvOpenApi(refresh_token) { |
|
|
|
let variable; |
|
|
|
let variable; |
|
|
|
let data = {}; |
|
|
|
let data; |
|
|
|
if (refresh_token) { |
|
|
|
if (refresh_token) { |
|
|
|
data = { |
|
|
|
data = { |
|
|
|
grant_type: "refresh_token", |
|
|
|
grant_type: "refresh_token", |
|
|
@ -392,21 +393,24 @@ function getOpenToken(authorization) { |
|
|
|
body: { |
|
|
|
body: { |
|
|
|
"authorize": 1, |
|
|
|
"authorize": 1, |
|
|
|
"scopes": ["user:base", "file:all:read", "file:all:write"], |
|
|
|
"scopes": ["user:base", "file:all:read", "file:all:write"], |
|
|
|
|
|
|
|
//"drives": ["backup", "resource"],
|
|
|
|
"sid": sid |
|
|
|
"sid": sid |
|
|
|
}, |
|
|
|
}, |
|
|
|
method: 'POST', |
|
|
|
method: 'POST', |
|
|
|
timeout: 8000 |
|
|
|
timeout: 8000 |
|
|
|
})); |
|
|
|
})); |
|
|
|
log(json); |
|
|
|
//log(json);
|
|
|
|
if(json.result){ |
|
|
|
if(json.result){ |
|
|
|
let code = JSON.parse(request("https://openapi.aliyundrive.com/oauth/qrcode/" + sid + "/status")).authCode; |
|
|
|
let code = JSON.parse(request("https://openapi.aliyundrive.com/oauth/qrcode/" + sid + "/status")).authCode; |
|
|
|
data = { "code": code, "grant_type": "authorization_code" } |
|
|
|
data = { "code": code, "grant_type": "authorization_code" } |
|
|
|
} |
|
|
|
} |
|
|
|
log(data); |
|
|
|
|
|
|
|
variable = 0; |
|
|
|
variable = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let json2 = {}; |
|
|
|
let json2 = {}; |
|
|
|
json2 = JSON.parse(request('http://api.extscreen.com/aliyundrive/token', { body: data, method: 'POST', timeout: 8000 })).data; |
|
|
|
if(data){ |
|
|
|
|
|
|
|
json2 = JSON.parse(request('http://api.extscreen.com/aliyundrive/token', { body: data, method: 'POST', timeout: 8000 })).data || {}; |
|
|
|
|
|
|
|
} |
|
|
|
json2.variable = variable; |
|
|
|
json2.variable = variable; |
|
|
|
return json2; |
|
|
|
return json2; |
|
|
|
} |
|
|
|
} |
|
|
|