Skip to content

Instantly share code, notes, and snippets.

@abdulbasetbasher
Created June 1, 2022 21:59
Show Gist options
  • Save abdulbasetbasher/5411953c45d06f14510b71df8062f375 to your computer and use it in GitHub Desktop.
Save abdulbasetbasher/5411953c45d06f14510b71df8062f375 to your computer and use it in GitHub Desktop.
yt cdn
const he=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function n(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerpolicy&&(s.referrerPolicy=l.referrerpolicy),l.crossorigin==="use-credentials"?s.credentials="include":l.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=n(l);fetch(l.href,s)}};he();function C(){}function pe(e){return e&&typeof e=="object"&&typeof e.then=="function"}function de(e){return e()}function te(){return Object.create(null)}function N(e){e.forEach(de)}function ue(e){return typeof e=="function"}function me(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let I;function U(e,t){return I||(I=document.createElement("a")),I.href=t,e===I.href}function ve(e){return Object.keys(e).length===0}function ne(e){return e&&ue(e.destroy)?e.destroy:C}function c(e,t){e.appendChild(t)}function _e(e,t,n){const i=ye(e);if(!i.getElementById(t)){const l=u("style");l.id=t,l.textContent=n,ge(i,l)}}function ye(e){if(!e)return document;const t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument}function ge(e,t){c(e.head||e,t)}function O(e,t,n){e.insertBefore(t,n||null)}function j(e){e.parentNode.removeChild(e)}function be(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function u(e){return document.createElement(e)}function L(e){return document.createTextNode(e)}function w(){return L(" ")}function ze(){return L("")}function o(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function qe(e){return Array.from(e.childNodes)}function W(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}let M;function k(e){M=e}function we(){if(!M)throw new Error("Function called outside component initialization");return M}const A=[],le=[],H=[],ie=[],ke=Promise.resolve();let K=!1;function xe(){K||(K=!0,ke.then(X))}function Q(e){H.push(e)}const J=new Set;let P=0;function X(){const e=M;do{for(;P<A.length;){const t=A[P];P++,k(t),$e(t.$$)}for(k(null),A.length=0,P=0;le.length;)le.pop()();for(let t=0;t<H.length;t+=1){const n=H[t];J.has(n)||(J.add(n),n())}H.length=0}while(A.length);for(;ie.length;)ie.pop()();K=!1,J.clear(),k(e)}function $e(e){if(e.fragment!==null){e.update(),N(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(Q)}}const R=new Set;let E;function Ee(){E={r:0,c:[],p:E}}function je(){E.r||N(E.c),E=E.p}function fe(e,t){e&&e.i&&(R.delete(e),e.i(t))}function Fe(e,t,n,i){if(e&&e.o){if(R.has(e))return;R.add(e),E.c.push(()=>{R.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}}function se(e,t){const n=t.token={};function i(l,s,a,f){if(t.token!==n)return;t.resolved=f;let d=t.ctx;a!==void 0&&(d=d.slice(),d[a]=f);const r=l&&(t.current=l)(d);let y=!1;t.block&&(t.blocks?t.blocks.forEach((p,m)=>{m!==s&&p&&(Ee(),Fe(p,1,1,()=>{t.blocks[m]===p&&(t.blocks[m]=null)}),je())}):t.block.d(1),r.c(),fe(r,1),r.m(t.mount(),t.anchor),y=!0),t.block=r,t.blocks&&(t.blocks[s]=r),y&&X()}if(pe(e)){const l=we();if(e.then(s=>{k(l),i(t.then,1,t.value,s),k(null)},s=>{if(k(l),i(t.catch,2,t.error,s),k(null),!t.hasCatch)throw s}),t.current!==t.pending)return i(t.pending,0),!0}else{if(t.current!==t.then)return i(t.then,1,t.value,e),!0;t.resolved=e}}function Ce(e,t,n){const i=t.slice(),{resolved:l}=e;e.current===e.then&&(i[e.value]=l),e.current===e.catch&&(i[e.error]=l),e.block.p(i,n)}function Le(e,t,n,i){const{fragment:l,on_mount:s,on_destroy:a,after_update:f}=e.$$;l&&l.m(t,n),i||Q(()=>{const d=s.map(de).filter(ue);a?a.push(...d):N(d),e.$$.on_mount=[]}),f.forEach(Q)}function Ne(e,t){const n=e.$$;n.fragment!==null&&(N(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Oe(e,t){e.$$.dirty[0]===-1&&(A.push(e),xe(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function Se(e,t,n,i,l,s,a,f=[-1]){const d=M;k(e);const r=e.$$={fragment:null,ctx:null,props:s,update:C,not_equal:l,bound:te(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(d?d.$$.context:[])),callbacks:te(),dirty:f,skip_bound:!1,root:t.target||d.$$.root};a&&a(r.root);let y=!1;if(r.ctx=n?n(e,t.props||{},(p,m,...z)=>{const b=z.length?z[0]:m;return r.ctx&&l(r.ctx[p],r.ctx[p]=b)&&(!r.skip_bound&&r.bound[p]&&r.bound[p](b),y&&Oe(e,p)),m}):[],r.update(),y=!0,N(r.before_update),r.fragment=i?i(r.ctx):!1,t.target){if(t.hydrate){const p=qe(t.target);r.fragment&&r.fragment.l(p),p.forEach(j)}else r.fragment&&r.fragment.c();t.intro&&fe(e.$$.fragment),Le(e,t.target,t.anchor,t.customElement),X()}k(d)}class Te{$destroy(){Ne(this,1),this.$destroy=C}$on(t,n){const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const l=i.indexOf(n);l!==-1&&i.splice(l,1)}}$set(t){this.$$set&&!ve(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function Ae(e){_e(e,"svelte-lye4zq",'main.svelte-lye4zq.svelte-lye4zq{max-width:79rem;margin-left:auto;margin-right:auto}.clearfix.svelte-lye4zq.svelte-lye4zq:before,.clearfix.svelte-lye4zq.svelte-lye4zq:after{content:" ";display:table}.clearfix.svelte-lye4zq.svelte-lye4zq:after{clear:both}.side.svelte-lye4zq.svelte-lye4zq{width:25%}.main.svelte-lye4zq.svelte-lye4zq{width:75%}.col.svelte-lye4zq.svelte-lye4zq{padding-left:0.5rem;padding-right:0.5rem;float:left;box-sizing:border-box}@media(max-width: 800px){.col.svelte-lye4zq.svelte-lye4zq{width:100%}}.responsive-iframe.svelte-lye4zq.svelte-lye4zq{position:relative;padding-bottom:56.25%;height:0;background-repeat:no-repeat;background-size:cover;background-position:center}.responsive-iframe.svelte-lye4zq iframe.svelte-lye4zq{position:absolute;top:0;left:0;width:100%;height:100%}.device-height.svelte-lye4zq.svelte-lye4zq{height:100vh}.center.svelte-lye4zq.svelte-lye4zq{display:flex;align-items:center;justify-content:center;flex-wrap:wrap}.text-share.svelte-lye4zq.svelte-lye4zq{color:rgb(255, 77, 77)}.blka.svelte-lye4zq.svelte-lye4zq{margin-bottom:1rem}.title.svelte-lye4zq.svelte-lye4zq{font-size:1rem}.subtitle.svelte-lye4zq.svelte-lye4zq{font-size:0.75rem}.truncate.svelte-lye4zq.svelte-lye4zq{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}img.svelte-lye4zq.svelte-lye4zq{width:100%;max-width:100%;height:auto}')}function oe(e,t,n){const i=e.slice();return i[2]=t[n],i}function Be(e){let t,n,i,l,s=e[5].message+"",a;return{c(){t=u("div"),n=u("h3"),n.textContent="Something went wrong",i=w(),l=u("p"),a=L(s),o(t,"class","center device-height svelte-lye4zq")},m(f,d){O(f,t,d),c(t,n),c(t,i),c(t,l),c(l,a)},p(f,d){d&0&&s!==(s=f[5].message+"")&&W(a,s)},d(f){f&&j(t)}}}function Me(e){let t,n,i,l,s,a,f,d,r=e[1].video.items[0].snippet.title+"",y,p,m,z,b,S,_,q,x,T,Y,G,Z,F=e[1].related.items,g=[];for(let h=0;h<F.length;h+=1)g[h]=ce(oe(e,F,h));return{c(){t=u("div"),n=u("div"),i=u("div"),l=u("iframe"),f=w(),d=u("h1"),y=L(r),p=w(),m=u("div"),m.textContent="Share This Content",z=w(),b=u("div"),b.innerHTML='<div class="addthis_inline_share_toolbox"></div>',S=w(),_=u("div"),_.innerHTML='<div id="underFoodbox"></div>',q=w(),x=u("div"),T=u("div"),T.innerHTML='<div id="sideFoodbox"></div>',Y=w();for(let h=0;h<g.length;h+=1)g[h].c();o(l,"class","fit svelte-lye4zq"),o(l,"width","1588"),o(l,"height","547"),U(l.src,s="https://www.youtube.com/embed/"+e[1].video.items[0].id)||o(l,"src",s),o(l,"title",a=e[1].video.items[0].snippet.title),o(l,"id","vidEmbed"),o(l,"frameborder","0"),o(l,"allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"),l.allowFullscreen=!0,o(i,"class","responsive-iframe svelte-lye4zq"),o(d,"class","title svelte-lye4zq"),o(m,"class","text-share svelte-lye4zq"),o(b,"class","blka svelte-lye4zq"),o(_,"class","center svelte-lye4zq"),o(n,"class","main col svelte-lye4zq"),o(T,"class","center blka svelte-lye4zq"),o(x,"class","side col svelte-lye4zq"),o(t,"class","clearfix svelte-lye4zq")},m(h,$){O(h,t,$),c(t,n),c(n,i),c(i,l),c(n,f),c(n,d),c(d,y),c(n,p),c(n,m),c(n,z),c(n,b),c(n,S),c(n,_),c(t,q),c(t,x),c(x,T),c(x,Y);for(let v=0;v<g.length;v+=1)g[v].m(x,null);G||(Z=[ne(Je.call(null,_)),ne(Ke.call(null,T))],G=!0)},p(h,$){if($&0&&!U(l.src,s="https://www.youtube.com/embed/"+h[1].video.items[0].id)&&o(l,"src",s),$&0&&a!==(a=h[1].video.items[0].snippet.title)&&o(l,"title",a),$&0&&r!==(r=h[1].video.items[0].snippet.title+"")&&W(y,r),$&0){F=h[1].related.items;let v;for(v=0;v<F.length;v+=1){const ee=oe(h,F,v);g[v]?g[v].p(ee,$):(g[v]=ce(ee),g[v].c(),g[v].m(x,null))}for(;v<g.length;v+=1)g[v].d(1);g.length=F.length}},d(h){h&&j(t),be(g,h),G=!1,N(Z)}}}function re(e){let t,n,i,l,s,a,f,d=e[2].snippet.title+"",r,y,p,m,z=e[2].snippet.description+"",b,S;return{c(){t=u("div"),n=u("a"),i=u("img"),a=w(),f=u("h2"),r=L(d),p=w(),m=u("div"),b=L(z),S=w(),U(i.src,l=e[2].snippet.thumbnails.medium.url)||o(i,"src",l),o(i,"alt",s=e[2].snippet.title),o(i,"class","svelte-lye4zq"),o(f,"class","subtitle svelte-lye4zq"),o(n,"href",y="?video="+e[2].id.videoId),o(n,"class",""),o(m,"class","truncate svelte-lye4zq"),o(t,"class","blka svelte-lye4zq")},m(_,q){O(_,t,q),c(t,n),c(n,i),c(n,a),c(n,f),c(f,r),c(t,p),c(t,m),c(m,b),c(t,S)},p(_,q){q&0&&!U(i.src,l=_[2].snippet.thumbnails.medium.url)&&o(i,"src",l),q&0&&s!==(s=_[2].snippet.title)&&o(i,"alt",s),q&0&&d!==(d=_[2].snippet.title+"")&&W(r,d),q&0&&y!==(y="?video="+_[2].id.videoId)&&o(n,"href",y),q&0&&z!==(z=_[2].snippet.description+"")&&W(b,z)},d(_){_&&j(t)}}}function ce(e){var i;let t,n=((i=e[2].snippet)==null?void 0:i.title)&&re(e);return{c(){n&&n.c(),t=ze()},m(l,s){n&&n.m(l,s),O(l,t,s)},p(l,s){var a;(a=l[2].snippet)!=null&&a.title?n?n.p(l,s):(n=re(l),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(l){n&&n.d(l),l&&j(t)}}}function Ie(e){let t;return{c(){t=u("div"),t.innerHTML="<h3>loading ...</h3>",o(t,"class","center device-height svelte-lye4zq")},m(n,i){O(n,t,i)},p:C,d(n){n&&j(t)}}}function Pe(e){let t,n,i={ctx:e,current:null,token:null,hasCatch:!0,pending:Ie,then:Me,catch:Be,value:1,error:5};return se(n=fetch(`https://m.tube2.me/api/video/${new URLSearchParams(window.location.search).get("video")}`).then(ae).then(e[0]),i),{c(){t=u("main"),i.block.c(),o(t,"class","svelte-lye4zq")},m(l,s){O(l,t,s),i.block.m(t,i.anchor=null),i.mount=()=>t,i.anchor=null},p(l,[s]){e=l,i.ctx=e,s&0&&n!==(n=fetch(`https://m.tube2.me/api/video/${new URLSearchParams(window.location.search).get("video")}`).then(ae).then(e[0]))&&se(n,i)||Ce(i,e,s)},i:C,o:C,d(l){l&&j(t),i.block.d(),i.token=null,i=null}}}const V="mammalbuy.com",He="cf2387b10fe90d876011ccae4a45a970",Re="cf9fe8d709446e0d14f77aa80ce4f465",De="5282f50211f8c1a1bb0a234dd44cb4c6",Ue="84ce311994d63d6947cf191e7e89f489",We="/14/88/2c/14882c04e74edd8e2ce409b7a471b5b0",Ge="/ff/aa/61/ffaa615cfa49088abd71df98d36d446e";function B(e){let t;typeof e=="string"?(t=document.createElement("script"),t.src=e,t.async=!0):t=e,document.getElementsByTagName("head")[0].appendChild(t)}function D(e,t){atAsyncOptions.push({key:e,format:"js",async:1,container:t,params:{}}),B("https://"+V+"/"+e+"/invoke.js")}function Je(e){e.offsetWidth>=728?D(He,"underFoodbox"):e.offsetWidth>=468?D(Re,"underFoodbox"):D(De,"underFoodbox"),B("https://"+V+"/"+We+".js"),B("https://"+V+"/"+Ge+".js"),B("https://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5f3914affa3f1dd6"),B("https://s10.histats.com/js15_as.js")}function Ke(e){D(Ue,"sideFoodbox")}const ae=e=>e.json();function Qe(e){return globalThis.atAsyncOptions=[],[n=>{document.title=n.video.items[0].snippet.title;var i=document.createElement("meta");return i.name="description",i.content=n.video.items[0].snippet.description.substring(0,160),document.head.appendChild(i),n}]}class Ve extends Te{constructor(t){super(),Se(this,t,Qe,Pe,me,{},Ae)}}new Ve({target:document.getElementById("app")});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment