diff --git a/BaseFilter/sections/specific.txt b/BaseFilter/sections/specific.txt index 8ea0c6a5aa7..9950746ecd0 100644 --- a/BaseFilter/sections/specific.txt +++ b/BaseFilter/sections/specific.txt @@ -799,6 +799,9 @@ www.youtube.com#%#(()=>{const e={apply:(e,t,o)=>{const n=Reflect.apply(e,t,o);if www.youtube.com#%#//scriptlet('set-constant', 'ytcfg.data_.EXPERIMENT_FLAGS.web_streaming_watch', 'false') ! https://github.com/AdguardTeam/AdguardFilters/issues/203236#issuecomment-3902013966 www.youtube.com#%#//scriptlet('prevent-setTimeout', '(),a,b)', '5000') +! Fix fake buffering on mobile website +m.youtube.com#%#//scriptlet('json-prune', 'playerResponse.messages.[].youThereRenderer') +m.youtube.com#%#(()=>{const t={apply:(t,e,n)=>{if(location.href.includes("/shorts/")||location.href.includes("youtube.com/tv")||location.href.includes("youtube.com/embed/"))return Reflect.apply(t,e,n);try{const a=n[0];if(!a?.context?.client)return Reflect.apply(t,e,n);const o=String(Date.now());a.playbackContext&&void 0===a.playbackContext.adPlaybackContext&&(a.playbackContext.contentPlaybackContext.lactMilliseconds=o),a.playerRequest&&void 0===a.playerRequest.playbackContext?.adPlaybackContext&&(a.playerRequest.playbackContext.contentPlaybackContext.lactMilliseconds=o),n[0]=a}catch(t){}return Reflect.apply(t,e,n)}};window.JSON.stringify=new Proxy(window.JSON.stringify,t)})(); ! This one may be unnecessary: ||youtube.com/get_video_info?*=adunit&$important ! https://github.com/AdguardTeam/AdguardFilters/issues/81610 diff --git a/ExperimentalFilter/sections/English/specific_web_sites.txt b/ExperimentalFilter/sections/English/specific_web_sites.txt index 5bc5d3161da..9c9a74f9fda 100644 --- a/ExperimentalFilter/sections/English/specific_web_sites.txt +++ b/ExperimentalFilter/sections/English/specific_web_sites.txt @@ -2,11 +2,6 @@ ! Rules that are restricted to one or more domains. ! This section contain any type of rule grouped by domain. ! -! TODO: Move to Base filter if there will not be any issues with these rules -! Fix fake buffering on mobile website -m.youtube.com#%#//scriptlet('json-prune', 'playerResponse.messages.[].youThereRenderer') -m.youtube.com#%#(()=>{const t={apply:(t,e,n)=>{if(location.href.includes("/shorts/")||location.href.includes("youtube.com/tv")||location.href.includes("youtube.com/embed/"))return Reflect.apply(t,e,n);try{const a=n[0];if(!a?.context?.client)return Reflect.apply(t,e,n);const o=String(Date.now());a.playbackContext&&void 0===a.playbackContext.adPlaybackContext&&(a.playbackContext.contentPlaybackContext.lactMilliseconds=o),a.playerRequest&&void 0===a.playerRequest.playbackContext?.adPlaybackContext&&(a.playerRequest.playbackContext.contentPlaybackContext.lactMilliseconds=o),n[0]=a}catch(t){}return Reflect.apply(t,e,n)}};window.JSON.stringify=new Proxy(window.JSON.stringify,t)})(); -! ! Fix fake buffering on the initial load ! If there will not be any issues with these rules, they perhaps can be moved to the Base filter www.youtube.com#%#(()=>{const t=Function.prototype.call;let e=!1,o=!1,n=!1;const c={apply:(c,r,a)=>{const i=a[0];if(i?.requestNumber&&i?.snapshot)try{o=((t,e=5)=>{if("object"!=typeof t||null===t)return!1;const o=new Array(1e3);let c=0;const r=new WeakSet;for(o[c++]={obj:t,depth:0};c>0&&!n;){const{obj:t,depth:a}=o[--c];if(a>e||"object"!=typeof t||null===t||r.has(t))continue;let i;r.add(t);try{i=Object.hasOwn(t,"backoffTimeMs")}catch(t){}if(i)return void 0!==t.backoffTimeMs||(n=!0,!1);for(const e in t)if(Object.hasOwn(t,e)){let n;try{n=t[e]}catch(t){}null!==n&&"object"==typeof n&&!r.has(n)&&c{if(Function.prototype.call=t,!o&&e)return;const n=window.location.search,c=new URLSearchParams(n).get("v");if(!c)return;const r=await(a="#movie_player",i=200,l=1e4,new Promise((t=>{if(!a||!i||!l)return void t(null);const e=Date.now()+l,o=()=>{const n=document.querySelector(a);n?t(n):Date.now()>e?t(null):setTimeout(o,i)};o()})));var a,i,l;if(!r)return;const s=new URLSearchParams(n).get("t")??"0",u=parseInt(s,10);if("function"==typeof r.loadVideoById&&!location.search.includes("&rco="))try{r.loadVideoById(c,u)}catch(t){}}))})();