Thanks
const handleInjectParseVideoJS = function o(t){let e=!1,r=!1,n={},o="",i="",a="",l=window.location.href,c=window.location.host,u={},d="",p="",m="",f={},g={},y=[],h={},v=new Set;const b=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;let w,_=[];const S={compare:function(t){return(e,r)=>{let n=e[t],o=r[t];return"number"!=typeof n&&(n=(n=n.replace(/[^0-9]/g,""))?Number(n):0),(o="number"!=typeof o?(o=o.replace(/[^0-9]/g,""))?Number(o):0:o)-n}},isMobileOrIpad:function(){const t=navigator.userAgent;var e=!!["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"].filter((e=>t.includes(e))).length;return e||!!(t.match(/Macintosh/)&&1<navigator.maxTouchPoints)||e},isMobile:function(){const t=navigator.userAgent;return!!["Android","iPhone","SymbianOS","Windows Phone","iPod"].filter((e=>t.includes(e))).length},replaceUrlArg:function(t,e,r){return t=new URL(t),t.searchParams.set(e,r),t.href},queryURLParams:function(t,e){return e=new RegExp("[?&#]+"+e+"=([^?&#]+)").exec(t),e&&e[1]||""},queryParams:function(t,e){return t?this.queryURLParams("https;//stap.app?"+t,e):""},getLastPathParameter:function(t){return t=new URL(t).pathname.split("/").filter((t=>""!==t)),t[t.length-1]},matchUrlInString:function(t){var e=new RegExp("(https?|http)?(:)?//[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]","g");t=t.match(e);return t&&t.length?t[0]:""},isURL:function(t){return!!t&&/^http[s]?:\/\/.*/.test(t)},completionSourceUrl:function(t){return t?(/^(f|ht)tps?:\/\//i.test(t)||(/^\/\//i.test(t)?t=window.location.protocol+t:/^\//i.test(t)&&(t=window.location.origin+t)),t):""},checkCharLengthAndSubStr:function(t,e){return t?(e=e||80,t.replace(/[^x00-xff]/g,"01").length<=e?t:t.substr(0,e)):""},isChinese(t){return!!t&&!!/.*[u4e00-u9fa5]+.*$/.test(t)},urlEncodeChinese(t){var e;return t&&(e=new RegExp("[\\u4E00-\\u9FFF]","g"),t.replace(e,(function(t){return window.encodeURI(t)})))},getUrlPathName:function(t){let e="",r=(e=(this.isURL(t)?new URL(t):new URL(l)).pathname).split("/");return(r=r.filter((t=>{if(t&&""!=t)return t}))).pop()},generateUuid:function(t,e){t=t||32;var r,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");let o,i=[];if(e=e||n.length,t)for(o=0;o<t;o++)i[o]=n[0|Math.random()*e];else for(i[8]=i[13]=i[18]=i[23]="_",i[14]="4",o=0;o<36;o++)i[o]||(r=0|16*Math.random(),i[o]=n[19==o?3&r|8:r]);return i.join("")},isBase64(t){if(!t)return!1;if(/^data:.*\w+;base64,/.test(t))return!0;if(""===t||""===t.trim())return!1;try{return window.btoa(window.atob(t))==t}catch(t){return!1}},isDark(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches},parseToDOM(t){var e=document.createElement("template");return"string"==typeof t?(e.innerHTML=t,e.content):t},getHostname(t){if(!t)return"";try{return new URL(t).hostname.toLowerCase()}catch(tt){return t.split("/")[0].toLowerCase()}},div(t,e){let r,n,o=0,i=0;try{o=t.toString().split(".")[1].length}catch(t){o=0}try{i=e.toString().split(".")[1].length}catch(t){i=0}return r=Number(t.toString().replace(".","")),n=Number(e.toString().replace(".","")),this.mul(r/n,Math.pow(10,i-o))},sub(t,e){let r,n,o;try{r=t.toString().split(".")[1].length}catch(t){r=0}try{n=e.toString().split(".")[1].length}catch(t){n=0}return o=Math.pow(10,Math.max(r,n)),(this.mul(t,o)-this.mul(e,o))/o},mul(t,e){let r=0,n=t.toString(),o=e.toString();try{r+=n.split(".")[1].length}catch(t){}try{r+=o.split(".")[1].length}catch(t){}return Number(n.replace(".",""))*Number(o.replace(".",""))/Math.pow(10,r)},add(t,e){let r,n,o;try{r=t.toString().split(".")[1].length}catch(t){r=0}try{n=e.toString().split(".")[1].length}catch(t){n=0}return o=Math.pow(10,Math.max(r,n)),(this.mul(t,o)+this.mul(e,o))/o},hexMD5(t){function e(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function r(t,r,n,o,i,a){return e((r=e(e(r,t),e(o,a)))<<i|r>>>32-i,n)}function n(t,e,n,o,i,a,s){return r(e&n|~e&o,t,e,i,a,s)}function o(t,e,n,o,i,a,s){return r(e&o|n&~o,t,e,i,a,s)}function i(t,e,n,o,i,a,s){return r(e^n^o,t,e,i,a,s)}function a(t,e,n,o,i,a,s){return r(n^(e|~o),t,e,i,a,s)}{var s=function(t){let r=1732584193,s=-271733879,l=-1732584194,c=271733878;for(let f=0;f<t.length;f+=16){var u=r,d=s,p=l,m=c;r=n(r,s,l,c,t[f+0],7,-680876936),c=n(c,r,s,l,t[f+1],12,-389564586),l=n(l,c,r,s,t[f+2],17,606105819),s=n(s,l,c,r,t[f+3],22,-1044525330),r=n(r,s,l,c,t[f+4],7,-176418897),c=n(c,r,s,l,t[f+5],12,1200080426),l=n(l,c,r,s,t[f+6],17,-1473231341),s=n(s,l,c,r,t[f+7],22,-45705983),r=n(r,s,l,c,t[f+8],7,1770035416),c=n(c,r,s,l,t[f+9],12,-1958414417),l=n(l,c,r,s,t[f+10],17,-42063),s=n(s,l,c,r,t[f+11],22,-1990404162),r=n(r,s,l,c,t[f+12],7,1804603682),c=n(c,r,s,l,t[f+13],12,-40341101),l=n(l,c,r,s,t[f+14],17,-1502002290),s=n(s,l,c,r,t[f+15],22,1236535329),r=o(r,s,l,c,t[f+1],5,-165796510),c=o(c,r,s,l,t[f+6],9,-1069501632),l=o(l,c,r,s,t[f+11],14,643717713),s=o(s,l,c,r,t[f+0],20,-373897302),r=o(r,s,l,c,t[f+5],5,-701558691),c=o(c,r,s,l,t[f+10],9,38016083),l=o(l,c,r,s,t[f+15],14,-660478335),s=o(s,l,c,r,t[f+4],20,-405537848),r=o(r,s,l,c,t[f+9],5,568446438),c=o(c,r,s,l,t[f+14],9,-1019803690),l=o(l,c,r,s,t[f+3],14,-187363961),s=o(s,l,c,r,t[f+8],20,1163531501),r=o(r,s,l,c,t[f+13],5,-1444681467),c=o(c,r,s,l,t[f+2],9,-51403784),l=o(l,c,r,s,t[f+7],14,1735328473),s=o(s,l,c,r,t[f+12],20,-1926607734),r=i(r,s,l,c,t[f+5],4,-378558),c=i(c,r,s,l,t[f+8],11,-2022574463),l=i(l,c,r,s,t[f+11],16,1839030562),s=i(s,l,c,r,t[f+14],23,-35309556),r=i(r,s,l,c,t[f+1],4,-1530992060),c=i(c,r,s,l,t[f+4],11,1272893353),l=i(l,c,r,s,t[f+7],16,-155497632),s=i(s,l,c,r,t[f+10],23,-1094730640),r=i(r,s,l,c,t[f+13],4,681279174),c=i(c,r,s,l,t[f+0],11,-358537222),l=i(l,c,r,s,t[f+3],16,-722521979),s=i(s,l,c,r,t[f+6],23,76029189),r=i(r,s,l,c,t[f+9],4,-640364487),c=i(c,r,s,l,t[f+12],11,-421815835),l=i(l,c,r,s,t[f+15],16,530742520),s=i(s,l,c,r,t[f+2],23,-995338651),r=a(r,s,l,c,t[f+0],6,-198630844),c=a(c,r,s,l,t[f+7],10,1126891415),l=a(l,c,r,s,t[f+14],15,-1416354905),s=a(s,l,c,r,t[f+5],21,-57434055),r=a(r,s,l,c,t[f+12],6,1700485571),c=a(c,r,s,l,t[f+3],10,-1894986606),l=a(l,c,r,s,t[f+10],15,-1051523),s=a(s,l,c,r,t[f+1],21,-2054922799),r=a(r,s,l,c,t[f+8],6,1873313359),c=a(c,r,s,l,t[f+15],10,-30611744),l=a(l,c,r,s,t[f+6],15,-1560198380),s=a(s,l,c,r,t[f+13],21,1309151649),r=a(r,s,l,c,t[f+4],6,-145523070),c=a(c,r,s,l,t[f+11],10,-1120210379),l=a(l,c,r,s,t[f+2],15,718787259),s=a(s,l,c,r,t[f+9],21,-343485551),r=e(r,u),s=e(s,d),l=e(l,p),c=e(c,m)}return[r,s,l,c]}(function(t){var e=[];for(let r=0;r<8*t.length;r+=8)e[r>>5]|=(255&t.charCodeAt(r/8))<<r%32;return e}(t)),l="0123456789abcdef";let r="";for(let t=0;t<4*s.length;t++)r+=l.charAt(s[t>>2]>>t%4*8+4&15)+l.charAt(s[t>>2]>>t%4*8&15);return r}}};class x{constructor(t,e){this.dom=t,this.timer=0,this.init(e)}init(t){this.touchstart(t),this.touchend(),this.touchmove(),this.bindLongPressEventFlag()}bindLongPressEventFlag(){this.dom.setAttribute("stay-long-press","yes")}touchstart(t){const e=this;e.dom.removeEventListener("touchstart",(function®{e.handleLongPress(r,t)})),e.dom.addEventListener("touchstart",(function®{return e.handleTargetTouchend(r.target),e.timer=setTimeout(((t,r)=>{e.handleLongPress(t,r)}),600,r,t),!1}),!1)}handleTargetTouchend(t){const e=this;t&&t.addEventListener("touchend",(r=>{e.handleTouchend(r,t)}))}handleLongPress(t,e){if(t.preventDefault(),t.stopPropagation(),!E(this.dom)){t=t.changedTouches[0];try{t.target.addEventListener("contextmenu",(function(t){t.preventDefault()}))}catch(t){}"function"==typeof e&&(e(),this.timer=0)}}touchend(){const t=this;t.dom.removeEventListener("touchend",(function(e){t.handleTouchend(e,null)})),t.dom.addEventListener("touchend",(function(e){return t.handleTouchend(e,null),!1}))}handleTouchend(t,e){const r=this;if(!E(this.dom)&&(clearTimeout(this.timer),0!=this.timer))try{e&&e.removeEventListener("touchend",(t=>{clearTimeout(r.timer)}))}catch(t){}}touchmove(){const t=this;function e(){E(t.dom)||(clearTimeout(t.timer),t.timer=0)}t.dom.removeEventListener("touchmove",(function(t){e()})),t.dom.addEventListener("touchmove",(function(t){return e(),!1}))}}function E(t){return!t||(t=window.getComputedStyle(t))&&("none"===t.display||"hidden"===t.visibility)}class U{constructor(t,e){this.dom=t,this.stayLongPressTimer=0,this.distance=10,this.init(e)}getDomPageStartX(){return this.dom.getBoundingClientRect().left}getDomPageStartY(){return(document.documentElement.scrollTop||window.pageYOffset)+this.dom.getBoundingClientRect().top}getDomPageEndX(){return this.getDomPageStartX()+this.dom.clientWidth}getDomPageEndY(){return this.getDomPageStartY()+this.dom.clientHeight}init(t){this.touchstart(t),this.touchend(),this.touchmove(),this.bindLongPressEventFlag()}bindLongPressEventFlag(){this.dom.setAttribute("stay-long-press","yes")}touchstart(t){const e=this;document.body.removeEventListener("touchstart",(function®{return e.handleTargetEvent(r,t),!1})),document.body.addEventListener("touchstart",(function®{return e.handleTargetTouchend(r.target),e.handleTargetEvent(r,t),!1}),!1)}handleTargetTouchend(t){const e=this;t&&t.addEventListener("touchend",(r=>{e.touchEndCallback(r,t)}))}handleTargetEvent(t,e){t.stopPropagation(),t.preventDefault();const r=this;t=t.changedTouches[0];var n=t.pageX,o=t.pageY;!E(r.dom)&&Math.abs(t.pageX-n)<=r.distance&&n>=r.getDomPageStartX()&&n<=r.getDomPageEndX()&&o>=r.getDomPageStartY()&&o<=r.getDomPageEndY()&&(this.stayLongPressTimer=window.setTimeout(((t,e)=>{r.stayLongPressTimer=0;try{var n=t.target.classList;n.contains("__stay-unselect")||n.add("__stay-unselect"),n.contains("__stay-touch-action")||n.add("__stay-touch-action"),"function"==typeof e&&e(),t.target.addEventListener("contextmenu",(function(t){t.preventDefault()}))}catch(t){}}),600,t,e))}touchend(){const t=this;document.body.removeEventListener("touchend",(function(e){t.touchEndCallback(e,null)})),document.body.addEventListener("touchend",(function(e){return t.touchEndCallback(e,null),!1}))}touchEndCallback(t,e){const r=this;if(!E(this.dom)&&(clearTimeout(this.stayLongPressTimer),0!=this.stayLongPressTimer))try{e&&e.removeEventListener("touchend",(t=>{r.touchEndCallback(t,null)}))}catch(t){}}touchmove(){const t=this;function e(){E(t.dom)||(window.clearTimeout(t.stayLongPressTimer),t.stayLongPressTimer=0)}document.body.removeEventListener("touchmove",(function(t){t.preventDefault(),t.stopPropagation(),e()})),document.body.addEventListener("touchmove",(function(t){return t.preventDefault(),t.stopPropagation(),e(),!1}))}}function A(t){new b((function(t){try{t.forEach((function(t){c=window.location.host,w=document.querySelectorAll("video");var e=t.target.querySelectorAll("video");("VIDEO"===t.target.nodeName||e&&e.length)&&w&&w.length&&O(w)}))}catch(t){}})).observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0});let e=(w=document.querySelectorAll("video"))&&w.length;if(e||(w=document.querySelectorAll(".post-content shreddit-player"),e=w&&w.length),e)O(w);else if(O(),t){let t=!1;for(let e=1;e<10;e++){let r;if(function(e){r=setTimeout((()=>{w=document.querySelectorAll("video"),(t=w&&w.length)&&(O(w),_.forEach((t=>{clearTimeout(t)})))}),200*e)}(e),t)break;_.push®}}}function O(t){if(t&&t.length){var e=t.length;let r=0;Array.from(t).forEach((t=>{if(t&&t instanceof HTMLElement){let o=t.getAttribute("stay-sniffing");o||(o=S.generateUuid(),t.setAttribute("stay-sniffing",o));var e,n=t;let i=t.getAttribute("src");i||(e=t.querySelector("source"))&&(t=e,i=e.getAttribute("src")),i&&function(t,e,r){let n={},o=t.getAttribute("poster")||t.getAttribute("data-poster"),i=t.getAttribute("title"),a=t.getAttribute("src"),s=[],u=(l=window.location.href,e);if(a=S.completionSourceUrl(a),o||(d=document.querySelector("source[type='image/webp'] img"),o=d?d.getAttribute("src"):"",i=i||(d?d.getAttribute("alt"):"")),-1<c.indexOf("youtube.com")){I(a,"");let e=document.querySelector("#player-control-overlay .player-controls-background-container .player-controls-background");if((e=(e=e||document.querySelector("#player-control-overlay"))||document.querySelector(".carousel-wrapper .video-wrapper .reel-player-overlay-main-content"))&&(u=e),!(n=B(t)).videoKey)return n}else{var d,p,m;-1<c.indexOf("baidu.com")?n=function(t){let e={};if(e.poster=t.getAttribute("poster")||"",e.downloadUrl=t.getAttribute("src"),e.title=t.getAttribute("title"),"activity.baidu.com"===c){var r=window.PAGE_DATA;if(r&&r.pageData&&r.pageData.remote&&r.pageData.remote.mainVideoList&&r.pageData.remote.mainVideoList.length)return n=r.pageData.remote.mainVideoList[0],r=r.pageData.remote.moreVideoList,e.title=n.title,e.poster=n.poster,e.downloadUrl=n.videoUrl,r&&r.length&&r.forEach((t=>{v.size&&v.has(t.vid)||S.isURL(t.videoUrl)&&(v.add(t.vid),y.push({title:t.title,poster:t.poster,downloadUrl:t.videoUrl,hostUrl:l,videoUuid:t.vid}))})),e;e.title=W();const t=document.querySelector(".stickyBlock .curVideoPlay video");t&&(e.poster=t.getAttribute("poster"),e.downloadUrl=t.getAttribute("src"))}else if("mbd.baidu.com"===c){var n=window.jsonData;if(n&&n.curVideoMeta&&(r=n.curVideoMeta,(e=V®)&&Object.keys(e).length))return e;e.title=W(),e.poster=H()}else if("haokan.baidu.com"===c){var o=window.__PRELOADED_STATE__,i=S.queryURLParams(l,"vid"),a=t.getAttribute("src");if(a&&i&&-1<a.indexOf(i)){if(o&&o.curVideoMeta&&(a=o.curVideoMeta,(e=V(a))&&Object.keys(e).length))return e;e.title=W(),e.poster=H()}else e.title=t.parentElement.parentElement.querySelector("h3.land-recommend-bottom-title")?t.parentElement.parentElement.querySelector("h3.land-recommend-bottom-title").textContent:"",e.poster=t.parentElement&&t.parentElement.querySelector("img.video-img")?t.parentElement.querySelector("img.video-img").getAttribute("src"):""}else"pan.baidu.com"===c&&(e.title=W()),"m.baidu.com"===c&&((i=document.querySelector(".sfc-video-page-info .sfc-video-page-info-title h3.title-waterfallB"))&&(e.title=i.textContent),o=document.querySelector(".video-poster .c-img-wrapper img.c-img-img"))&&(e.poster=o.getAttribute("src"));return e}(t):-1<c.indexOf("bilibili.com")?n=function(t){let e={},r=(e.poster=t.getAttribute("poster"),e.downloadUrl=t.getAttribute("src"),document.querySelector(".main-container .ep-info-pre .ep-info-title"));if(!r&&!(r=document.querySelector(".video .share-video-info .title-wrapper .title .title-name span"))){let t=setTimeout((function(){return(r=document.querySelector(".video .share-video-info .title-wrapper .title .title-name span"))&&(e.title=r.textContent),clearTimeout(t),t=0,e}),200)}return r&&(e.title=r.textContent),t=document.querySelector("div.m-video-part-new > ul.list > li.part-item.on > span"),t&&(t=t.textContent,e.title=t+e.title),e}(t):-1<c.indexOf("mobile.twitter.com")?((d=document.querySelector(".r-eqz5dr .r-1pi2tsx .r-1pi2tsx .r-1udh08x .r-1p0dtai div.css-1dbjc4n.r-6koalj.r-eqz5dr.r-1pi2tsx.r-13qz1uu"))&&(u=d),n=function(t){let e={},r=(e.poster=t.getAttribute("poster"),e.downloadUrl=t.getAttribute("src"),t.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.nextElementSibling.childNodes[1]);return(r=r&&r.querySelector(".css-1dbjc4n .r-92ivih.r-1t01tom .r-1t982j2.r-1j3t67a .css-1dbjc4n.r-1kw4oii a[data-testid='tweetText'] span"))&&(e.title=S.checkCharLengthAndSubStr(r.textContent)),e}(t)):-1<c.indexOf("m.weibo.cn")?n=function(t){var e={};return e.poster=t.getAttribute("poster"),e.downloadUrl=t.getAttribute("src"),l.match(/^.*\/detail\/.*/g)&&(e.title=S.checkCharLengthAndSubStr(document.querySelector(".weibo-main .weibo-text").textContent)),e}(t):-1<c.indexOf("iesdouyin.com")?n=function(t){var e={};e.poster=t.getAttribute("poster"),e.downloadUrl=t.getAttribute("src"),t=document.querySelector(".video-container img.poster");return t&&(e.poster=t.getAttribute("src")),t=document.querySelector(".desc .multi-line .multi-line_text"),t&&(e.title=t.textContent),e}(t):-1<c.indexOf("douyin.com")?(p=window.location.pathname,n=(-1<p.indexOf("/video")?function(t){var e={};return e.poster=t.getAttribute("poster"),e.downloadUrl=t.getAttribute("src"),t=document.querySelector("div[data-e2e=video-detail] div[data-e2e=detail-video-info] div h2"),t&&(e.title=t.textContent),e}:function(t){var e,r={};r.poster=t.getAttribute("poster"),r.downloadUrl=t.getAttribute("src"),t=t.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;return t&&((e=t.querySelector(".imgBackground img"))&&(r.poster=e.getAttribute("src")),e=t.querySelector(".video-info-detail .title span.e_h_fqNj"))&&(r.title=e.textContent),r})(t)):-1<c.indexOf("m.toutiao.com")?n=function(t){var e={};return e.poster=t.getAttribute("poster"),e.downloadUrl=t.getAttribute("src"),t=document.querySelector(".video .xgplayer-placeholder .xgplayer-poster"),t&&(t=t.getAttribute("style"))&&(t=S.matchUrlInString(t),e.poster=t),t=document.querySelector(".video .video-header .video-title-wrapper .video-title"),t&&(e.title=t.textContent),e}(t):-1<c.indexOf("m.v.qq.com")?n=function(t){var e={};if(e.poster=t.getAttribute("poster"),e.downloadUrl=t.getAttribute("src"),t=document.querySelector(".mod_play .player_container .txp_poster_img"),t&&(t=t.getAttribute("src"),t=S.completionSourceUrl(t),e.poster=t),t=document.querySelector(".mod_box .mod_bd .mod_video_info .video_title"),t){let r=t.textContent;r=r?r.trim():"",t=document.querySelector(".mod_box .mod_bd .mod_list_slider .slider_box .item.current span"),t&&(r=(r+=t.textContent)?r.trim():""),e.title=r}return e}(t):-1<c.indexOf("www.reddit.com")?n=function(t){var e={};return e.poster=t.getAttribute("poster"),e.downloadUrl=t.getAttribute("src"),t=document.querySelector("shreddit-app shreddit-title"),t&&(e.title=t.getAttribute("title")),e}(t):-1<c.indexOf("pornhub.com")?((p=document.querySelector("#videoShow #videoPlayerPlaceholder .playerFlvContainer"))&&(u=p),n=function(t){var e={},r=(e.poster=t.getAttribute("poster"),e.downloadUrl=t.getAttribute("src"),t.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement);return r&&r.classList.contains("playerWrapper")?((r=document.querySelector("#videoShow .categoryTags .headerWrap h1"))&&(r=r.textContent)&&(e.title=r.trim()),(r=document.querySelector("#videoPlayerPlaceholder img.videoElementPoster"))&&(e.poster=r.getAttribute("src")),z(e)):(r=t.parentNode.parentNode.parentNode.parentNode.parentNode,r&&"li"==r.tagName.toLowerCase()&&(t=r.querySelector(".videoWrapper .singleVideo a img.videoThumb"))&&(e.title=t.getAttribute("alt"),e.title&&(e.title="[Related videos] "+e.title),e.poster=t.getAttribute("src")),e)}(t)):-1<c.indexOf("91porn.com")?((m=document.querySelector("#videodetails .video-container"))&&(u=m),n=function(t){var e={};return e.title=t.getAttribute("title"),e.poster=t.getAttribute("poster"),e.downloadUrl=t.getAttribute("src"),e.poster||(t=document.querySelector("#player_one"))&&(e.poster=t.getAttribute("poster")),e}(t)):-1<c.indexOf("facebook.com")?n=function(t){var e,r={};r.poster=t.getAttribute("poster"),r.downloadUrl=t.getAttribute("src"),r.title=t.getAttribute("title"),t=t.parentElement.parentElement.parentElement.parentElement.parentElement;return t&&t.classList.contains("displayed")&&"container"==t.getAttribute("data-type")&&((e=t.querySelector("div[data-type='video'] img.img"))&&(r.poster=e.getAttribute("src")),e=t.querySelector("div.displayed > div[data-type='container'] > div[data-type='container'] > div[data-type='container'] > div[data-type='text'] > div.native-text"))&&(r.title=e.textContent),r}(t):-1<c.indexOf("instagram.com")?n=function(t){let e={},r=(e.poster=t.getAttribute("poster")||"",e.downloadUrl=t.getAttribute("src"),e.title=t.getAttribute("title"),t.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode);var n;return r&&r.classList.contains("_ab8w")&&r.classList.contains("_ab94")&&r.classList.contains("_ab99")&&r.classList.contains("_ab9h")&&r.classList.contains("_ab9m")&&r.classList.contains("_ab9p")&&r.classList.contains("_abcm")?((n=r.querySelector("._aatk .x1uhb9sk .x10l6tqk .x78zum5 img.x5yr21d"))&&(e.poster=n.getAttribute("src")),(n=r.querySelector("._ab9f div._ae1h._ae1i ._ae2s div._ae5q._akdn div div div"))&&n.textContent&&(e.title=n.textContent.replace("... more",""))):(r=t.parentNode.parentNode.parentNode.parentNode.parentNode)&&r.classList.contains("_a8b4")&&r.classList.contains("_acjh")&&(n=r.querySelector("div > div > div.x9f619.x1d8287x.xz4gly6 div.x6ikm8r.x10wlt62 span"))&&(e.title=n.textContent),e}(t):-1<c.indexOf("xiaohongshu.com")?n=function(t){var e={};if(e.poster=t.getAttribute("poster")||"",e.downloadUrl=t.getAttribute("src"),e.title=t.getAttribute("title"),t=document.querySelector(".video-container .video-banner .img-box"),t&&(t=t.getAttribute("style"),t=S.matchUrlInString(t))&&(e.poster=S.completionSourceUrl(t)),t=document.querySelector(".video-container .stage-bottom .author-desc-wrapper .author-desc"),t){let r=t.textContent;r&&(r=r.replace(/^展开/g,""),e.title=S.checkCharLengthAndSubStr®)}return e}(t):-1<c.indexOf("jable.tv")?n=function(t){var e={};return e.poster=t.getAttribute("poster")||"",e.downloadUrl=t.getAttribute("src"),e.title=t.getAttribute("title"),t=document.querySelector(".video-info .info-header .header-left h4"),t&&(e.title=t.textContent),e}(t):-1<c.indexOf("hxaa79.com")?n=function(t){var e={};return e.poster=t.getAttribute("poster")||"",e.downloadUrl=t.getAttribute("src"),e.title=t.getAttribute("title"),t=document.querySelector(".play_main .play_main_1"),t&&(e.title=t.textContent),e}(t):-1<c.indexOf("555yy4.com")&&(n=function(t){let e={},r=(e.poster=t.getAttribute("poster")||"",e.downloadUrl=t.getAttribute("src"),e.title=t.getAttribute("title"),window.parent.document.title);return r=r||window.parent.ep_title,r=r||window.parent.MAC.Title,e.title=r,e}(t))}return n.downloadUrl&&(a=n.downloadUrl),a=S.completionSourceUrl(a),o=o||n.poster,i=i||n.title,n.qualityList&&n.qualityList.length&&(s=n.qualityList),i=i||document.title,i=i||S.getUrlPathName(a),o=S.completionSourceUrl(o),n.title=n.type&&"ad"==n.type?'<span style="font-weight: 700;">Ad·</span>'+i:i,n.poster=o,n.downloadUrl=a,n.hostUrl=l,n.qualityList=s,n.videoUuid=r,a&&L(e,u,n),n}(t,n,o).downloadUrl||r++}else r++})),r==e&&F()}else F()}function L(t,n,o){var s=o.downloadUrl;if(o.videoKey||o.videoUuid){S.isURL(s)||(o.downloadUrl=l),o.videoKey&&!o.videoUuid&&(o.videoUuid=o.videoKey),o.title=o.title?o.title.replace(/\//g,"|"):"",s=o.qualityList,o.shouldDecode&&(o.qualityList=[],h[o.videoUuid]=s);try{!async function(t,n,o){if(n&&S.isMobile()&&!e&&!r&&(a||(r=!0,a=await R(),r=!1),a)&&(!a||"off"!=a)&&(i||(e=!0,i=await C(),e=!1),"a"==i)){var s=n.getAttribute("stay-long-press");if(!s||"yes"!=s){if(document.querySelector("#__style_sinffer_unselect")||document.body.append(S.parseToDOM('<style id="__style_sinffer_unselect">\n .__stay-unselect, video{\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-touch-callout: none;\n }\n .__stay-touch-action{\n touch-action: none!important;\n }\n ')),n.classList.add("__stay-unselect"),n.classList.add("__stay-touch-action"),s=o.hostUrl,-1{q(t,n,o)}))}else if(!(-1{q(t,n,o)}));else if(-1{q(t,e,o)}))}new U(n,(()=>{q(t,n,o)}))}}}(t,n,o)}catch(t){}v.size&&(v.has(o.videoUuid)||v.has(o.videoKey))?y.forEach((t=>(t.videoUuid!=o.videoUuid&&t.videoUuid!=o.videoKey||(t.downloadUrl=o.downloadUrl,t.poster=o.poster||"",t.title=o.title,t.hostUrl=o.hostUrl,t.qualityList=o.qualityList&&o.qualityList.length?o.qualityList:[],t.type=o.type||"",t.videoUuid=o.videoUuid,t.videoKey=o.videoKey),t))):(o.videoUuid&&v.add(o.videoUuid),o.videoKey&&v.add(o.videoKey),y.push(o)),P()}}function D(){return!!(u&&Object.keys(u).length&&p&&u.decodeFunStr&&p==u.pathUuid)}function T(){Object.keys(h).length&&D()&&(Object.keys(h).forEach(((t,e)=>{if(e.length){e.forEach((t=>(t.downloadUrl&&!S.isURL(t.downloadUrl)&&(t.downloadUrl=k(t.downloadUrl)),t.audioUrl&&!S.isURL(t.audioUrl)&&(t.audioUrl=k(t.audioUrl)),t)));let r=e.filter((t=>{if(t.downloadUrl)return t}));y.forEach((e=>{if(e.videoUuid==t)return e.qualityList=r,e})),delete h[t]}})),P())}function P(){var e=S.hexMD5(JSON.stringify(y));o&&o==e||(o=e,t?(e={from:"sniffer",operate:"VIDEO_INFO_PUSH",videoInfoList:y},s.runtime.sendMessage(e,(t=>{}))):window.postMessage({name:"VIDEO_INFO_CAPTURE",videoList:y}))}function C(){return new Promise(((e,r)=>{if(t)s.runtime.sendMessage({from:"sniffer",operate:"GET_STAY_AROUND"},(t=>{t.body&&"{}"!=JSON.stringify(t.body)&&e(t.body)}));else{const t=Math.random().toString(36).substring(2,9),r=n=>{n.data.pid===t&&"GET_STAY_AROUND_RESP"===n.data.name&&(n=n.data&&n.data.response?n.data.response.body:"b",e(n),window.removeEventListener("message",r))};window.postMessage({id:t,pid:t,name:"GET_STAY_AROUND"}),window.addEventListener("message",r)}}))}function R(){return new Promise(((e,r)=>{if(t)s.runtime.sendMessage({from:"popup",operate:"getLongPressStatus"},(t=>{t=t&&t.longPressStatus?t.longPressStatus:"on",e(t)}));else{const t=Math.random().toString(36).substring(2,9),r=n=>{n.data.pid===t&&"GET_LONG_PRESS_STATUS_RESP"===n.data.name&&(e(n.data.longPressStatusRes),window.removeEventListener("message",r))};window.postMessage({id:t,pid:t,name:"GET_LONG_PRESS_STATUS"}),window.addEventListener("message",r)}}))}function q(e,r,n){r.clientWidth;let o=r.clientHeight,i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var a=window.innerWidth||document.documentElement.innerWidth||document.body.innerWidth;let l=r.getBoundingClientRect().top,c=r.getBoundingClientRect().left,u=("VIDEO"==r.tagName&&(l=r.parentNode.getBoundingClientRect().top,c=r.parentNode.getBoundingClientRect().left),c=10,a),d=S.div(S.mul(u,9),16),p=(o${"ad"==n.type?"Download Ad":"Download"}`,E=n.qualityList;if(E&&E.length){let t="";_=0,E.forEach((e=>{let o=e.downloadUrl,i=e.audioUrl;if(n.shouldDecode){if(!S.isURL(o)&&!(o=k(o)))return;if(i&&!S.isURL(i)&&!(i=k(i)))return}r=[{title:n.title,downloadUrl:o,poster:n.poster,hostUrl:S.getHostname(n.hostUrl),uuid:"",protect:e.protect||!1,audioUrl:i,qualityLabel:e.qualityLabel}],o="stay://x-callback-url/snifferVideo?list="+encodeURIComponent(JSON.stringify®);let a=e.qualityLabel,s="";if(a)try{a=a.replace(/[^0-9]/g,""),780HD')}catch(e){}t+=`${e.qualityLabel}${s}`,_+=1})),x=t}let U=l,A=l;lS.sub(i,T)&&(A=S.sub(i,T)));let O="",L=t?s.runtime.getURL("img/video-default.png"):"https://res.stayfork.app/scripts/BB8CD00276006365956C32A6556696AD/icon.png",D='[img]'+L+'[/img]
'+S.getHostname(n.hostUrl)+"";n.poster&&(O="border-radius: 15px;",D=` `),function(t,e,r){if(t&&"VIDEO"==t.tagName){t.setAttribute("autoplay","autoplay"),t.setAttribute("crossOrigin","anonymous");var n=document.createElement("canvas");e=(n.width=e,n.height=r,n.getContext("2d"));e.drawImage(t,0,0,n.width,n.height)}}(e,u,d);var T=`\n .__stay-modal-box{\n position: fixed; \n z-index: 9999999; \n width: 100%; \n height: 100%; \n text-align: center; \n top: 0px;\n -webkit-overflow-scrolling: touch;\n margin: 0 auto;\n transition: all 0.6s;\n box-sizing: border-box;\n visibility: hidden;\n font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue",Helvetica, Arial, "Lucida Grande", sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n .__stay-show-modal{\n background-color: rgba(0, 0, 0, 0.4);\n -webkit-backdrop-filter: blur(10px); \n }\n .__stay-sinffer-content{\n width:100%;\n position: absolute;\n left: 0;\n -webkit-transform: translate3d(0, ${U}px, 0);\n transform: translate3d(0, ${U}px, 0);\n will-change: transform;\n -webkit-transition: -webkit-transform .4s cubic-bezier(0,0,.25,1) 80ms;\n transition: transform .4s cubic-bezier(0,0,.25,1) 80ms;\n box-sizing: border-box;\n }\n .__stay-trans{\n -webkit-transform: translate3d(0,${A}px,0);\n transform: translate3d(0,${A}px,0);\n }\n .__stay-content{\n width:100%;\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: center;\n justify-items: center;\n align-items: center;\n }\n ._stay-sinffer-popup{\n width:230px;padding-top: 10px;box-sizing: border-box;border-radius:15px;\n ${p}\n position: relative;\n margin: 16px auto 0 auto;\n z-index:999999;\n visibility: hidden;\n animation: fadein .5s;\n }\n .__stay-sinffer-poster{\n width: 100%;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n height: ${d}px;\n padding: 0 ${c}px;\n margin:0 auto;\n display: flex;\n flex-direction: column;\n justify-content: center;\n justify-items: center;\n align-items: center;\n box-sizing: border-box;\n box-shadow: 0 0px 10px rgba(54,54,57,0.1);\n transition: All 0.4s ease-in-out;\n -webkit-transition: All 0.4s ease-in-out;\n -moz-transition: All 0.4s ease-in-out;\n -o-transition: All 0.4s ease-in-out;\n animation-name: zoom;\n animation-duration: 0.6s;\n }\n .__stay-video-poster{\n // object-fit: contain;\n // object-position: center;\n width:100%;\n height:100%;\n background-position: center;\n background-repeat: no-repeat;\n border-radius: 15px;\n \n }\n .__stay-poster-box{\n width:100%;\n height:100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n ${g}\n border-radius: 10px;\n box-shadow: 0 0px 10px rgba(54,54,57,0.1);\n }\n .__stay-default-poster{\n width:80px;\n height:60px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n justify-items: center;\n align-items: center;\n box-sizing: border-box;\n }\n ._stay-sinffer-title{\n padding-left: 44px;\n padding-right: 15px;\n width: 100%;\n height:36px;\n line-height: 18px;\n word-break:break-all;\n word-wrap:break-word;\n color: ${m};\n -webkit-box-orient: vertical;\n -webkit-user-select: none;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n text-align: left;\n margin-bottom: 10px;\n box-sizing: border-box;\n font-size: 16px;\n position: relative;\n }\n ._stay-sinffer-title::before{\n content: '';\n background: url(${w}) 50% 50% no-repeat;\n background-size: 18px;\n width: 18px;\n height: 18px;\n position: absolute;\n left: 15px;\n top: 50%;\n transform: translate(0, -50%);\n }\n }\n ._stay-sinffer-title span{\n font-weight: 600;\n color: ${y}\n }\n ._stay-sinffer-tool{\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 9px 15px;\n height: 38px;\n box-sizing: border-box;\n }\n ._stay-sinffer-tool .__tool{\n width: 50%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n color: ${y}\n }\n ._stay-sinffer-tool .__tool img{\n width: 20px;\n }\n ._stay-sinffer-tool .__tool span{\n padding-left: 10px;\n }\n ._stay-sinffer-tool .__airplay{\n \n border-right: 0.5px solid ${f};\n }\n ._stay-sinffer-tool .__pip{\n\n }\n ._stay-sinffer-download{\n width:100%;\n box-sizing: border-box;\n display: flex;\n justify-content: flex-start;\n flex-direction: column;\n align-items: center;\n }\n ._stay-quality-item{\n height: 38px;\n box-sizing: border-box;\n width:100%;\n padding-right: 20px;\n position: relative;\n color: ${m};\n text-align:left;\n font-size: 16px;\n border-top: 0.5px solid ${f};\n padding: 0 15px;\n display: flex;\n align-items: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n ._stay-quality-item .__stay-hd{\n border: 1px solid ${v};\n background: ${b};\n color: ${v};\n font-size: 12px;\n font-weight: 600;\n display: inline-block;\n padding: 0px 4px;\n border-radius: 4px;\n margin-left: 10px;\n align-items: center;\n }\n ._stay-quality-item::after{\n content:"";\n background: url(${h}) no-repeat 50% 50%; \n background-size: 14px;\n position: absolute;\n right: 15px;\n top: 50%;\n transform: translate(0, -52%);\n width: 14px;\n height: 20px;\n }\n @keyframes zoom {\n 0% {transform: scale(1.05)}\n 100% {transform: scale(1);${O}}\n }\n @keyframes fadein {\n 0% {\n transform: translate(0, -100%);\n }\n 100% {\n transform: none;\n }\n }\n @keyframes fadeout {\n 0% {\n transform: translate(0,100%);\n }\n 100% {\n transform: none;\n }\n }\n`,P=['','','',''+D+"",'',''+n.title+"",'',x,"","","","",""];return document.body.append(S.parseToDOM(T)),document.body.append(S.parseToDOM(P.join(""))),document.querySelector("#__stay_sinffer_modal")}()).style.visibility="visible";const m=document.querySelector("#__stay_sinffer_modal ._stay-sinffer-popup");document.querySelector("#__stay_sinffer_modal .__stay-sinffer-content").classList.add("__stay-trans");let f=setTimeout((function(){p.classList.add("__stay-show-modal"),m.style.visibility="visible",clearTimeout(f),f=0}),400);p.addEventListener("touchmove",(t=>{t.preventDefault(),t.stopPropagation()}),!1),p.addEventListener("touchstart",(t=>{t.preventDefault(),p.classList.remove("__stay-show-modal"),m.style.animation="fadeout .5s;";let e=setTimeout((()=>{p&&document.body.removeChild(p),document.body.removeChild(document.querySelector("#__style_sinffer_style")),clearTimeout(e),e=0}),200)}),!1);const g=document.querySelectorAll("#__stay_sinffer_modal ._stay-quality-item");if(g&&g.length)for(let t=0;t{t=t.target.getAttribute("stay-download");var e=document.createElement("a");e.href=t,e.click()}))}function k(t){var e,r;return D()?(e=u.decodeFunStr,e=new Function("return "+e),r=S.queryParams(t,"url"),t=S.queryParams(t,"s"),t=e()(decodeURIComponent(t)),N(r=decodeURIComponent®+"&sig="+t)):""}function N(t){if(function(){let t=D();return t&&!!u.decodeSpeedFunStr}()&&!S.queryURLParams(t,"oid")){let n="",o=0;for(var e in f)f[e]&&void 0!==f[e]&&(o+=1,n+="&"+e+"="+f[e]);var r=S.queryURLParams(t,"n");r&&(g[r]||(g[r]=function(t){try{var e=u.decodeSpeedFunStr;return new Function("return "+e)()(decodeURIComponent(t))}catch(t){return""}}®),g[r])&&(t=S.replaceUrlArg(t,"n",g[r]),t+=n)}return t}function I(t,e){t&&(f.cver=f.cver||S.queryURLParams(t,"cver"),j(t)),e&&Object.keys(e).length&&(e.playbackTracking&&e.playbackTracking.ptrackingUrl&&e.playbackTracking.ptrackingUrl.baseUrl&&j(e.playbackTracking.ptrackingUrl.baseUrl),e.responseContext)&&e.responseContext.serviceTrackingParams&&e.responseContext.serviceTrackingParams.length&&e.responseContext.serviceTrackingParams.forEach((t=>{"CSI"==t.service&&t.params.length&&t.params.forEach((t=>{"cver"==t.key&&(f.cver=f.cver||t.value)}))}))}function j(t){f.cpn=f.cpn||S.queryURLParams(t,"cpn"),f.ptk=f.ptk||S.queryURLParams(t,"ptk"),f.oid=f.oid||S.queryURLParams(t,"oid"),f.ptchn=f.ptchn||S.queryURLParams(t,"ptchn"),f.pltype=f.pltype||S.queryURLParams(t,"pltype")}function M(t){return t&&t.length?(t.sort(S.compare("bitrate")),(t=t[0]).url||(D()?k(t.signatureCipher):t.signatureCipher)):""}function F(){let t=setTimeout((()=>{{let t={},e=window.location.host,r=(l=window.location.href,t.hostUrl=l,null);-1{"hls"==e.format&&"string"==typeof e.quality&&e.videoUrl&&n.push({downloadUrl:e.videoUrl,qualityLabel:e.quality,quality:Number(e.quality)}),!e.defaultQuality||"boolean"!=typeof e.defaultQuality&&"number"!=typeof e.defaultQuality||(r=e.defaultQuality,t.downloadUrl)||(t.downloadUrl=e.videoUrl)})),t.qualityList=n}}return t}function V(t){if(!t)return{};var e={};if(e.title=t.title,e.poster=t.poster,e.downloadUrl=t.playurl,t.clarityUrl&&t.clarityUrl.length){let r=[];t.clarityUrl.forEach((t=>{t.vodVideoHW,r.push({downloadUrl:t.url,qualityLabel:t.title,quality:t.key})})),e.qualityList=r}return e}function H(){var t=document.querySelector(".art-player-wrapper .art-video-player .art-poster");return t&&(t=t.getAttribute("style"),t)?S.matchUrlInString(t):(t=document.querySelector("#bdMainPlayer .art-video-player .art-poster"),t&&(t=t.getAttribute("style"),t)?S.matchUrlInString(t):"")}function W(){var t=document.querySelector(".adVideoPageV3 .curVideoInfo h3.videoTitle");return(t=t||document.querySelector(".video-info .video-info-title"))||(t=document.querySelector(".video-main .video-content .video-title .video-title-left"))?t.textContent:""}function B(t){let e={};var r=window.ytplayer;let o=S.queryURLParams(l,"v")||S.getLastPathParameter(l);o||(i=document.querySelector("#player-control-container > ytm-custom-control > div.inline-player-controls > a.inline-player-overlay"))&&(i=i.getAttribute("href"),o=S.queryParams(i,"v"));var i=r?r.bootstrapPlayerResponse:{};if(o){let l="";if(t)e.poster=t.getAttribute("poster")||"",e.downloadUrl=t.getAttribute("src"),t=t.getAttribute("title"),e.title=t;else if(!r||!i.videoDetails)return e;if(i&&i.videoDetails&&i.streamingData&&(!o||o===i.videoDetails.videoId)){I("",i);t=i.videoDetails;var a=t.title||"",s=(t=(e.title=a,t.thumbnail),t=(t&&(t=t.thumbnails)&&t.length&&(e.poster=t.pop().url),i.microformat&&i.microformat.playerMicroformatRenderer&&i.microformat.playerMicroformatRenderer.thumbnail&&i.microformat.playerMicroformatRenderer.thumbnail.thumbnails.length&&(e.poster=i.microformat.playerMicroformatRenderer.thumbnail.thumbnails[0].url),i.streamingData),t.adaptiveFormats);if(t.formats,l=l||"",!s||!s.length||l&&l.replace(/\s+/g,"")!==a.replace(/\s+/g,""))e.title=l||G(),e.downloadUrl=Y();else{let o=[];new Set;var c;t=r.bootstrapWebPlayerContextConfig?r.bootstrapWebPlayerContextConfig.jsUrl:"";try{t&&(c=$(m=t))&&(n.randomPathUuid=c)}catch(tt){}let i={},a=[],l=[],u=(s.forEach((t=>{var e,r=t.mimeType;-1{var r=i[t],n=r.filter((t=>{if(-1{if(-1(t.qualityLabel&&-1{var r=window.localStorage.getItem("__stay_decode_str");r&&(u=JSON.parse®).pathUuid&&u.pathUuid==t&&u.decodeFunStr?(T(),Z(t,e,!1)):Z(t,e,!0)};if(m=window.ytplayer?window.ytplayer.bootstrapWebPlayerContextConfig?window.ytplayer.bootstrapWebPlayerContextConfig.jsUrl:"":m)p=$(m),t(p,m);else for(let e=1;e{(d=document.querySelector("#player-base"))&&d.getAttribute("src")&&(m=d.getAttribute("src"),p=$(m),t(p,m),_.forEach((t=>{clearTimeout(t)})))}),200*e)}(e),d&&d.getAttribute("src"))break;_.push®}}}async function Z(e,r,n){o=e,i=window.location.href;var o,i,a=await new Promise(((e,r)=>{if(t)s.runtime.sendMessage({from:"sniffer",operate:"fetchYoutubeDecodeFun",pathUuid:o,pathUrl:i},(t=>{t=t&&t.decodeFunObj?t.decodeFunObj:{},e(t)}));else{const t=Math.random().toString(36).substring(2,9),r=n=>{n.data.pid===t&&"GET_YOUTUBE_DECODE_FUN_RESP"===n.data.name&&(e(n.data.decodeFunObj),window.removeEventListener("message",r))};window.postMessage({id:t,pid:t,name:"GET_YOUTUBE_DECODE_FUN",pathUuid:o,pathUrl:i}),window.addEventListener("message",r)}}));a&&Object.keys(a).length&&a.status&&200==a.status?(J(e,a.decodeFunStr,a.decodeSpeedFunStr),n&&T()):Q(e,r)}function J(t,e,r){u={pathUuid:t,decodeFunStr:e,decodeSpeedFunStr:r},n.decodeFunStr=e,n.decodeSpeedFunStr=r,window.localStorage.setItem("__stay_decode_str",JSON.stringify(u))}async function Q(e,r){if(r&&e)try{var n=await(await fetch("https://m.youtube.com"+r)).text();if(n){var o=n.match(/[a-zA-Z0-9$]+\=function\(a\)\{[\r\n|a]\=a\.split\(\"\"\).*return\s+a\.join\(\"\"\)\};/g);let r="";if(r=o&&o.length?o[0]:r){let o="";var i=n.match(/var\s+[a-zA-Z0-9$]{2}\=\{[a-zA-Z0-9]{2}\:function[\s\S]*(a\.reverse\(\)|splice\(0\,b\)|length\]\=c)\}\};/g);if(o=i&&i.length?i[0]:o)if(r=r.replace(/[a-zA-Z0-9$]+\=function\(a\)\{/g,"function decodeFun(a){"+o)){let o="";var a=n.match(/[a-zA-Z0-9$]+\=function\(a\)\{var\sb=a\.split\(\"\"\)[\s\S]*\}return\sb\.join\(\"\"\)\};/g);if(o=(o=a&&a.length?a[0]:o)&&o.replace(/^[a-zA-Z0-9$]+\=function\(a\)\{/g,"function decodeSpeedFun(a){"),function(t){try{var e=new Function("return "+t),r=e()(decodeURIComponent("%3D%3DQmbTSWlgLuztoft4F_uqQieS7_jBtboKab9zSp5WRdSAiApcTRtZLjBmFtzLXphJ0x_haWmWIhVtdAg8jD1rsKkRKAhIQRw8JQ0qOAOA"));if(decodeURIComponent("https://rr5---sn-o097znsk.googlevideo.com/videoplayback%3Fexpire%3D1679042695%26ei%3DJ9QTZJ6FFKeksfIPkaSL-Aw%26ip%3D2602%253Afeda%253A30%253Aae86%253A40e7%253A53ff%253Afe8b%253A9a97%26id%3Do-AI3u_uLu7PqvSwoVFwTG0fSk-puen4XBHxlLqco9MH8Q%26itag%3D135%26aitags%3D133%252C134%252C135%252C160%252C242%252C243%252C244%252C278%26source%3Dyoutube%26requiressl%3Dyes%26mh%3D_m%26mm%3D31%252C26%26mn%3Dsn-o097znsk%252Csn-a5meknzk%26ms%3Dau%252Conr%26mv%3Dm%26mvi%3D5%26pl%3D44%26initcwndbps%3D2135000%26vprv%3D1%26mime%3Dvideo%252Fmp4%26ns%3DwhOrAPi40PxLIKHeHvAaoDIL%26gir%3Dyes%26clen%3D18438908%26dur%3D584.533%26lmt%3D1635010443575003%26mt%3D1679020854%26fvip%3D5%26keepalive%3Dyes%26fexp%3D24007246%26c%3DMWEB%26txp%3D5432434%26n%3D3BrEIxrXFc7SkC%26sparams%3Dexpire%252Cei%252Cip%252Cid%252Caitags%252Csource%252Crequiressl%252Cvprv%252Cmime%252Cns%252Cgir%252Cclen%252Cdur%252Clmt%26lsparams%3Dmh%252Cmm%252Cmn%252Cms%252Cmv%252Cmvi%252Cpl%252Cinitcwndbps%26lsig%3DAG3C_xAwRgIhAKYBlOvRZiHPnnEJJ5foNn7LZU1cgGvfyO3WU9TjETfZAiEA6PvSgRq0gdcsBBTTj0VHXybmMwb-ouW2TVIYGmG_PG0%253D")+"&sig="+r)return 1}catch(t){}}®){var l=e,c=r,u=o;if(t)s.runtime.sendMessage({from:"sniffer",operate:"saveYoutubeDecodeFun",pathUuid:l,randomFunStr:c,randomSpeedFunStr:u},(t=>{}));else{const t=Math.random().toString(36).substring(2,9),e=r=>{r.data.pid===t&&"SAVE_YOUTUBE_DECODE_FUN_STR_RESP"===r.data.name&&window.removeEventListener("message",e)};window.postMessage({id:t,pid:t,name:"SAVE_YOUTUBE_DECODE_FUN_STR",pathUuid:l,randomFunStr:c,randomSpeedFunStr:u}),window.addEventListener("message",e)}}J(e,r,o)}else J(e,"","");else J(e,"","")}else J(e,"","")}else J(e,"","")}catch®{J(e,"","")}else J(e,"","")}function tt(t){!async function(){i||(e=!0,i=await C(),e=!1),a||(r=!0,a=await R(),r=!1)}(),X(),A(t)}tt(!1),document.onreadystatechange=()=>{"complete"===document.readyState&&tt(!0)},Object.defineProperty(n,"randomPathUuid",{get:function(){return randomPathUuid},set:function(t){(randomPathUuid=t)!=p&&Z(p=t,m,!1)}}),Object.defineProperty(n,"decodeFunStr",{get:function(){return decodeFunStr},set:function(t){(decodeFunStr=t)&&T()}})} handleInjectParseVideoJS(false);