Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微博广告新url #115

Open
ZhiyuanMa2017 opened this issue Jan 5, 2024 · 2 comments
Open

微博广告新url #115

ZhiyuanMa2017 opened this issue Jan 5, 2024 · 2 comments

Comments

@ZhiyuanMa2017
Copy link

https://api.weibo.cn/2/profile/container_timeline
在浏览用户主页时插入到该用户微博timeline中,json样式如下:
image

同样有"mblogtype" : 1的标记,所以可以使用已有的方法来处理。

surge/wb_ad.js

Lines 279 to 285 in 613f9b2

function is_timeline_ad(mblog) {
if (!mblog) return false;
let promotiontype =
mblog.promotion && mblog.promotion.type && mblog.promotion.type == "ad";
let mblogtype = mblog.mblogtype && mblog.mblogtype == 1;
return promotiontype || mblogtype ? true : false;
}

Quantumult X里的用法:
^https://api.weibo.cn/2/profile/container_timeline url script-response-body https://raw.githubusercontent.com/ZhiyuanMa2017/Scripts/master/wb_ad_test_2.js

@ZhiyuanMa2017
Copy link
Author

ZhiyuanMa2017 commented Jan 6, 2024

https://api.weibo.cn/2/searchall 搜索页面的广告
这个url现在对应的json样式如下:
image
image

surge/wb_ad.js

Line 17 in 613f9b2

const path13 = "/searchall";

surge/wb_ad.js

Lines 99 to 108 in 613f9b2

} else if (
url.indexOf(path9) != -1 ||
url.indexOf(path12) != -1 ||
url.indexOf(path13) != -1 ||
url.indexOf(path14) != -1 ||
url.indexOf(path16) != -1
) {
let obj = JSON.parse(body);
if (obj.cards) obj.cards = filter_timeline_cards(obj.cards);
body = JSON.stringify(obj);

所以这个判断方式不起作用了,需要直接判断obj.items[i].mblogtype
Quantumult X里的用法:
^https://api.weibo.cn/2/searchall url script-response-body https://raw.githubusercontent.com/ZhiyuanMa2017/Scripts/master/wb_ad_test_2.js

@ZhiyuanMa2017
Copy link
Author

https://api.weibo.cn/2/statuses/extend 单条微博看评论的界面
这个url现在对应的json样式如下:
image
所以

const path3 = "/statuses/extend";

surge/wb_ad.js

Lines 54 to 57 in 613f9b2

} else if (url.indexOf(path3) != -1) {
let obj = JSON.parse(body);
if (obj.trend) delete obj.trend;
body = JSON.stringify(obj);

应该改成obj.head_cards就可以了
Quantumult X里的用法:
^https://api.weibo.cn/2/statuses/extend url script-response-body https://raw.githubusercontent.com/ZhiyuanMa2017/Scripts/master/wb_ad_test_4.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant