-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbundle.min.js
1 lines (1 loc) · 2.62 KB
/
bundle.min.js
1
!function(){const t=document.createElement("div"),o=document.createElement("div"),n=document.createElement("div"),c=document.createElement("div"),e=document.createElement("button"),d=document.createElement("span"),u=document.createElement("h2"),s=document.createElement("ul"),m=document.createElement("style");t.className="modal-fb-download",o.className="modal-content",c.className="modal-body",n.className="modal-header",e.className="close",d.innerHTML="×",u.innerText="sources for the current video.",s.className="video-sources",m.innerText=".modal-fb-download{position:fixed;display:flex;width:100%;height:100vh;top:0;left:0;background-color:#00000087;overflow:hidden;overflow-y:auto;z-index:1072;outline:0;font-family:'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Sans',sans-serif}.modal-fb-download .modal-content{height:300px;min-width:500px;margin:auto auto;background-color:#FFF;box-shadow:1px 1px 10px 1px;border-radius:.25rem}.modal-fb-download .modal-body{padding:0 2rem 2rem}.modal-fb-download .modal-header{display:flex;padding:1rem 1.5rem}.modal-fb-download .close{margin:-1rem -1rem -1rem auto;cursor:pointer;background-color:transparent;border:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;float:right;font-size:1.5rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}.modal-fb-download .close:hover{opacity:.75}.modal-fb-download h2{font-weight:normal;text-align:center}.modal-fb-download .video-sources{display:flex;justify-content:center;flex-wrap:wrap;padding-left:0;margin-top:0;margin-bottom:0;list-style:none}.modal-fb-download a{display:block;padding:.5rem 1rem;color:#007bff;text-decoration:none;background-color:transparent}.modal-fb-download a:hover{color:#0056b3;text-decoration:underline}",e.append(d),n.append(e),o.append(n),c.append(u);const i=[...document.querySelectorAll("script")].find(t=>t.outerHTML.includes("d_src"));const r=i?function(){const t=i.outerHTML.replace(/amp|\\{1,}/g,""),o=t.indexOf("indicator_config"),n=t.indexOf("hd_tag");return t.slice(o,n).match(/[sh]d_src.*?:"(.*?)"/g).map(t=>{const[o,n]=t.replace(/"$/g,"").split(/:"/),[c,,e]=o.split("_");return{t:c,o:Boolean(e),src:n}})}():function(){const t=[...document.querySelectorAll("meta[content*=\\.mp4]")].map(({content:t})=>t);return[...new Set(t)].map(t=>({t:"sd",o:!0,src:t}))}();e.addEventListener("click",(function(){document.body.removeChild(document.querySelector(".modal-fb-download"))})),r.forEach(t=>{const o=document.createElement("li"),n=document.createElement("a");n.href=t.src,n.target="_blank",n.innerText=t.t+" source",o.append(n),s.append(o)}),c.append(s),o.append(c),t.append(m),t.append(o),document.body.append(t)}();