AdguardFilters icon indicating copy to clipboard operation
AdguardFilters copied to clipboard

www.iqiyi.com

Open adguard-bot opened this issue 1 year ago • 8 comments

Issue URL (Ads)

https://www.iqiyi.com/

Screenshots

Screenshot 1

Screenshot 1

System configuration

Information Value
AdGuard product: AdGuard Browser Extension v4.4.30
System version: Windows 10
Browser: Edge
Tracking protection options: Block WebRTC,
Strip URLs from tracking parameters,
Hide your search queries,
Send Do-Not-Track header,
Self-destructing third-party cookies (2880),
Block trackers
Filters: Ad Blocking:
AdGuard Base

Privacy:
AdGuard URL Tracking,
AdGuard Tracking Protection,
Legitimate URL Shortener

Annoyances:
AdGuard Cookie Notices,
AdGuard Popups,
AdGuard Other Annoyances,
AdGuard Widgets,
AdGuard Annoyances,
Adblock Warning Removal List

Other:
AdGuard DNS,
Filter unblocking search ads and self-promotion

Language-specific:
AdGuard Chinese
Custom filters: https://easylist-downloads.adblockplus.org/easyprivacy.txt,
https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt,
https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt
Browsing Security: disabled
Browsing Security statistics: disabled

adguard-bot avatar Oct 13 '24 08:10 adguard-bot

Likely requires Chinese IP. Should be fixed though due to other issue on iqiyi.com (ad looks the same).

BlazDT avatar Oct 18 '24 09:10 BlazDT

Likely requires Chinese IP. Should be fixed though due to other issue on iqiyi.com (ad looks the same).

很遗憾这个问题并没有被修复,不过我尝试找到了其他的方法。

||static.iqiyi.com/ext ||mesh.if.iqiyi.com/portal/lw/ad/ ||mesh.if.iqiyi.com/aid/ip/info

||www.iqiyi.com/prelw/portal/lw/v5/channel/recommend 不过需要注意的是,上面这条规则中可能误杀了部分正常的内容,不过经过测试似乎没有太大影响,但是我也不太确定。 或许你有办法可以从返回的数据中精准的把广告解决?考虑到你可能无法访问,下面的附件中有请求的结果。

https://www.iqiyi.com/prelw/portal/lw/v5/channel/recommend?lwaFastKey=Page_recommend_1&v=12.94.20247 发现有一些关键的字段或许可以给你提供一些帮助,比如 isAdShow: true, isAdClick: true, isAdEmptyShow: false,

1

recommend.zip

YHSanSheng avatar Oct 19 '24 09:10 YHSanSheng

Please test this rule in user filter: iqiyi.com#%#//scriptlet('trusted-replace-xhr-response', '"isAdShow":true,"isAdClick":true', '"isAdShow":false,"isAdClick":false', '/recommend')

If not working, please try this rule: iqiyi.com#%#//scriptlet('trusted-replace-xhr-response', '/{\"order\"[\s\S]*\"isAd\"\:true[\s\S]*ad_watermark_url[a-zA-Z0-9":.\/\-_+]{10,}\}\,\{\"order/', '{"order', '/recommend')

BlazDT avatar Oct 20 '24 08:10 BlazDT

Please test this rule in user filter: iqiyi.com#%#//scriptlet('trusted-replace-xhr-response', '"isAdShow":true,"isAdClick":true', '"isAdShow":false,"isAdClick":false', '/recommend')

If not working, please try this rule: iqiyi.com#%#//scriptlet('trusted-replace-xhr-response', '/{\"order\"[\s\S]*\"isAd\"\:true[\s\S]*ad_watermark_url[a-zA-Z0-9":.\/\-_+]{10,}\}\,\{\"order/', '{"order', '/recommend')

加入后似乎都没有生效,广告依旧存在,然而当我重新添加下面的规则广告就消失了 ||www.iqiyi.com/prelw/portal/lw/v5/channel/recommend

或许这才是最简单有效的方法

YHSanSheng avatar Oct 20 '24 10:10 YHSanSheng

This would block normal recommendations according to content of this request. @AdamWr that request shows as XHR when I check the log. Should the rule not normally remove the ad entries? In regexp tester it shows as matched.

BlazDT avatar Oct 22 '24 10:10 BlazDT

If content and request URL are matched then it rather should replace it (though even if it replaces the content, in devtools in the network panel original content will be shown), but it's hard to tell because I cannot reproduce these ads and I don't see "isAdShow": true on my end. I'm not sure if it will helps, but you can also try this rule:

iqiyi.com#%#//scriptlet('json-prune', 'adSlots data.adverts data.extData.adverts')

AdamWr avatar Oct 22 '24 11:10 AdamWr

If content and request URL are matched then it rather should replace it (though even if it replaces the content, in devtools in the network panel original content will be shown), but it's hard to tell because I cannot reproduce these ads and I don't see "isAdShow": true on my end. I'm not sure if it will helps, but you can also try this rule:

iqiyi.com#%#//scriptlet('json-prune', 'adSlots data.adverts data.extData.adverts')

在提交issue之前我尝试过类似的“json-prune”脚本规则,刚才我重新测试了这条规则,但是遗憾的是他们都对阻止广告没有帮助。

我从日志上看到这些脚本的确执行了,但是我不确定他们是否真的生效了,或许这个网站对反广告脚本有反制措施?

YHSanSheng avatar Oct 22 '24 12:10 YHSanSheng

I was able to reproduce these ads with VPN. It looks like that https://www.iqiyi.com/prelw/portal/lw/v5/channel/recommend?lwaFastKey=Page_recommend_1&v=12.94.20247 is a script, not a XHR request, so trusted-replace-xhr-response cannot be used in this case. These rules:

iqiyi.com###middle_banner_ad_bk
iqiyi.com##.search-item-box:has(> a > div > div[class^="ad_adContent"])
iqiyi.com##div[class^="list_list__"] > div[style*="margin-bottom:"] > div[style*="margin-right:"]:has(> div > div[style*="background-image:"] div > div[class^="video-list-item_"] > div[class^="video-list-item_"] > a > div[class^="video-list-item_"] > div[class*="video-list-item_"] > img[src*="/ADS/"])
iqiyi.com#%#//scriptlet('json-prune', 'data.template.tabs.*.blocks.*.data.data.videos.*.ad')
iqiyi.com#%#(()=>{let e=!1;window.qyMesh=window.qyMesh||{},window.qyMesh=new Proxy(window.qyMesh,{get:function(a,t,d){return!e&&a?.preload?.Page_recommend_1?.response?.items&&(a.preload.Page_recommend_1.response.items.forEach(((e,a,t)=>{e.extData?.dataExtAd&&(e.extData.dataExtAd={}),e.video&&e.video.forEach(((e,a,t)=>{e.adverts&&(e.adverts=[]),e.data&&e.data.forEach(((e,a,t)=>{e.ad&&t.splice(a,1)}))}))})),e=!0),Reflect.get(a,t,d)}})})();
||mesh.if.iqiyi.com/portal/*/recommend?$xmlhttprequest,removeparam=ad
||mesh.if.iqiyi.com/portal/*/recommend?$xmlhttprequest,removeparam=adExt
||mesh.if.iqiyi.com/portal/lw/search/$xmlhttprequest,removeparam=ad
||mesh.if.iqiyi.com/portal/lw/search/$xmlhttprequest,removeparam=adExt

should fix ads.

AdamWr avatar Oct 22 '24 15:10 AdamWr

I was able to reproduce these ads with VPN. It looks like that https://www.iqiyi.com/prelw/portal/lw/v5/channel/recommend?lwaFastKey=Page_recommend_1&v=12.94.20247 is a script, not a XHR request, so trusted-replace-xhr-response cannot be used in this case. These rules:

iqiyi.com###middle_banner_ad_bk
iqiyi.com##.search-item-box:has(> a > div > div[class^="ad_adContent"])
iqiyi.com##div[class^="list_list__"] > div[style*="margin-bottom:"] > div[style*="margin-right:"]:has(> div > div[style*="background-image:"] div > div[class^="video-list-item_"] > div[class^="video-list-item_"] > a > div[class^="video-list-item_"] > div[class*="video-list-item_"] > img[src*="/ADS/"])
iqiyi.com#%#//scriptlet('json-prune', 'data.template.tabs.*.blocks.*.data.data.videos.*.ad')
iqiyi.com#%#(()=>{let e=!1;window.qyMesh=window.qyMesh||{},window.qyMesh=new Proxy(window.qyMesh,{get:function(a,t,d){return!e&&a?.preload?.Page_recommend_1?.response?.items&&(a.preload.Page_recommend_1.response.items.forEach(((e,a,t)=>{e.extData?.dataExtAd&&(e.extData.dataExtAd={}),e.video&&e.video.forEach(((e,a,t)=>{e.adverts&&(e.adverts=[]),e.data&&e.data.forEach(((e,a,t)=>{e.ad&&t.splice(a,1)}))}))})),e=!0),Reflect.get(a,t,d)}})})();
||mesh.if.iqiyi.com/portal/*/recommend?$xmlhttprequest,removeparam=ad
||mesh.if.iqiyi.com/portal/*/recommend?$xmlhttprequest,removeparam=adExt
||mesh.if.iqiyi.com/portal/lw/search/$xmlhttprequest,removeparam=ad
||mesh.if.iqiyi.com/portal/lw/search/$xmlhttprequest,removeparam=adExt

should fix ads.

1 2

感谢您提供的帮助,不过这些广告似乎比想象中的更顽固。

或许正如我之前说的,最简单的方法就是直接把整个链接拦截,虽然他看起来会误杀掉部分正常内容,但是似乎没有产生太大的影响。总体来说应该是利大于弊,当然,我不推荐把下面这条规则正式加入拦截,因为我并没有经过严格的验证。 ||www.iqiyi.com/prelw/portal/lw/v5/channel/recommend

YHSanSheng avatar Oct 23 '24 10:10 YHSanSheng

On my end these rules still work fine. Could you additionally add this rule:

iqiyi.com##div[class^="list_list__"] > div[style*="margin-bottom:"] > div[style*="margin-right:"]:has(> div > div[style*="background-image:"] div > div[class^="video-list-item_"] > div[class^="video-list-item_"] > a[href*="&creative_id="][href*="&impress_id="])

and check again.

AdamWr avatar Oct 23 '24 11:10 AdamWr

On my end these rules still work fine. Could you additionally add this rule:

iqiyi.com##div[class^="list_list__"] > div[style*="margin-bottom:"] > div[style*="margin-right:"]:has(> div > div[style*="background-image:"] div > div[class^="video-list-item_"] > div[class^="video-list-item_"] > a[href*="&creative_id="][href*="&impress_id="])

and check again.

这条规则是有效的,添加这条规则后广告已经消失了。

YHSanSheng avatar Oct 23 '24 11:10 YHSanSheng

Okay, so as far as I understand, that rule fixed the problem. I have added it and some other rules, filters update should be available in 1-2 hours. Thank you for checking it out.

AdamWr avatar Oct 23 '24 12:10 AdamWr