#!name=小红书去广告去水印 (JQ 重构版) #!desc=使用 Map Local 拦截广告/水印,Body Rewrite JQ 处理简单净化,JS 处理跨请求直链提取。 #!category=BetaModule [Map Local] # 🎯 1. 拦截营销/盲盒/引导接口 (Mock 返回空 JSON) ^https?://edith\.xiaohongshu\.com/api/sns/v1/surprisebox/(?:get_style|open|submit_action).* data="{}" data-type=text status-code=200 header="Content-Type:application/json; charset=utf-8" ^https?://www\.xiaohongshu\.com/api/marketing/box/trigger\?.* data="{}" data-type=text status-code=200 header="Content-Type:application/json; charset=utf-8" ^https?://edith\.xiaohongshu\.com/api/sns/v\d+/note/(?:guide|detailfeed/preload)\?.* data="{}" data-type=text status-code=200 header="Content-Type:application/json; charset=utf-8" ^https?://edith\.xiaohongshu\.com/api/sns/v\d+/guide/user_banner.* data="{}" data-type=text status-code=200 header="Content-Type:application/json; charset=utf-8" ^https?://www\.xiaohongshu\.com/api/sns/(?:v\d+/ads/resource|v\d+/hey/\w+/hey_gallery).* data="{}" data-type=text status-code=200 header="Content-Type:application/json; charset=utf-8" # 🎯 2. 拦截水印配置接口 (Mock 返回 1x1 透明 GIF) ^https?://ci\.xiaohongshu\.com/system_config/watermark.* data="R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" data-type=base64 status-code=200 header="Content-Type:image/gif" [Header Rewrite] # 🎯 3. 防 304 缓存处理 (必须使用独立的 [Header Rewrite] 段落!) http-request ^https?://(edith|www|rec|so)\.xiaohongshu\.com/api/sns/ header-del If-None-Match http-request ^https?://(edith|www|rec|so)\.xiaohongshu\.com/api/sns/ header-del If-Modified-Since [Body Rewrite] # 🎯 4. 搜索/系统配置/组件净化 (纯 JQ 处理,零 JS 开销) http-response-jq ^https?://(edith|www|rec|so)\.xiaohongshu\.com/api/sns/v\d+/search/banner_list '.data = {}' http-response-jq ^https?://(edith|www|rec|so)\.xiaohongshu\.com/api/sns/v\d+/search/hot_list '.data.items = []' http-response-jq ^https?://(edith|www|rec|so)\.xiaohongshu\.com/api/sns/v\d+/search/hint '.data.hint_words = []' http-response-jq ^https?://(edith|www|rec|so)\.xiaohongshu\.com/api/sns/v\d+/search/trending '.data.queries = [] | .data.hint_word = {}' http-response-jq ^https?://(edith|www|rec|so)\.xiaohongshu\.com/api/sns/v\d+/system_service/config 'del(.data.app_theme, .data.loading_img, .data.splash, .data.store)' http-response-jq ^https?://(edith|www|rec|so)\.xiaohongshu\.com/api/sns/v\d+/note/widgets 'del(.data.cooperate_binds, .data.generic, .data.note_next_step, .data.widget_list)' # 🎯 5. 开屏广告时间篡改 (JQ 批量赋值使其失效) http-response-jq ^https?://(edith|www|rec|so)\.xiaohongshu\.com/api/sns/v\d+/system_service/splash_config '(.data.ads_groups[]?.start_time, .data.ads_groups[]?.end_time, .data.ads_groups[]?.ads[]?.start_time, .data.ads_groups[]?.ads[]?.end_time) = 3818332800' [Script] # 🎯 6. 核心响应体净化脚本 (仅保留 JQ 无法完成的复杂逻辑) # 涵盖: Feed流解锁保存、LivePhoto提取、视频直链替换、评论区净化、首页/关注流过滤 小红书JS净化 = type=http-response, pattern=^https?://(edith|www|rec|so)\.xiaohongshu\.com/api/sns/(?:v\d+/search/notes|v\d+/(?:followfeed|homefeed)|(?:v2/note/feed|v3/note/videofeed|v4/note/videofeed|v10/note/video/save)|v\d+/note/(?:imagefeed|live_photo/save)|v5/note/comment/list|v3/note/comment/sub_comments|v1/interaction/comment/video/download), requires-body=true, max-size=0, script-path=https://raw.githubusercontent.com/DevCoz/Ruleset/refs/heads/Pv/Js/XHS_Response.js [MITM] hostname = %APPEND% edith.xiaohongshu.com, www.xiaohongshu.com, ci.xiaohongshu.com, rec.xiaohongshu.com, so.xiaohongshu.com