更新 'SrcJyAliPublic.js'

main
src48597962 2 years ago
parent 0146d42d34
commit 91c418c2f2
  1. 17
      SrcJyAliPublic.js

@ -151,7 +151,7 @@ function getAliUrl(share_id, file_id, share_pwd) {
let sharetoken = JSON.parse(request('https://api.aliyundrive.com/v2/share_link/get_share_token', { body: { "share_pwd": share_pwd, "share_id": share_id }, method: 'POST', timeout: 3000 })).share_token; let sharetoken = JSON.parse(request('https://api.aliyundrive.com/v2/share_link/get_share_token', { body: { "share_pwd": share_pwd, "share_id": share_id }, method: 'POST', timeout: 3000 })).share_token;
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 + "#.m3u8#pre#"); urls.push(openUrl + "#isVideo=true##pre#");
names.push("原始 画质"); names.push("原始 画质");
heads.push({ 'Referer': 'https://www.aliyundrive.com/' }); heads.push({ 'Referer': 'https://www.aliyundrive.com/' });
}else{ }else{
@ -180,7 +180,6 @@ function getAliUrl(share_id, file_id, share_pwd) {
return {}; return {};
} }
} }
function getSubtitle(share_id,sub_file_id,share_pwd){ function getSubtitle(share_id,sub_file_id,share_pwd){
try{ try{
share_pwd = share_pwd&&share_pwd.length==4?share_pwd:""; share_pwd = share_pwd&&share_pwd.length==4?share_pwd:"";
@ -224,7 +223,7 @@ function aliMyPlayUrl(file_id) {
let heads = []; let heads = [];
if (aliyunUrl.length > 0) { if (aliyunUrl.length > 0) {
aliyunUrl.forEach((item) => { aliyunUrl.forEach((item) => {
urls.push(item.url + "#pre#"); urls.push(item.url + "#isVideo=true##pre#");
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/' });
}) })
@ -269,7 +268,7 @@ function aliOpenPlayUrl(file_id,sharedata) {
} }
function copy(obj) { function copy(obj) {
try { try {
let json = fetch('https://api.aliyundrive.com/adrive/v2/batch', { let json = JSON.parse(fetch('https://api.aliyundrive.com/adrive/v2/batch', {
headers: { headers: {
'User-Agent': PC_UA, 'User-Agent': PC_UA,
'Referer': 'https://www.aliyundrive.com/', 'Referer': 'https://www.aliyundrive.com/',
@ -291,8 +290,11 @@ function aliOpenPlayUrl(file_id,sharedata) {
"resource": "file" "resource": "file"
}, },
method: 'POST' method: 'POST'
}); })).responses[0].body;
return JSON.parse(json).responses[0].body.file_id; if(/size/.test(json.message)){
log('云盘没有空间,无法操作转存');
}
return json.file_id;
} catch (e) { } catch (e) {
return ""; return "";
} }
@ -330,6 +332,9 @@ function aliOpenPlayUrl(file_id,sharedata) {
sharedata.drive_id = drive_id; sharedata.drive_id = drive_id;
sharedata.authorization = authorization; sharedata.authorization = authorization;
newfile_id = copy(sharedata); newfile_id = copy(sharedata);
if(!newfile_id){
return "";
}
} }
let opentoken; let opentoken;
let nowtime = Date.now(); let nowtime = Date.now();

Loading…
Cancel
Save