Update Aweme.js

This commit is contained in:
Shawn
2019-07-06 16:26:51 +08:00
committed by GitHub
parent c2fde7ad1b
commit 6b2016dbbe

View File

@@ -1,39 +1,29 @@
$notify(TikTok, 已匹配) $notify(TikTok, 已匹配)
let result = $response.body; let body = JSON.parse($response.body);
function replaceAll(str, find, replace) { if(body.aweme_list){
return str.replace(new RegExp(find, 'g'), replace);
}
var keyword = ['watermark=1'];
keyword.forEach(function(k) {
result = replaceAll(result, k, 'watermark=0');
});
body = JSON.parse(result);
if(result.indexOf('aweme_list') != -1){
body.aweme_list.forEach((element, index)=>{ body.aweme_list.forEach((element, index)=>{
if(element.hasOwnProperty('raw_ad_data')){ if(element.hasOwnProperty('raw_ad_data')){
body.aweme_list.splice(index, 1); body.aweme_list.splice(index, 1);
} }
}); });
body.aweme_list.forEach((element, index)=>{ body.aweme_list.forEach((element, index)=>{
if(element.hasOwnProperty('simple_promotions')){ if(element.hasOwnProperty('simple_promotions')){
delete body.aweme_list[index].simple_promotions; delete body.aweme_list[index].simple_promotions;
} }
}); });
body.aweme_list.forEach((element, index) => { body.aweme_list.forEach((element, index) => {
if (element.interaction_stickers !== null) { if (element.hasOwnProperty('prevent_download')) {
body.aweme_list[index].status.reviewed = 1;
body.aweme_list[index].prevent_download = false;
}
});
body.aweme_list.forEach((element, index) => {
if (element['interaction_stickers'] !== null) {
body.aweme_list[index].interaction_stickers = null; body.aweme_list[index].interaction_stickers = null;
} }
}); });
body['aweme_list'].forEach((element, index) => {
if (element.prevent_download === true) {
body['aweme_list'][index].status.reviewed = 1;
body['aweme_list'][index].prevent_download = false;
}
});
} }
$done({body: JSON.stringify(body)});
body = JSON.stringify(body);
$done(body);
/********************************************************** /**********************************************************
From Surge Version: https://raw.githubusercontent.com/Choler/Surge/master/Script/Aweme.js From Surge Version: https://raw.githubusercontent.com/Choler/Surge/master/Script/Aweme.js