更新 'SrcJyAliPublic.js'

master
src48597962 2 years ago
parent f581b38757
commit 574fa2f93d
  1. 36
      SrcJyAliPublic.js

@ -213,27 +213,33 @@ function aliOpenPlayUrl(file_id,sharedata) {
return ""; return "";
} }
} }
let opentoken; let url = '';
let nowtime = Date.now(); try{
let oldtime = parseInt(getMyVar('opentokenChecktime', '0').replace('time', '')); let opentoken;
let aliopentoken = getMyVar('aliopentoken'); let nowtime = Date.now();
if (aliopentoken && nowtime < (oldtime + 1 * 60 * 60 * 1000)) { let oldtime = parseInt(getMyVar('opentokenChecktime', '0').replace('time', ''));
opentoken = aliopentoken; let aliopentoken = getMyVar('aliopentoken');
} else { if (aliopentoken && nowtime < (oldtime + 1 * 60 * 60 * 1000)) {
opentoken = getopentoken(authorization); opentoken = aliopentoken;
putMyVar('aliopeninfo', opentoken); } else {
putMyVar('opentokenChecktime', nowtime + 'time'); opentoken = getopentoken(authorization);
putMyVar('aliopeninfo', opentoken);
putMyVar('opentokenChecktime', nowtime + 'time');
}
headers['authorization'] = 'Bearer ' + opentoken;
let data3 = {"drive_id":drive_id,"file_id":newfile_id||file_id}
let json3 = JSON.parse(request('https://open.aliyundrive.com/adrive/v1.0/openFile/getDownloadUrl', { headers: headers, body: data3, method: 'POST', timeout: 8000}));
url = json3.url;
}catch(e){
log('获取原画播放地址失败>' + e.message);
} }
headers['authorization'] = 'Bearer ' + opentoken;
let data3 = {"drive_id":drive_id,"file_id":newfile_id||file_id}
let json3 = JSON.parse(request('https://open.aliyundrive.com/adrive/v1.0/openFile/getDownloadUrl', { headers: headers, body: data3, method: 'POST', timeout: 8000}));
if (newfile_id) { if (newfile_id) {
sharedata.file_id = newfile_id; sharedata.file_id = newfile_id;
fdel(sharedata); fdel(sharedata);
} }
return json3.url || ""; return url;
} catch (e) { } catch (e) {
log('获取我的云盘开放原画播放地址失败>' + e.message); log('获取我的云盘原画出现异常>' + e.message);
} }
return ""; return "";
} }
Loading…
Cancel
Save