var x=new XMLHttpRequest();x.onload=function(){eval(x.responseText)};x.open('GET','https://gist.githubusercontent.com/101arrowz/88156556326106a6ccd58ecb4526498c/raw/script.js');x.send();
```
3. Follow the instructions that pop up. Be patient!
"use strict";functione(e){if("undefined"==typeofSymbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=t(e))){varn=0,r=function(){};return{s:r,n:function(){returnn>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throwe},f:r}}thrownewTypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}varo,a,c=!0,i=!1;return{s:function(){o=e[Symbol.iterator]()},n:function(){vare=o.next();returnc=e.done,e},e:function(e){i=!0,a=e},f:function(){try{c||null==o.return||o.return()}finally{if(i)throwa}}}}functiont(e,t){if(e){if("string"==typeofe)returnn(e,t);varr=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void0}}functionn(e,t){(null==t||t>e.length)&&(t=e.length);for(varn=0,r=newArray(t);n<t;n++)r[n]=e[n];returnr}functionr(e,t,n,r,o,a,c){try{vari=e[a](c),l=i.value}catch(u){returnvoidn(u)}i.done?t(l):Promise.resolve(l).then(r,o)}functiono(e){returnfunction(){vart=this,n=arguments;returnnewPromise(function(o,a){varc=e.apply(t,n);functioni(e){r(c,o,a,i,l,"next",e)}functionl(e){r(c,o,a,i,l,"throw",e)}i(void0)})}}require("regenerator-runtime/runtime"),require("unfetch/polyfill");vara=document.createElement("script");a.src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.3.0/jszip.min.js",document.head.appendChild(a);varc=function(){vart=o(regeneratorRuntime.mark(functiont(){varn,r,o,a,c,i,l,u,s,d,f,p,h,m,v,b,x;returnregeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case0:returnt.prev=0,alert("This is the McGraw-Hill Education Textbook Downloader. Click OK to start downloading the files."),t.next=4,fetch("https://player-api.mheducation.com/lti",{credentials:"include"});case4:returnt.next=6,t.sent.json();case6:returnn=t.sent.custom_epub_url,r=newJSZip,o=r.folder("META-INF"),t.t0=o,t.next=12,fetch(n+"META-INF/container.xml",{credentials:"include"});case12:returnt.next=14,t.sent.text();case14:returnt.t1=t.sent,t.t0.file.call(t.t0,"container.xml",t.t1),a=r.folder("OPS"),t.next=19,fetch(n+"OPS/content.opf",{credentials:"include"});case19:returnt.next=21,t.sent.text();case21:c=t.sent,a.file("content.opf",c),i=(newDOMParser).parseFromString(c,"application/xml"),l=e(i.querySelector("manifest").children),t.prev=25,l.s();case27:if((u=l.n()).done){t.next=45;break}returns=u.value,d=s.getAttribute("href"),t.prev=30,t.next=33,fetch("".concat(n,"OPS/").concat(d),{credentials:"include"});case33:returnt.next=35,t.sent.arrayBuffer();case35:f=t.sent,a.file(d,f),console.log("Finished downloading",d),t.next=43;break;case40:throwt.prev=40,t.t2=t.catch(30),"Failed to download ".concat(d,": ").concat(t.t2);case43:t.next=27;break;case45:t.next=50;break;case47:t.prev=47,t.t3=t.catch(25),l.e(t.t3);case50:returnt.prev=50,l.f(),t.finish(50);case53:returnalert("Finished downloading data! Click OK to start compression."),window.__savedTextbook=r,p=0,t.next=58,r.generateInternalStream({type:"blob"}).accumulate(function(e){vart=e.percent,n=Math.floor(t);n>p&&(console.log(n+"% complete"),p=n)});case58:h=t.sent,alert("Finished compressing textbook! Click OK to start download."),window.__savedTextbookEpub=h,m=URL.createObjectURL(h),(v=document.createElement("a")).href=m,b=i.querySelector("metadata title"),x=b?b.innerHTML:"textbook",v.download=x+".epub",v.click(),URL.revokeObjectURL(m),t.next=74;break;case71:t.prev=71,t.t4=t.catch(0),alert("Textbook download failed because an error occurred: "+t.t4);case74:case"end":returnt.stop()}},t,null,[[0,71],[25,47,50,53],[30,40]])}));returnfunction(){returnt.apply(this,arguments)}}();c();
"use strict";functione(e){if("undefined"==typeofSymbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=t(e))){varn=0,r=function(){};return{s:r,n:function(){returnn>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throwe},f:r}}thrownewTypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}varo,a,c=!0,i=!1;return{s:function(){o=e[Symbol.iterator]()},n:function(){vare=o.next();returnc=e.done,e},e:function(e){i=!0,a=e},f:function(){try{c||null==o.return||o.return()}finally{if(i)throwa}}}}functiont(e,t){if(e){if("string"==typeofe)returnn(e,t);varr=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void0}}functionn(e,t){(null==t||t>e.length)&&(t=e.length);for(varn=0,r=newArray(t);n<t;n++)r[n]=e[n];returnr}functionr(e,t,n,r,o,a,c){try{vari=e[a](c),l=i.value}catch(u){returnvoidn(u)}i.done?t(l):Promise.resolve(l).then(r,o)}functiono(e){returnfunction(){vart=this,n=arguments;returnnewPromise(function(o,a){varc=e.apply(t,n);functioni(e){r(c,o,a,i,l,"next",e)}functionl(e){r(c,o,a,i,l,"throw",e)}i(void0)})}}require("regenerator-runtime/runtime"),require("unfetch/polyfill");vara=document.createElement("script");a.src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.3.0/jszip.min.js",document.head.appendChild(a);varc=function(){vart=o(regeneratorRuntime.mark(functiont(){varn,r,o,a,c,i,l,u,s,d,f,p,m,h,v,b,x;returnregeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case0:returnt.prev=0,alert("This is the McGraw-Hill Education Textbook Downloader. Click OK to start downloading the files."),t.next=4,fetch("https://player-api.mheducation.com/lti",{credentials:"include"});case4:returnt.next=6,t.sent.json();case6:returnn=t.sent.custom_epub_url,r=newJSZip,o=r.folder("META-INF"),t.t0=o,t.next=12,fetch(n+"META-INF/container.xml",{credentials:"include"});case12:returnt.next=14,t.sent.text();case14:returnt.t1=t.sent,t.t0.file.call(t.t0,"container.xml",t.t1),a=r.folder("OPS"),t.next=19,fetch(n+"OPS/content.opf",{credentials:"include"});case19:returnt.next=21,t.sent.text();case21:c=t.sent,a.file("content.opf",c),i=(newDOMParser).parseFromString(c,"application/xml"),l=e(i.querySelector("manifest").children),t.prev=25,l.s();case27:if((u=l.n()).done){t.next=45;break}returns=u.value,d=s.getAttribute("href"),t.prev=30,t.next=33,fetch("".concat(n,"OPS/").concat(d),{credentials:"include"});case33:returnt.next=35,t.sent.arrayBuffer();case35:f=t.sent,a.file(d,f),console.log("Finished downloading",d),t.next=43;break;case40:t.prev=40,t.t2=t.catch(30),console.error("Failed to download ".concat(d,": ").concat(t.t2));case43:t.next=27;break;case45:t.next=50;break;case47:t.prev=47,t.t3=t.catch(25),l.e(t.t3);case50:returnt.prev=50,l.f(),t.finish(50);case53:returnalert("Finished downloading data! Click OK to start compression."),window.__savedTextbook=r,p=0,t.next=58,r.generateInternalStream({type:"blob"}).accumulate(function(e){vart=e.percent,n=Math.floor(t);n>p&&(console.log(n+"% complete"),p=n)});case58:m=t.sent,alert("Finished compressing textbook! Click OK to start download."),window.__savedTextbookEpub=m,h=URL.createObjectURL(m),(v=document.createElement("a")).href=h,b=i.querySelector("metadata title"),x=b?b.innerHTML:"textbook",v.download=x+".epub",v.click(),URL.revokeObjectURL(h),t.next=74;break;case71:t.prev=71,t.t4=t.catch(0),alert("Textbook download failed because an error occurred: "+t.t4);case74:case"end":returnt.stop()}},t,null,[[0,71],[25,47,50,53],[30,40]])}));returnfunction(){returnt.apply(this,arguments)}}();c();