From 76dab4b26abe385c0d2e05b5554a0c54cb207bd8 Mon Sep 17 00:00:00 2001 From: Andrew S Date: Mon, 27 Nov 2023 21:54:54 -0600 Subject: [PATCH] Add back yt.mjs header that was accidentally removed --- chrome/player/modules/yt.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/chrome/player/modules/yt.mjs b/chrome/player/modules/yt.mjs index acb2ce6d..6ae65854 100644 --- a/chrome/player/modules/yt.mjs +++ b/chrome/player/modules/yt.mjs @@ -1,4 +1,5 @@ /* eslint-disable */ +/* LuanRT/YouTube.js */ // Minified to reduce loading time (https://minify-js.com/) var Vy=Object.defineProperty;var n=(t,e)=>Vy(t,"name",{value:e,configurable:!0});var Y=(t,e)=>{for(var i in e)Vy(t,i,{get:e[i],enumerable:!0})};function Dy(t,e){var i={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,o=Object.getOwnPropertySymbols(t);s=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}n(Oy,"__values");function co(t){return this instanceof co?(this.v=t,this):new co(t)}n(co,"__await");function Ly(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=i.apply(t,e||[]),s,r=[];return s={},l("next"),l("throw"),l("return"),s[Symbol.asyncIterator]=function(){return this},s;function l(w){o[w]&&(s[w]=function(T){return new Promise(function(C,N){r.push([w,T,C,N])>1||p(w,T)})})}function p(w,T){try{f(o[w](T))}catch(C){g(r[0][3],C)}}function f(w){w.value instanceof co?Promise.resolve(w.value.v).then(m,_):g(r[0][2],w)}function m(w){p("next",w)}function _(w){p("throw",w)}function g(w,T){w(T),r.shift(),r.length&&p(r[0][0],r[0][1])}}n(Ly,"__asyncGenerator");function Fy(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof Oy=="function"?Oy(t):t[Symbol.iterator](),i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i);function o(r){i[r]=t[r]&&function(l){return new Promise(function(p,f){l=t[r](l),s(p,f,l.done,l.value)})}}function s(r,l,p,f){Promise.resolve(f).then(function(m){r({value:m,done:p})},l)}}n(Fy,"__asyncValues");function c(t,e,i,o){if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?o:i==="a"?o.call(t):o?o.value:e.get(t)}n(c,"__classPrivateFieldGet");function S(t,e,i,o,s){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?s.call(t,i):s?s.value=i:e.set(t,i),i}n(S,"__classPrivateFieldSet");var Hg={};Y(Hg,{ChannelError:()=>as,InnertubeError:()=>x,MissingParamError:()=>en,OAuthError:()=>ci,ParsingError:()=>yt,Platform:()=>D,PlayerError:()=>mt,SessionError:()=>Vs,base64ToU8:()=>Tg,concatMemos:()=>Lg,debugFetch:()=>ck,deepCompare:()=>Hh,escapeStringRegexp:()=>Zg,generateRandomString:()=>St,generateSidAuth:()=>Wg,getRandomUserAgent:()=>Go,getStringBetweenStrings:()=>je,hasKeys:()=>lk,isTextRun:()=>Ke,streamToIterable:()=>Gg,throwIfMissing:()=>ee,timeToSeconds:()=>Be,u8ToBase64:()=>bt});var ng={};Y(ng,{Maybe:()=>fo,Memo:()=>Pi,SuperParsedResult:()=>Kt,YTNode:()=>a,observe:()=>ae});var og,Yy,Me,le,$t,hi,po,Uy=Symbol("ObservedArray.isObserved"),a=class{constructor(){og.add(this),this.type=this.constructor.type}is(...e){return e.some(i=>c(this,og,"m",Yy).call(this,i))}as(...e){if(!this.is(...e))throw new yt(`Cannot cast ${this.type} to one of ${e.map(i=>i.type).join(", ")}`);return this}hasKey(e){return Reflect.has(this,e)}key(e){if(!this.hasKey(e))throw new yt(`Missing key ${e}`);return new fo(this[e])}};n(a,"YTNode");og=new WeakSet,Yy=n(function(e){return this.type===e.type},"_YTNode_is");a.type="YTNode";var fo=class{constructor(e){Me.add(this),le.set(this,void 0),S(this,le,e,"f")}get typeof(){return typeof c(this,le,"f")}string(){return c(this,Me,"m",hi).call(this,"string")}isString(){return c(this,Me,"m",$t).call(this,"string")}number(){return c(this,Me,"m",hi).call(this,"number")}isNumber(){return c(this,Me,"m",$t).call(this,"number")}bigint(){return c(this,Me,"m",hi).call(this,"bigint")}isBigint(){return c(this,Me,"m",$t).call(this,"bigint")}boolean(){return c(this,Me,"m",hi).call(this,"boolean")}isBoolean(){return c(this,Me,"m",$t).call(this,"boolean")}symbol(){return c(this,Me,"m",hi).call(this,"symbol")}isSymbol(){return c(this,Me,"m",$t).call(this,"symbol")}undefined(){return c(this,Me,"m",hi).call(this,"undefined")}isUndefined(){return c(this,Me,"m",$t).call(this,"undefined")}null(){if(c(this,le,"f")!==null)throw new TypeError(`Expected null, got ${typeof c(this,le,"f")}`);return c(this,le,"f")}isNull(){return c(this,le,"f")===null}object(){return c(this,Me,"m",hi).call(this,"object")}isObject(){return c(this,Me,"m",$t).call(this,"object")}function(){return c(this,Me,"m",hi).call(this,"function")}isFunction(){return c(this,Me,"m",$t).call(this,"function")}array(){if(!Array.isArray(c(this,le,"f")))throw new TypeError(`Expected array, got ${typeof c(this,le,"f")}`);return c(this,le,"f")}arrayOfMaybe(){let e=[];return new Proxy(this.array(),{get(i,o){return Reflect.has(e,o)?Reflect.get(i,o):new fo(Reflect.get(i,o))}})}isArray(){return Array.isArray(c(this,le,"f"))}node(){if(!(c(this,le,"f")instanceof a))throw new TypeError(`Expected YTNode, got ${c(this,le,"f").constructor.name}`);return c(this,le,"f")}isNode(){return c(this,le,"f")instanceof a}nodeOfType(...e){return this.node().as(...e)}isNodeOfType(...e){return this.isNode()&&this.node().is(...e)}observed(){if(!this.isObserved())throw new TypeError(`Expected ObservedArray, got ${typeof c(this,le,"f")}`);return c(this,le,"f")}isObserved(){var e;return(e=c(this,le,"f"))===null||e===void 0?void 0:e[Uy]}parsed(){if(!(c(this,le,"f")instanceof Kt))throw new TypeError(`Expected SuperParsedResult, got ${typeof c(this,le,"f")}`);return c(this,le,"f")}isParsed(){return c(this,le,"f")instanceof Kt}any(){return console.warn("This call is not meant to be used outside of debugging. Please use the specific type getter instead."),c(this,le,"f")}instanceof(e){if(!this.isInstanceof(e))throw new TypeError(`Expected instance of ${e.name}, got ${c(this,le,"f").constructor.name}`);return c(this,le,"f")}isInstanceof(e){return c(this,le,"f")instanceof e}};n(fo,"Maybe");le=new WeakMap,Me=new WeakSet,$t=n(function(e){return typeof c(this,le,"f")===e},"_Maybe_checkPrimative"),hi=n(function(e){if(!c(this,Me,"m",$t).call(this,e))throw new TypeError(`Expected ${e}, got ${this.typeof}`);return c(this,le,"f")},"_Maybe_assertPrimative");var Kt=class{constructor(e){po.set(this,void 0),S(this,po,e,"f")}get is_null(){return c(this,po,"f")===null}get is_array(){return!this.is_null&&Array.isArray(c(this,po,"f"))}get is_node(){return!this.is_array}array(){if(!this.is_array)throw new TypeError("Expected an array, got a node");return c(this,po,"f")}item(){if(!this.is_node)throw new TypeError("Expected a node, got an array");return c(this,po,"f")}};n(Kt,"SuperParsedResult");po=new WeakMap;function ae(t){return new Proxy(t,{get(e,i){return i=="get"?(o,s)=>e.find((r,l)=>{let p=Hh(o,r);return p&&s&&e.splice(l,1),p}):i==Uy?!0:i=="getAll"?(o,s)=>e.filter((r,l)=>{let p=Hh(o,r);return p&&s&&e.splice(l,1),p}):i=="matchCondition"?o=>e.find(s=>o(s)):i=="filterType"?(...o)=>ae(e.filter(s=>!!s.is(...o))):i=="firstOfType"?(...o)=>e.find(s=>!!s.is(...o)):i=="first"?()=>e[0]:i=="as"?(...o)=>ae(e.map(s=>{if(s.is(...o))return s;throw new yt(`Expected node of any type ${o.map(r=>r.type).join(", ")}, got ${s.type}`)})):i=="remove"?o=>e.splice(o,1):Reflect.get(e,i)}})}n(ae,"observe");var Pi=class extends Map{getType(...e){return e=e.flat(),ae(e.flatMap(i=>this.get(i.type)||[]))}};n(Pi,"Memo");var Qg={};Y(Qg,{Author:()=>O,ChildElement:()=>x_,EmojiRun:()=>Ai,Format:()=>Tm,Text:()=>u,TextRun:()=>Ri,Thumbnail:()=>b,VideoDetails:()=>Oi});var Ye={};Y(Ye,{CLIENTS:()=>H,INNERTUBE_HEADERS_BASE:()=>nI,OAUTH:()=>Ni,STREAM_HEADERS:()=>Jh,URLS:()=>pe});var pe=Object.freeze({YT_BASE:"https://www.youtube.com",YT_MUSIC_BASE:"https://music.youtube.com",YT_SUGGESTIONS:"https://suggestqueries.google.com/complete/",YT_UPLOAD:"https://upload.youtube.com/",API:Object.freeze({BASE:"https://youtubei.googleapis.com",PRODUCTION_1:"https://www.youtube.com/youtubei/",PRODUCTION_2:"https://youtubei.googleapis.com/youtubei/",STAGING:"https://green-youtubei.sandbox.googleapis.com/youtubei/",RELEASE:"https://release-youtubei.sandbox.googleapis.com/youtubei/",TEST:"https://test-youtubei.sandbox.googleapis.com/youtubei/",CAMI:"http://cami-youtubei.sandbox.googleapis.com/youtubei/",UYTFE:"https://uytfe.sandbox.google.com/youtubei/"})}),Ni=Object.freeze({SCOPE:"http://gdata.youtube.com https://www.googleapis.com/auth/youtube-paid-content",GRANT_TYPE:"http://oauth.net/grant_type/device/1.0",MODEL_NAME:"ytlr::",HEADERS:Object.freeze({accept:"*/*",origin:"https://www.youtube.com","user-agent":"Mozilla/5.0 (ChromiumStylePlatform) Cobalt/Version","content-type":"application/json",referer:"https://www.youtube.com/tv","accept-language":"en-US"}),REGEX:Object.freeze({AUTH_SCRIPT:/