PageSourceSearch

https://www.200000.live/music.js

js 200000.live collected 2026-10-01 16:08:56 UTC 16,618 bytes, 1 lines download raw bytes

1!function(){"use strict";var e=document,t=window,n=function(t){return e.getElementById(t)},r={clientId:"421377149592-dmjks109l47taomf1je1d1nrjcaptflm.apps.googleusercontent.com",apiKey:"AIzaSyDGbN-GeGWHRl7SLxG8UNf5bPI0fKAaqE0",appId:"421377149592"};function i(){return!(!r.clientId||!r.appId)}!function(){try{var e=localStorage.getItem("dt-gd-cfg");if(!e)return;var t=JSON.parse(e);t&&"object"==typeof t&&(t.clientId&&(r.clientId=String(t.clientId)),t.apiKey&&(r.apiKey=String(t.apiKey)),t.appId&&(r.appId=String(t.appId)))}catch(e){}}();var a="https://www.googleapis.com/drive/v3",o="dt-gd-lib";function u(e,n,r){try{if(t.I18N&&"function"==typeof t.I18N.t){var i=t.I18N.t(e,r);if(i&&i!==e)return i}}catch(e){}if(r&&null!=n)for(var a in r)n=String(n).split("{"+a+"}").join(r[a]);return null!=n?n:e}function s(e){return String(e).replace(/[&<>"]/g,function(e){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[e]})}function c(e){if(!isFinite(e)||e<0)return"–:––";e=Math.floor(e);var t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60;return(t?t+":":"")+(t&&n<10?"0"+n:""+n)+":"+(r<10?"0"+r:r)}function l(e){var t=String(e||"").replace(/\.[a-z0-9]{1,5}$/i,"");return t.replace(/^\s*\d{1,3}\s*[-._)\]]\s*/,"")||t}function d(t){return new Promise(function(n,r){var i=e.querySelector('script[data-msrc="'+t+'"]');if(i&&i.dataset.done)return n();if(i)return i.addEventListener("load",function(){n()}),void i.addEventListener("error",function(){r(new Error("load"))});var a=e.createElement("script"),o=!1,u=function(){if(!o){o=!0;try{a.parentNode&&a.parentNode.removeChild(a)}catch(e){}r(new Error("load"))}},s=setTimeout(u,15e3);a.src=t,a.async=!0,a.dataset.msrc=t,a.onload=function(){o||(o=!0,clearTimeout(s),a.dataset.done="1",n())},a.onerror=function(){clearTimeout(s),u()},e.head.appendChild(a)})}var f=!1,p={v:1,folders:[],tracks:[]},m={value:null,exp:0},v=null,h=null,g=0,k=[],y=[],b=-1,w=-1,E=!1,L="off",I=null,x=null,T=0,A=!1,S=!1;function _(){try{var e=localStorage.getItem(o);if(!e)return{v:1,folders:[],tracks:[]};var t=JSON.parse(e);return t&&"object"==typeof t?{v:1,folders:Array.isArray(t.folders)?t.folders.filter(function(e){return e&&e.id}):[],tracks:Array.isArray(t.tracks)?t.tracks.filter(function(e){return e&&e.id}):[]}:{v:1,folders:[],tracks:[]}}catch(e){return{v:1,folders:[],tracks:[]}}}function C(){try{localStorage.setItem(o,JSON.stringify(p))}catch(e){}}function N(e){for(var t=0;t<p.tracks.length;t++)if(p.tracks[t].id===e)return p.tracks[t];return null}function P(e,t){var n,r={},i=0;for(n=0;n<e.length;n++)r[e[n].id]=1;t&&(p.tracks=p.tracks.filter(function(e){return e.manual||e.folderId!==t||r[e.id]}));var a={};for(n=0;n<p.tracks.length;n++)a[p.tracks[n].id]=p.tracks[n];for(n=0;n<e.length;n++){var o=e[n],u=a[o.id];u?(u.name=o.name,u.mime=o.mime,u.size=o.size,o.manual&&(u.manual=!0)):(p.tracks.push(o),i++)}return i}function O(){return!!(m.value&&m.exp>Date.now()+6e4)}function M(e,n){if(n&&(m.value=null,m.exp=0),O())return Promise.resolve(m.value);if(h)return h;var i=g,a=function(){h=null};return(h=d("https://accounts.google.com/gsi/client").then(function(){if(i!==g)throw new Error("signed_out");var n=v||(t.google&&t.google.accounts&&t.google.accounts.oauth2?v=t.google.accounts.oauth2.initTokenClient({client_id:r.clientId,scope:"https://www.googleapis.com/auth/drive.file",callback:function(e){var t=v.__pending;v.__pending=null,t&&(t.epoch===g?e&&e.access_token?(m.value=e.access_token,m.exp=Date.now()+1e3*Number(e.expires_in||3600),S=!1,j(),t.res(m.value)):t.rej(new Error("no_token")):t.rej(new Error("signed_out")))},error_callback:function(e){var t=v.__pending;v.__pending=null,t&&t.rej(new Error(e&&e.type||"oauth_failed"))}}):null);if(!n)throw new Error("gsi_unavailable");return new Promise(function(t,r){n.__pending={res:t,rej:r,epoch:i};try{n.requestAccessToken({prompt:e?"consent":"none"})}catch(e){n.__pending=null,r(e)}})})).then(a,a),h}function R(){return!(!navigator.serviceWorker||!navigator.serviceWorker.controller)}function j(){if(R())try{navigator.serviceWorker.controller.postMessage({type:"gd-token",token:O()?{v:m.value,exp:m.exp}:null})}catch(e){}}function z(e,t){return M(!!(t=t||{}).interactive,!!t.force).then(function(t){return fetch(a+e,{headers:{Authorization:"Bearer "+t}})}).then(function(n){if(401===n.status){if(t.retried)throw m.value=null,m.exp=0,new Error("unauthorized");return z(e,{interactive:t.interactive,force:!0,retried:!0})}if(403===n.status)throw new Error("forbidden");if(404===n.status)throw new Error("notfound");if(!n.ok)throw new Error("http_"+n.status);return n.json()})}navigator.serviceWorker&&navigator.serviceWorker.addEventListener("message",function(e){if(e&&e.data&&"gd-token-req"===e.data.type){var t=e.ports&&e.ports[0];if(t){var n=function(){try{t.postMessage({token:O()?{v:m.value,exp:m.exp}:null})}catch(e){}};e.data.refresh?M(!1,!0).then(n,n):O()?n():M(!1).then(n,n)}}});var D=["audio/mpeg","audio/mp3","audio/mp4","audio/x-m4a","audio/aac","audio/flac","audio/x-flac","audio/ogg","audio/opus","audio/webm","audio/wav","audio/x-wav","audio/wave"],F="application/vnd.google-apps.folder";function U(e){var t=[],n=[e],r={},i=0,a=!1,o=!1;function u(o,s,c){var l="'"+o.replace(/'/g,"\\'")+"' in parents and trashed=false and (mimeType contains 'audio/' or mimeType = '"+F+"')";return z("/files?q="+encodeURIComponent(l)+"&fields="+encodeURIComponent("nextPageToken,files(id,name,mimeType,size)")+"&pageSize=1000&supp
1ortsAllDrives=true&includeItemsFromAllDrives=true"+(s?"&pageToken="+encodeURIComponent(s):"")).then(function(s){if((s.files||[]).forEach(function(o){if(o.mimeType===F){if(r[o.id])return;return i+n.length>=200?void(a=!0):(r[o.id]=1,void n.push(o.id))}t.length>=5e3?a=!0:t.push({id:o.id,name:o.name,mime:o.mimeType,size:Number(o.size||0),folderId:e})}),s.nextPageToken&&c+1<20)return u(o,s.nextPageToken,c+1);s.nextPageToken&&(a=!0)})}return r[e]=1,function t(){if(!n.length)return Promise.resolve();var r=n.shift();return i++,u(r,null,0).then(t,function(n){var i=n&&n.message;if(r===e||"forbidden"!==i&&"notfound"!==i)throw n;return o=!0,t()})}().then(function(){return{files:t,truncated:a,partial:o}})}function G(){i()?(Q(!0),Promise.all([M(!O()),d("https://apis.google.com/js/api.js").then(function(){return new Promise(function(e,n){if(t.google&&t.google.picker)return e();t.gapi.load("picker",{callback:function(){e()},onerror:function(){n(new Error("picker"))}})})})]).then(function(e){var n=e[0],i=new t.google.picker.DocsView(t.google.picker.ViewId.DOCS);i.setIncludeFolders(!0),i.setSelectFolderEnabled(!0),i.setMimeTypes(D.join(","));var a=(new t.google.picker.PickerBuilder).setAppId(r.appId).setOAuthToken(n).addView(i).enableFeature(t.google.picker.Feature.MULTISELECT_ENABLED).setCallback(K);r.apiKey&&a.setDeveloperKey(r.apiKey),a.build().setVisible(!0),Q(!1)}).catch(function(e){Q(!1),X(q(e))})):X(u("mus.errNoConfig","This build has no Google client ID compiled in yet."))}function K(e){if(e&&e[t.google.picker.Response.ACTION]===t.google.picker.Action.PICKED){var n=e[t.google.picker.Response.DOCUMENTS]||[],r=[],i=[];n.forEach(function(e){"folder"===e.type||"application/vnd.google-apps.folder"===e.mimeType?r.push({id:e.id,name:e.name}):i.push({id:e.id,name:e.name,mime:e.mimeType||"",size:Number(e.sizeBytes||0),manual:!0})}),Q(!0);var a=0,o=0,s=0,c=0,l=0,d=0,f=0;i.length&&P(i,null);var m=Promise.resolve();r.forEach(function(e){m=m.then(function(){return U(e.id).then(function(t){l++,t.truncated&&c++,t.partial&&d++,f+=t.files.length;for(var n=!1,r=0;r<p.folders.length;r++)if(p.folders[r].id===e.id){n=!0;break}n||p.folders.push(e);var i=!t.truncated&&!t.partial&&t.files.length>0;P(t.files,i?e.id:null)}).catch(function(e){var t=e&&e.message;"forbidden"===t||"notfound"===t?a++:"unauthorized"===t?o++:s++})})}),m.then(function(){C(),re(),Q(!1),Y(),o?(S=!0,X(u("mus.errAuth","Google sign-in did not complete."))):a&&!l?X(u("mus.errFolderScope","Picking a folder did not grant access to the files inside it. Open the folder in the picker and select the tracks themselves.")):!l||f||i.length?X(a||s||d?u("mus.warnSomeFolders","Some folders could not be read — select their tracks directly."):c?u("mus.warnTruncated","That folder holds more tracks than we can list at once — some were left out."):""):X(u("mus.errFolderScope","Picking a folder did not grant access to the files inside it. Open the folder in the picker and select the tracks themselves.")),Y()})}}function q(e){var t=e&&e.message;return"gsi_unavailable"===t||"load"===t?u("mus.errNetwork","Couldn't reach Google. Check the connection and try again."):"forbidden"===t?u("mus.errForbidden","Google refused the request. The file may no longer be shared with this app."):"signed_out"===t?"":u("mus.errAuth","Google sign-in did not complete.")}function B(){if(x){try{URL.revokeObjectURL(x)}catch(e){}x=null}}function H(){if(T++,w=-1,b=-1,I){I.pause(),I.removeAttribute("src");try{I.load()}catch(e){}}B()}function W(e,n){if(!(e<0||e>=k.length)){var r=N(k[e]);if(r){var i=++T;w=e,b=y.indexOf(e),ee(),Z(),Q(!0),function(e){return R()?M(!1).then(function(){return j(),{url:"/gdrive-stream/"+encodeURIComponent(e.id),blob:!1}}):M(!1).then(function(t){return fetch(a+"/files/"+encodeURIComponent(e.id)+"?alt=media&supportsAllDrives=true",{headers:{Authorization:"Bearer "+t}}).then(function(e){if(401===e.status)throw new Error("unauthorized");if(!e.ok)throw new Error("http_"+e.status);return e.blob()}).then(function(e){return{url:URL.createObjectURL(e),blob:!0}})})}(r).then(function(e){if(i!==T){if(e.blob)try{URL.revokeObjectURL(e.url)}catch(e){}return null}return B(),e.blob&&(x=e.url),I.src=e.url,I.play()}).then(function(){i===T&&(Q(!1),S=!1,X(""),te(),function(e){if(!navigator.mediaSession)return;try{navigator.mediaSession.metadata=new t.MediaMetadata({title:l(e.name)}
1),navigator.mediaSession.setActionHandler("play",function(){V()}),navigator.mediaSession.setActionHandler("pause",function(){V()}),navigator.mediaSession.setActionHandler("previoustrack",function(){$(-1,!1)}),navigator.mediaSession.setActionHandler("nexttrack",function(){$(1,!1)})}catch(e){}}(r),Y())}).catch(function(t){if(i===T){Q(!1);var r=t&&t.message;if(!n&&("unauthorized"===r||"http_401"===r))return M(!0,!0).then(function(){W(e,!0)}).catch(function(){S=!0,X(u("mus.errAuth","Google sign-in did not complete.")),Y()});"unauthorized"===r||"no_token"===r||"oauth_failed"===r?(S=!0,X(u("mus.errAuth","Google sign-in did not complete."))):t&&"NotAllowedError"===t.name?X(u("mus.errAutoplay","The browser blocked playback — press play again.")):X(u("mus.errPlay","Couldn't play that track.")),Y()}})}}}function V(){I&&(w<0?y.length&&W(y[0]):(I.paused?I.play().catch(function(){}):I.pause(),te()))}function J(e){if(y=k.map(function(e,t){return t}),E){for(var t=y.length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=y[t];y[t]=y[n],y[n]=r}if(null!=e&&e>=0){var i=y.indexOf(e);i>0&&(y.splice(i,1),y.unshift(e))}}b=w>=0?y.indexOf(w):-1}function $(e,t){if(y.length){if(t&&"one"===L&&w>=0)return I.currentTime=0,void I.play().catch(function(){});if(b<0)W(y[0]);else{var n=b+e;if(n>=y.length){if("all"!==L)return I.pause(),void te();n=0}else n<0&&(n="all"===L?y.length-1:0);W(y[n])}}}function Q(e){var t=n("mus-add");t&&(t.disabled=e)}function X(e){var t=n("mus-err");if(t){t.textContent=e||" ",t.classList.toggle("show",!!e);var r=n("mus-reconnect");r&&(r.hidden=!S)}}function Y(){var e=O()||p.tracks.length>0,t=n("mus-setup"),r=n("mus-body");t&&(t.hidden=e),r&&(r.hidden=!e);var a=n("mus-cfg-warn");a&&(a.hidden=i());var o=n("mus-reconnect");o&&(o.hidden=!S),Z(),ee(),te()}function Z(){var e=n("mus-list");if(e){var t=n("mus-count");if(t&&(t.textContent=p.tracks.length?1===p.tracks.length?u("mus.count1","1 track"):u("mus.count","{n} tracks",{n:p.tracks.length}):""),k.length){for(var r="",i=0;i<k.length;i++){var a=N(k[i]);if(a){var o=l(a.name);r+='<div class="mus-row'+(i===w?" is-cur":"")+'"><button type="button" class="mus-row-main" data-i="'+i+'"'+(i===w?' aria-current="true"':"")+'><span class="mus-row-n">'+(i===w?'<span class="mus-eq" aria-hidden="true"><i></i><i></i><i></i></span>':i+1)+'</span><span class="mus-row-t">'+s(o)+'</span></button><button type="button" class="mus-row-x" data-del="'+s(a.id)+'" aria-label="'+s(u("mus.removeOne","Remove {name}",{name:o}))+'"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" aria-hidden="true"><path d="M4.5 4.5l7 7M11.5 4.5l-7 7"/></svg></button></div>'}}e.innerHTML=r}else e.innerHTML='<p class="mus-empty">'+s(u("mus.empty","Nothing here yet — add music from your Drive."))+"</p>"}}function ee(){var e=n("mus-np");if(e){var t=w>=0?N(k[w]):null;e.textContent=t?l(t.name):u("mus.nothing","Nothing playing")}}function te(){var e=n("mus-play");if(e&&I){var t=!I.paused&&w>=0;e.classList.toggle("is-playing",t),e.setAttribute("aria-label",t?u("mus.pause","Pause"):u("mus.play","Play"));var r=n("mus-shuffle");r&&r.setAttribute("aria-pressed",E?"true":"false");var i=n("mus-repeat");i&&(i.setAttribute("aria-pressed","off"===L?"false":"true"),i.dataset.mode=L,i.setAttribute("aria-label","one"===L?u("mus.repeatOne","Repeat one"):"all"===L?u("mus.repeatAll","Repeat all"):u("mus.repeatOff","Repeat off")))}}function ne(){if(I){var e=n("mus-seek"),t=n("mus-time"),r=n("mus-dur"),i=I.duration;e&&!A&&(e.max=isFinite(i)&&i>0?i:0,e.value=I.currentTime||0,e.style.setProperty("--pct",(isFinite(i)&&i>0?I.currentTime/i*100:0)+"%")),t&&(t.textContent=c(I.currentTime)),r&&(r.textContent=c(i))}}function re(){var e=w>=0&&w<k.length?k[w]:null;k=p.tracks.map(function(e){return e.id}),(w=e?k.indexOf(e):-1)<0&&e&&H(),J(w)}function ie(){I=n("mus-audio");var e=n("mus-connect");e&&e.addEventListener("click",function(){i()?(Q(!0),M(!0).then(function(){Q(!1),S=!1,X(""),Y(),G()}).catch(function(e){Q(!1),X(q(e))})):X(u("mus.errNoConfig","This build has no Google client ID compiled in yet."))});var r=n("mus-reconnect");r&&r.addEventListener("click",function(){Q(!0),M(!0,!0).then(function(){Q(!1),S=!1,X(""),Y()}).catch(function(e){Q(!1),X(q(e))})});var a=n("mus-add");a&&a.addEventListener("click",G);var o=n("mus-signout");o&&o.addEventListener("click",function(){!function(){var e=m.value;if(g++,h=null,m.value=null,m.exp=0,S=!1,j(),e&&t.google&&t.google.accounts&&t.google.accounts.oauth2)try{t.google.accounts.oauth2.revoke(e,function(){})}catch(e){}}(),H(),Y()});var s=n("mus-clear");s&&s.addEventListener("click",function(){p={v:1,folders:[],tracks:[]},C(),H(),re(),Y()});var l=n("mus-list");l&&l.addEventListener("click",function(e){var t=e.target.closest("[data-del]");if(t){var n=t.getAttribute("data-del");return p.tracks=p.tracks.filter(function(e){return e.id!==n}),C(),re(),void Y()}var r=e.target.closest(".mus-row-main");r&&W(Number(r.dataset.i))});var d=n("mus-play");d&&d.addEventListener("click",V);var f=n("mus-prev");f&&f.addEventListener("click",function(){$(-1,!1)});var v=n("mus-next");v&&v.addEventListener("click",function(){$(1,!1)});var k=n("mus-shuffle");k&&k.addEventListener("click",function(){E=!E,J(w),te()});var y=n("mus-repeat");y&&y.addEventListener("click",function(){L="off"===L?"all":"all"===L?"one":"off",te()});var b=n("mus-seek");if(b){var x=function(){A=!1,I&&isFinite(I.duration)&&I.duration>0&&(I.currentTime=Number(b.value))};b.addEventListener("pointerdown",function(){A=!0}),b.addEventListener("input",function(){b.style.setProperty("--pct",(b.max>0?b.value/b.max*100:0)+"%");var e=n("mus-time");e&&(e.textContent=c(Number(b.value)))}),b.addEventListener("pointerup",x),b.addEventListener("change",x)}var T=n("mus-vol");T&&I&&(I.volume=Number(T.value)/100,T.addEventListener("input",function(){I.volume=Number(T.value)/100,T.style.setProperty("--pct",T.value+"%")}),T.style.setProperty("--pct",T.value+"%")),I&&(I.addEventListener("timeupdate",ne),I.addEventListener("durationchange",ne),I.addEventListener("loadedmetadata",ne),I.addEventListener("play",te),I.addEventListener("pause",te),I.addEventListener("ended",function(){$(1,!0)}),I.addEventListener("error",function(){w<0||!I.getAttribute("src")||X(u("mus.errPlay","Couldn't play that track."))}))}function ae(){var e=n("panel-music");return!(!e||!e.classList.contains("active"))}function oe(){f||(f=!0,p=_(),re(),ie(),Y(),i()&&M(!1).then(Y,function(){}))}function ue(){var e=n("panel-music");e&&(new MutationObserver(function(){ae()&&oe()}).observe(e,{attributes:!0,attributeFilter:["class"]}),ae()&&oe())}"loading"===e.readyState?e.addEventListener("DOMContentLoaded",ue):ue(),t.addEventListener("i18n:ch
1anged",function(){f&&Y()}),t.addEventListener("storage",function(e){f&&(e&&null!==e.key&&e.key!==o||(p=_(),re(),Y()))})}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.