仅限Shadowrocket模块

哔哩哔哩评论区IP劫持

#!name=Bili IP Loc API
#!desc=哔哩哔哩IP属地劫持


[Rule]
# 强制直连规则
URL-REGEX,^https:\/\/(api\.bilibili\.com|api\.biliapi\.(com|net))\/x\/dynamic\/feed\/draw\/upload_bfs.*,DIRECT

# 强制代理规则
URL-REGEX,^https:\/\/(api\.bilibili\.com|api\.biliapi\.(com|net))\/x\/web-interface\/zone.*,RandomIPs
URL-REGEX,^https:\/\/api\.vc\.bilibili\.com\/vote_svr\/v1\/vote_svr\/create_vote.*,RandomIPs
URL-REGEX,^https:\/\/api\.vc\.bilibili\.com\/dynamic_svr\/v1\/dynamic_svr\/create.*,RandomIPs
URL-REGEX,^https:\/\/(api\.bilibili\.com|api\.biliapi\.(com|net))\/x\/dynamic\/feed\/create\/dyn.*,RandomIPs
URL-REGEX,^https:\/\/api\.vc\.bilibili\.com\/dynamic_draft\/v1\/dynamic_draft\/publish_now.*,RandomIPs
URL-REGEX,^https:\/\/(api\.bilibili\.com|api\.biliapi\.(com|net))\/x\/v2\/reply\/add.*,RandomIPs
URL-REGEX,^https:\/\/(api\.bilibili\.com|api\.biliapi\.(com|net))\/x\/v2\/dm\/exposure.*,RandomIPs

# 默认直连
DOMAIN-SUFFIX,api.bilibili.com,DIRECT
DOMAIN-SUFFIX,api.biliapi.net,DIRECT
DOMAIN-SUFFIX,api.biliapi.com,DIRECT
DOMAIN-SUFFIX,api.vc.bilibili.com,DIRECT

[MITM]
hostname = %APPEND% api.bilibili.com, api.biliapi.com, api.biliapi.net, api.vc.bilibili.com

哔哩哔哩去除PCDN/MCDN

#!name=Bili No PCDN
#!desc=哔哩哔哩去除pcdn/mcdn
[Rule]
# 屏蔽pcdn控制器
# 屏蔽 hw-sh-pcdn-*.biliapi.net 域名
#URL-REGEX,^https?:\/\/hw-sh-pcdn-[0-9]+\.biliapi\.net(:[0-9]+)?\/(.*),REJECT
DOMAIN-KEYWORD,hw-sh-pcdn-,REJECT
# 去除mcdn/pcdn
URL-REGEX,^https?:\/\/[a-zA-Z0-9.-]+\.mcdn\.bilivideo\.cn(:[0-9]+)?\/(.*),https://upos-sz-mirrorcos.bilivideo.com/$2
#URL-REGEX,^https?:\/\/([a-zA-Z0-9.-]+)\.mcdn\.bilivideo\.cn\/(.*),https://proxy-tf-all-ws.bilivideo.com/?url=https%3A%2F%2F$1.mcdn.bilivideo.cn%2F$2
[MITM]
hostname = %APPEND% *.mcdn.bilivideo.cn:*

测试版
理论上也可以直接屏蔽mcdn域名、或者用ipv6获取下载地址(api的三个域名)也许直接屏蔽mcdn是更好的选择(不需要https解密和重写)

阿里云盘Refer修复

#!name=AliyunDrive Referer
#!desc=Add Referer header for AliyunDrive requests
#!version=1.0
[Script]
http-request ^https?:\/\/cn-beijing-data\.aliyundrive\.net header-replace Referer https://www.aliyundrive.com/
[MITM]
hostname = %APPEND% cn-beijing-data.aliyundrive.net