Skip to content
This repository has been archived by the owner on Jul 7, 2023. It is now read-only.

Commit

Permalink
签到按钮跳转离线页面增加新版115支持。
Browse files Browse the repository at this point in the history
  • Loading branch information
ikanam committed Nov 18, 2019
1 parent cea53b7 commit 1ae3afc
Showing 1 changed file with 34 additions and 26 deletions.
60 changes: 34 additions & 26 deletions 115lx.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,45 @@
注意:该脚本无破解离线功能,只是给新版115的App添加创建离线任务的方法。
1.在[Script]分组下添加下面这行配置
http-response ^http:\/\/115\.com\/lx.*$ script-path=https://raw.githubusercontent.com/ikanam/Surge-Scripts/master/115lx.js, requires-body=true
http-response ^https?:\/\/webapi\.115\.com\/user\/check_sign.*$ script-path=https://raw.githubusercontent.com/ikanam/Surge-Scripts/master/115lx.js, requires-body=true
2.[MITM]分组添加hostname = *.115.com
3.在115Aapp中通过网页打开https://115.com/lx?taskdg=1(可在记录中保存该地址打开, 也可添加下面的配置将首页的签到按钮跳转重定向到离线下载页面)
[URL Rewrite]
^http:\/\/115\.com\/\?ct=sign$ https://115.com/lx?taskdg=1 header
4.快速创建下载任务的快捷指令: https://www.icloud.com/shortcuts/31e3a877cec340a48192aa081e25c05e
*/

var body = $response.body;
body = body.replace("UDown", 'XXXXXXXXX'); // 使重定向判断条件失效
let clearJS = `<script type="text/javascript">
$(function(){
function actionSheetAction(index) {
if (index == 4) { return; }
$.ajax({
url: '/web/lixian/?ct=lixian&ac=task_clear',
dataType: 'json',
data: {flag: index},
type: 'POST',
cache: false,
success: function (r) {
window.location.reload();
},
error: function(){
console.log('清空失败');
}
});
}
function clearAction() {
OOFJS.common.actionSheet('选择清空的操作', ['清空已完成任务', '清空全部任务', '清空失败任务', '清空进行中任务'], actionSheetAction);
}
setTimeout(function(){OOFJS.common.addRightBarItem('清空', clearAction);}, 200);
});
</script>`
body = body.replace("</body>", clearJS + '\n</body>'); // 注入清空任务相关JS
if ($request.url.indexOf('/user/check_sign') != -1) {
let json = JSON.parse(body);
json.data.is_new_sign = false;
body = JSON.stringify(json);
} else {
body = body.replace("UDown", 'XXXXXXXXX'); // 使重定向判断条件失效
let clearJS = `<script type="text/javascript">
$(function(){
function actionSheetAction(index) {
if (index == 4) { return; }
$.ajax({
url: '/web/lixian/?ct=lixian&ac=task_clear',
dataType: 'json',
data: {flag: index},
type: 'POST',
cache: false,
success: function (r) {
window.location.reload();
},
error: function(){
console.log('清空失败');
}
});
}
function clearAction() {
OOFJS.common.actionSheet('选择清空的操作', ['清空已完成任务', '清空全部任务', '清空失败任务', '清空进行中任务'], actionSheetAction);
}
setTimeout(function(){OOFJS.common.addRightBarItem('清空', clearAction);}, 200);
});
</script>`
body = body.replace("</body>", clearJS + '\n</body>'); // 注入清空任务相关JS
}
$done({body});

0 comments on commit 1ae3afc

Please sign in to comment.