#!name=YouTube
#!desc=某些APP要清除缓存或者重新安装拦截广告才会生效！
#!author=奶思
#!category=奶思的模块
#!homepage=https://github.com/fmz200/wool_scripts
#!raw-url=https://github.com/fmz200/wool_scripts/raw/main/Surge/module/split/partY/YouTube.sgmodule
#!tg-channel=https://t.me/inaisi
#!arguments=youtube_enable:true

[Map Local]
# 播放页广告
^https:\/\/rr[\w-]+\.googlevideo\.com\/initplayback\? data-type=text data="{}" status-code=200 header="Content-Type:application/json"

[Script]
# 响应体
YouTube响应体 = type=http-response, pattern=^https:\/\/youtubei\.googleapis\.com\/youtubei\/v1\/(browse|next|player|search|reel\/reel_watch_sequence|guide|account\/get_setting|get_watch), script-path=https://raw.githubusercontent.com/Maasea/sgmodule/refs/heads/master/Script/Youtube/youtube.response.js, requires-body=true, binary-body-mode=true, timeout=60

[MITM]
hostname = %APPEND% rr*.googlevideo.com, youtubei.googleapis.com

