From 91c418c2f2201d91815165720e496eb3026f75b7 Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Tue, 25 Jul 2023 18:15:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'SrcJyAliPublic.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SrcJyAliPublic.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/SrcJyAliPublic.js b/SrcJyAliPublic.js index 96907ab..a344a10 100644 --- a/SrcJyAliPublic.js +++ b/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 openUrl = aliOpenPlayUrl(file_id,{sharetoken:sharetoken,share_id:share_id}); if(openUrl){ - urls.push(openUrl + "#.m3u8#pre#"); + urls.push(openUrl + "#isVideo=true##pre#"); names.push("原始 画质"); heads.push({ 'Referer': 'https://www.aliyundrive.com/' }); }else{ @@ -180,7 +180,6 @@ function getAliUrl(share_id, file_id, share_pwd) { return {}; } } - function getSubtitle(share_id,sub_file_id,share_pwd){ try{ share_pwd = share_pwd&&share_pwd.length==4?share_pwd:""; @@ -224,7 +223,7 @@ function aliMyPlayUrl(file_id) { let heads = []; if (aliyunUrl.length > 0) { 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); heads.push({ 'Referer': 'https://www.aliyundrive.com/' }); }) @@ -269,7 +268,7 @@ function aliOpenPlayUrl(file_id,sharedata) { } function copy(obj) { try { - let json = fetch('https://api.aliyundrive.com/adrive/v2/batch', { + let json = JSON.parse(fetch('https://api.aliyundrive.com/adrive/v2/batch', { headers: { 'User-Agent': PC_UA, 'Referer': 'https://www.aliyundrive.com/', @@ -291,8 +290,11 @@ function aliOpenPlayUrl(file_id,sharedata) { "resource": "file" }, method: 'POST' - }); - return JSON.parse(json).responses[0].body.file_id; + })).responses[0].body; + if(/size/.test(json.message)){ + log('云盘没有空间,无法操作转存'); + } + return json.file_id; } catch (e) { return ""; } @@ -330,6 +332,9 @@ function aliOpenPlayUrl(file_id,sharedata) { sharedata.drive_id = drive_id; sharedata.authorization = authorization; newfile_id = copy(sharedata); + if(!newfile_id){ + return ""; + } } let opentoken; let nowtime = Date.now();