diff --git a/README.md b/README.md index 5e94425..a4d4a26 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# [instantgram] v10.0.3 -![GitHub release](https://img.shields.io/badge/release-v10.0.3-green) +# [instantgram] v10.0.4 +![GitHub release](https://img.shields.io/badge/release-v10.0.4-green) ![badge](https://img.shields.io/badge/for-instagram-yellow.svg?style=flat-square) [![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](http://standardjs.com/) @@ -39,6 +39,7 @@ With this version we support all modern browsers that have ECMAScript 2015 (es6) Read [CONTRIBUTING.md](CONTRIBUTING.md) for more information. :heart: ## Changelog +- v10.0.4 - [instangram] Fix reels not working. - v10.0.3 - [instangram] Fix profile page downloading/compression calculation. - v10.0.2 - [instangram] Complete rewrite of the Project to support Firefox again. \ By rewriting, we were also able to increase the speed noticeably. \ diff --git a/dist/main.js b/dist/main.js index 5e1aa2e..77735a4 100644 --- a/dist/main.js +++ b/dist/main.js @@ -1 +1 @@ -(()=>{"use strict";function e(e){return new Promise((function(t){setTimeout(t,e)}))}class t{constructor(e){if(this.modal=null,this.imageURL=e?.imageURL||"",this.heading=e?.heading||[""],this.headingStyle=e?.headingStyle||"",this.content=e?.content||[""],this.contentStyle=e?.contentStyle||"",this.buttonList=e?.buttonList||[],null==document.getElementById("instantgram-modal")){var t=document.createElement("style");t.id="instantgram-modal",t.innerHTML='.instantgram-modal-overlay{display:none!important;opacity:0!important;transition:all ease .1s!important;position:fixed!important;top:0!important;left:0!important;right:0!important;bottom:0!important;z-index:1000!important;background:rgba(0,0,0,.65)!important;justify-content:center!important;align-items:center!important}.instantgram-modal{transition:width ease-in-out .1s!important;display:inline-block!important;width:400px!important;padding:1.6px!important;z-index:1001!important}.instantgram-modal select{margin-left:.8px!important;border:solid 1px #dbdbdb!important;border-radius:3px!important;color:#262626!important;outline:0!important;padding:3px!important;text-align:center!important}@media (min-width:736px){.instantgram-modal{width:500px!important}}.instantgram-modal-content{position:relative;display:flex;flex-direction:column;width:100%!important;pointer-events:auto!important;background-clip:padding-box!important;outline:0!important}.instantgram-modal-header{color:#fff!important;background-color:#fd1d1d!important;background-image:linear-gradient(45deg,#405de6,#5851db,#833ab4,#c13584,#e1306c,#fd1d1d)!important;border-top-left-radius:12px!important;border-top-right-radius:12px!important;padding:0 16px 0 16px!important}.instantgram-modal-header h5{color:#fff!important;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif!important;font-size:16px!important;margin:revert!important}.instantgram-modal-header h5:nth-child(2){margin-top:-15px!important;margin-bottom:20px!important}.instantgram-modal-body{background:#fff!important;position:relative!important;-webkit-box-flex:1!important;-ms-flex:1 1 auto!important;flex:1 1 auto!important;padding:16px!important}.instantgram-modal-body p{display:block!important;margin:revert!important;margin-block-start:1em!important;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif!important;font-size:16px!important}.instantgram-modal-footer{background-color:#fff!important;border-top:1px solid #dbdbdb!important;border-left:0!important;border-right:0!important;border-bottom-left-radius:12px!important;border-bottom-right-radius:12px!important;line-height:1.5!important;min-height:48px!important;padding:4px 8px!important;user-select:none!important;display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important;-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:center!important}.instantgram-modal-footer button{width:100%!important;min-height:39px!important;background-color:transparent!important;border:0!important;outline:0!important;cursor:pointer!important;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif!important;font-size:16px!important}.instantgram-modal-footer button.active{color:#0095e2!important}.instantgram-modal-show{opacity:1!important}.instantgram-modal-visible{display:flex!important}#instantgram-bulk-download-indicator{text-align:center!important}',document.head.appendChild(t)}}get element(){return this.modal}createModal(){const e=document.createElement("div");e.classList.add("instantgram-modal-overlay");const t=document.createElement("div");t.classList.add("instantgram-modal"),e.appendChild(t);const o=document.createElement("div");o.classList.add("instantgram-modal-content"),t.appendChild(o);const n=document.createElement("div");n.classList.add("instantgram-modal-header"),this.headingStyle.length>0&&n.setAttribute("style",this.headingStyle),o.appendChild(n),this.heading.forEach((e=>{if("string"!=typeof e||/<\/?[a-z][\s\S]*>/i.test(e))if(/<\/?[a-z][\s\S]*>/i.test(e)){let t,o=document.createElement("div"),a=document.createDocumentFragment();for(o.innerHTML=e;t=o.firstChild;)a.appendChild(t);n.appendChild(a)}else n.appendChild(e);else{const t=document.createElement("h5");t.innerHTML=e,n.appendChild(t)}}));const a=document.createElement("div");if(a.classList.add("instantgram-modal-body"),this.contentStyle.length>0&&a.setAttribute("style",this.contentStyle),o.appendChild(a),this.imageURL.length>0){const e=document.createElement("div");o.appendChild(e);const t=document.createElement("img");t.setAttribute("height","76px"),t.setAttribute("width","76px"),t.style.margin="auto",t.style.paddingBottom="20px",t.setAttribute("src",this.imageURL),e.appendChild(t)}if(this.content.forEach((e=>{if("string"!=typeof e||/<\/?[a-z][\s\S]*>/i.test(e))if(/<\/?[a-z][\s\S]*>/i.test(e)){let t,o=document.createElement("div"),n=document.createDocumentFragment();for(o.innerHTML=e;t=o.firstChild;)n.appendChild(t);a.appendChild(n)}else a.appendChild(e);else{const t=document.createElement("p");t.innerText=e,a.appendChild(t)}})),this.buttonList.length>0){const e=document.createElement("div");e.classList.add("instantgram-modal-footer"),o.appendChild(e),this.buttonList.forEach((t=>{const o=document.createElement("button");o.classList.add("instantgram-modal-button"),o.innerText=t.text,t.active&&o.classList.add("active"),o.onclick=t?.callback?t.callback:this.close.bind(this),e.appendChild(o)}))}else o.style.paddingBottom="4px;";return e}async open(){this.modal&&await this.close(),this.modal=this.createModal(),document.body.appendChild(this.modal),this.modal.classList.add("instantgram-modal-visible"),setTimeout((()=>{this.modal.classList.add("instantgram-modal-show")}))}async close(){this.modal&&(this.modal.classList.remove("instantgram-modal-show"),await e(100),this.modal.classList.remove("instantgram-modal-visible"),this.modal.parentNode.removeChild(this.modal),this.modal=null)}}const o=e=>new Promise(((t,o)=>{const n=new Image;n.onload=()=>{const{naturalWidth:e,naturalHeight:o}=n;t({width:e,height:o})},n.onerror=()=>{o("There was some problem with the image.")},n.src=e}));function n(e){let t;t=null!==window&&void 0!==window?window:document.documentElement;const o=e.getBoundingClientRect();return o.bottom>0&&o.right>0&&o.left<(t.innerWidth||t.clientWidth)&&o.top<(t.innerHeight||t.clientHeight)}async function a(e){let t=await fetch(e);if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.text()}const i=async function(e,t,o,n){if(Object.keys(e).length>0){const r=Object.keys(e).find((e=>e.includes("Instance")));if(void 0!==r){const l=e[r];if(void 0!==l){const r=l.return.memoizedProps.fallbackSrc;if(void 0!==r)n(r.length>0&&r);else{let r=null!=o;if(!r){let t=/poster\=\"([\s\S]*)\" preload/gm.exec(e.outerHTML.replace(/(\r\n|\n|\r)/gm,"")),o=null;if(t){let e=document.createElement("textarea");e.innerHTML=t[1],o=e.firstChild.nodeValue}var i=o.split("/").pop().split("#")[0].split("?")[0]}let l=null,d=t.querySelectorAll("header > div > div > div > span > a")[0].href,s=await a(d);if(s){let e;s=s.replace(/(\r\n|\n|\r)/gm,"");let t=/profilePage_([0-9]+)/gm;for(;null!==(e=t.exec(s));)e.index===t.lastIndex&&t.lastIndex++,e.forEach((e=>{l=e}))}let c=null;if(l){let e=await a('https://www.instagram.com/graphql/query/?query_hash=003056d32c2554def87228bc3fd9668a&variables={"id":'+l+',"first":100}');if(e){let t=JSON.parse(e);for(let e=0;e
https://www.instagram.com/p/CIGrv1VMBkS/
',"index#program#blob@alert_cannotDownload":"An error has occurred!

Unfortunately we could not download the video try another one.","index#program#profilePageDownload@str_analyzed_from_to":"Analyzed ${data.size} Posts.","index#program#profilePageDownload@is_private_modal_title":"Profile private","index#program#profilePageDownload@is_private_modal_content":"Sorry but this profile is private and can not be downloaded.
Try another profile.","index#program#profilePageDownload@is_private_modal_btn":"Close","index#program#profilePageDownload@stop_collecting_modal_title":"Download started","index#program#profilePageDownload@stop_collecting_modal_content_1":"You can stop the download by clicking the stop button. If you stop the download, all the images already captured will be downloaded.","index#program#profilePageDownload@stop_collecting_modal_content_2":"If you try to download a lot of pictures at once Instagram may block your IP or your account temporarily.","index#program#profilePageDownload@stop_collecting_modal_btn":"Stop Download","index#program#profilePageDownload@collect_media_modal_title":"Please Wait","index#program#profilePageDownload@collect_media_modal_content":"Now images/videos will being collected","index#program#profilePageDownload@collect_media_modal_content_download_indicator":"Collected ${this.resolvedContent} of ${postLinks.size} Posts.","index#program#profilePageDownload@collect_media_modal_btn":"Stop collecting and start the download","index#program#profilePageDownload@collection_complete_modal_title":"Media collection complete","index#program#profilePageDownload@collection_complete_modal_content_1":"Please wait.","index#program#profilePageDownload@collection_complete_modal_content_2":"The download will be now generated.","index#program#profilePageDownload@collection_complete_modal_btn":"Close","index#program#profilePageDownload@cannot_download":"Profile could not be downloaded.","index#program#profilePageDownload@download_progress_at":"Download progress at","index#program#profilePageDownload@compression_progress_at":"Compression progress at","index#program#profilePageDownload@download_failed":"Download failed","modules.modal@isLoading":"Trying to load","modules.update@consoleWarnOutdatedInfo":"[instantgram] is outdated. Please check http://thinkbig-company.github.io/instantgram for available updates.","modules.update@consoleWarnOutdatedInfoVersions":"[instantgram] Installed version: ${data.version} | New update: ${data.onlineVersion}","modules.update@determineIfGetUpdateIsNecessary_contacting":"[instantgram] is looking for available updates...","modules.update@determineIfGetUpdateIsNecessary_updated":"[instantgram] updated your current version.","modules.update@determineIfGetUpdateIsNecessary_@update_available":"There is a new update available","modules.update@determineIfGetUpdateIsNecessary_@load_update":"Get update"},"es-AR":{"helpers.localize_defaultlang":"[instantgram] establecer idioma: ${LANG_DEFAULT} \n Para más información sobre los idiomas disponibles, consulte http://thinkbig-company.github.io/instantgram","index@alert_onlyWorks":"Sólo funciona en instagram.com","index#program@alert_dontFound":'¿Has abierto algún post de Instagram? Como por ejemplo
https://www.instagram.com/p/CIGrv1VMBkS/
',"index#program#blob@alert_cannotDownload":"Se ha producido un error.

Desgraciadamente no hemos podido descargar el vídeo, inténtalo con otro.","index#program#profilePageDownload@str_analyzed_from_to":"Había ${data.size} se analizaron los puestos.","index#program#profilePageDownload@is_private_modal_title":"Profile private","index#program#profilePageDownload@is_private_modal_content":"Sorry but this profile is private and can not be downloaded.
Try another profile.","index#program#profilePageDownload@is_private_modal_btn":"Close","index#program#profilePageDownload@stop_collecting_modal_title":"Descarga iniciada","index#program#profilePageDownload@stop_collecting_modal_content_1":'Puede detener la descarga haciendo clic en el botón "Detener la descarga". Cuando se detenga la descarga, se descargarán todas las imágenes que ya se hayan capturado.',"index#program#profilePageDownload@stop_collecting_modal_content_2":"Si intentas descargar muchas imágenes a la vez, Instagram puede bloquear temporalmente tu IP o tu cuenta.","index#program#profilePageDownload@stop_collecting_modal_btn":"Detener la descarga","index#program#profilePageDownload@collect_media_modal_title":"Espere, por favor","index#program#profilePageDownload@collect_media_modal_content":"Ahora se recogen las imágenes/vídeos","index#program#profilePageDownload@collect_media_modal_content_download_indicator":"Un total de ${this.resolvedContent} de ${postLinks.size} Puestos recogidos.","index#program#profilePageDownload@collect_media_modal_btn":"Deja de coleccionar y empieza a descargar","index#program#profilePageDownload@collection_complete_modal_title":"Colección de fotos/vídeos completa","index#program#profilePageDownload@collection_complete_modal_content_1":"Por favor, espere.","index#program#profilePageDownload@collection_complete_modal_content_2":"La descarga se genera ahora.","index#program#profilePageDownload@collection_complete_modal_btn":"Cerrar","index#program#profilePageDownload@cannot_download":"No se ha podido descargar el perfil.","modules.modal@isLoading":"Intentando cargar","modules.update@consoleWarnOutdatedInfo":"[instantgram] es obsoleto. Consulte en http://thinkbig-company.github.io/instantgram las actualizaciones disponibles.","modules.update@consoleWarnOutdatedInfoVersions":"[instantgram] Versión instalada: ${data.version} | Nueva actualización: ${data.onlineVersion}","modules.update@determineIfGetUpdateIsNecessary_contacting":"[instantgram] está buscando actualizaciones disponibles...","modules.update@determineIfGetUpdateIsNecessary_updated":"[instantgram] ha actualizado su versión actual.","modules.update@determineIfGetUpdateIsNecessary_@update_available":"Hay una nueva actualización disponible","modules.update@determineIfGetUpdateIsNecessary_@load_update":"Obtener información"},"de-DE":{"helpers.localize_defaultlang":"Ausgewählte Sprache: ${LANG_DEFAULT} \n Weitere Informationen zu den unterstützten Sprachen findest du auf http://thinkbig-company.github.io/instantgram","index@alert_onlyWorks":"Funktioniert nur auf instagram.com","index#program@alert_dontFound":'Hast du einen Instagram Post geöffnet? Zum Beispiel
https://www.instagram.com/p/CIGrv1VMBkS/
',"index#program#blob@alert_cannotDownload":"Es ist ein fehler aufgetreten!

Wir konnten das Video leider nicht Downloaden versuchen Sie ein anderes.","index#program#profilePageDownload@str_analyzed_from_to":"Es wurden ${data.size} Beiträge analysiert.","index#program#profilePageDownload@is_private_modal_title":"Profil ist Privat","index#program#profilePageDownload@is_private_modal_content":"Sorry, aber dieses Profil ist privat und kann nicht heruntergeladen werden.
Versuchen Sie ein anderes Profil.","index#program#profilePageDownload@is_private_modal_btn":"Schließen","index#program#profilePageDownload@stop_collecting_modal_title":"Download gestarted","index#program#profilePageDownload@stop_collecting_modal_content_1":'Sie können den Download stoppen, indem Sie auf die Schaltfläche "Download stoppen" klicken. Wenn Sie das Herunterladen anhalten, werden alle bereits aufgenommenen Bilder heruntergeladen.',"index#program#profilePageDownload@stop_collecting_modal_content_2":"Wenn Sie versuchen, viele Bilder auf einmal herunterzuladen, kann Instagram Ihre IP oder Ihr Konto vorübergehend sperren.","index#program#profilePageDownload@stop_collecting_modal_btn":"Download stoppen","index#program#profilePageDownload@collect_media_modal_title":"Bitte warten","index#program#profilePageDownload@collect_media_modal_content":"Bilder/Videos werden jetzt gesammelt","index#program#profilePageDownload@collect_media_modal_content_download_indicator":"Insgesamt ${this.resolvedContent} von ${postLinks.size} Beiträgen gesammelt.","index#program#profilePageDownload@collect_media_modal_btn":"Stoppen Sie das Sammeln und starten Sie den Download","index#program#profilePageDownload@collection_complete_modal_title":"Bilder/Video-Sammlung komplett","index#program#profilePageDownload@collection_complete_modal_content_1":"Bitte warten.","index#program#profilePageDownload@collection_complete_modal_content_2":"Der Download wird nun erzeugt.","index#program#profilePageDownload@collection_complete_modal_btn":"Schließen","index#program#profilePageDownload@cannot_download":"Profil konnte nicht runtergeladen werden.","index#program#profilePageDownload@download_progress_at":"Download-Fortschritt bei","index#program#profilePageDownload@compression_progress_at":"Komprimierungs-Fortschritt bei","index#program#profilePageDownload@download_failed":"Download fehlgeschlagen","modules.modal@isLoading":"Wird versucht zu laden","modules.update@consoleWarnOutdatedInfo":"[instantgram] ist veraltet. Bitte besuche die Seite http://thinkbig-company.github.io/instantgram für ein Update.","modules.update@consoleWarnOutdatedInfoVersions":"[instantgram] Installierte Version: ${data.version} | Neue Version: ${data.onlineVersion}","modules.update@determineIfGetUpdateIsNecessary_contacting":"[instantgram] sucht nach neuen verfügbaren Updates...","modules.update@determineIfGetUpdateIsNecessary_updated":"[instantgram] wurde aktualisiert.","modules.update@determineIfGetUpdateIsNecessary_@update_available":"Es ist ein neues Update verfügbar","modules.update@determineIfGetUpdateIsNecessary_@load_update":"Update laden"},"pt-BR":{"helpers.localize_defaultlang":"[instantgram] idioma configurado: ${LANG_DEFAULT} \npara mais informações sobre os idiomas suportados, acesse http://thinkbig-company.github.io/instantgram","index@alert_onlyWorks":"[instantgram] somente funciona no instagram.com","index#program@alert_dontFound":'ops, você está em algum post do instagram? ex:
https://www.instagram.com/p/CIGrv1VMBkS/
',"index#program#blob@alert_cannotDownload":"Ocorreu um erro!

Não pudemos baixar o vídeo infelizmente tentar outro.","index#program#profilePageDownload@str_analyzed_from_to":"Analyzed ${data.size} Posts.","index#program#profilePageDownload@is_private_modal_title":"Profile private","index#program#profilePageDownload@is_private_modal_content":"Sorry but this profile is private and can not be downloaded.
Try another profile.","index#program#profilePageDownload@is_private_modal_btn":"Close","index#program#profilePageDownload@stop_collecting_modal_title":"Início do download","index#program#profilePageDownload@stop_collecting_modal_content_1":"Você pode interromper o download clicando no botão de parada. Se você interromper o download, todas as imagens já capturadas serão baixadas.","index#program#profilePageDownload@stop_collecting_modal_content_2":"Se você tentar baixar muitas imagens de uma vez, a Instagram poderá bloquear temporariamente seu IP ou sua conta.","index#program#profilePageDownload@stop_collecting_modal_btn":"Parar Download","index#program#profilePageDownload@collect_media_modal_title":"Por favor, aguarde","index#program#profilePageDownload@collect_media_modal_content":"Agora imagens/videos serão coletados","index#program#profilePageDownload@collect_media_modal_content_download_indicator":"Recolhido ${este.resolvedContent} de ${postLinks.size} Correios.","index#program#profilePageDownload@collect_media_modal_btn":"Pare de coletar e inicie o download","index#program#profilePageDownload@collection_complete_modal_title":"Coleção de mídia completa","index#program#profilePageDownload@collection_complete_modal_content_1":"Por favor, aguarde.","index#program#profilePageDownload@collection_complete_modal_content_2":"O download será agora gerado.","index#program#profilePageDownload@collection_complete_modal_btn":"Fechar","index#program#profilePageDownload@cannot_download":"O perfil não pôde ser baixado.","modules.modal@isLoading":"Tentando carregar","modules.update@consoleWarnOutdatedInfo":"[instantgram] está desatualizado. Acesse http://thinkbig-company.github.io/instantgram para atualizar","modules.update@consoleWarnOutdatedInfoVersions":"[instantgram] versão local: ${data.version} | nova versão: ${data.onlineVersion}","modules.update@determineIfGetUpdateIsNecessary_contacting":"[instantgram] está procurando atualizações...","modules.update@determineIfGetUpdateIsNecessary_updated":"[instantgram] informações locais atualizadas","modules.update@determineIfGetUpdateIsNecessary_@update_available":"Há uma nova atualização disponível","modules.update@determineIfGetUpdateIsNecessary_@load_update":"Carga de actualização"}}};let l=navigator.language;-1!==l.indexOf("-")&&(l=l.split("-")[0]),-1!==l.indexOf("_")&&(l=l.split("_")[0]);const d={de:"de-DE",en:"en-US",es:"es-AR",pt:"pt-BR"}[l];function s(e,t=d){try{return r.langs.hasOwnProperty(t)||(t="en-US"),r.langs[t][e]?r.langs[t][e]:""}catch(o){return console.error("[instantgram]LOC error:",o),`ops, an error ocurred in localization system. Enter in https://github.com/ThinkBIG-Company/instantgram/issues/new and open an issue with this code: 'LOC_dont_found_str_neither_default:[${t}->${e}]'\n for more information open the console`}}console.info(s("helpers.localize_defaultlang").replace("${LANG_DEFAULT}",d));const c=s;var m;!function(e){e.Image="IMAGE",e.Video="VIDEO",e[void 0]="UNDEFINED"}(m||(m={}));class p{constructor(){this.modal=new t}getName(){return"MediaScanner"}async execute(e,t){let a=!1;try{let l,d,s=!1,p=!1,g=null,u=m.undefined,f=null,h=null,_=0,w=!1,y=document.querySelector("main");if(e.regexProfilePath.test(e.path))return a=!1,e.foundImage=!1,e.foundVideo=!1,e.foundByModule=void 0,void t(a,e);if(e.regexStoriesURI.test(e.path)){y=document.getElementById("react-root");let e=y.querySelectorAll("section > div > div > div");for(let t=0;t=1&&e[t].classList.length>1){let o=null!==e[t].querySelector("video"),n=null!==e[t].querySelector("div > div img[src]")||null!==e[t].querySelector("div > div img[srcset]");o&&n?(u=m.Video,g=e[t].querySelector("video")):n&&(u=m.Image,null!==e[t].querySelectorAll("img")[0]&&(g=e[t].querySelectorAll("img")[0]));break}}}if(null==g){if(s=document.querySelectorAll('[role="dialog"]').length>0,s){if(h=document.getElementsByTagName("article"),null!=h)for(_=0;_=4);_++);p=null!==document.querySelector("article div > div > div > div > button._6CZji")||null!==document.querySelector("article div > div > div > div > button.POSa_")}else if(e.regexRootPath.test(e.path)){y=document.querySelector("main > section"),d=y.querySelectorAll("div > div > div > article");let e=0;for(e=0;e .coreSpriteLeftChevron")||null!==d[e].querySelector("button > .coreSpriteRightChevron");break}}else p=null!==document.querySelector("main div > div > article div > div > div > div > button._6CZji")||null!==document.querySelector("main div > div > article div > div > div > div > button.POSa_");if(p){let t;d=document.getElementsByTagName("article")[_];let o=0;if(e.regexRootPath.test(e.path)){for(y=document.querySelector("main > section"),d=y.querySelectorAll("div > div > div > article"),o=0;o div > div > div > div > div > div > ul:first-child > li")).filter((e=>null!=e.firstChild&&e.classList.length>0))}else t=Array.from(d.querySelectorAll("div > div > div > div > div > div > div > ul:first-child > li")).filter((e=>null!=e.firstChild&&e.classList.length>0));if(null!=t&&t.length>0){let n;g=null,f=null,n=e.regexRootPath.test(e.path)?Array.from(d[o].children[2].querySelector("div > div").children[1].children):Array.from(d.children[2].querySelector("div > div").children[1].children);for(let e=0;e1&&(l=e),l==n.length-1){w=!0;break}for(let e=0;e6&&4==l?t[1]:n.length>6&&5==l||n.length>6&&6==l?t[2]:n.length>6&&7==l?t[1]:n.length>6&&8==l?t[2]:t[l-1]),null!=g){let e=null!==g.querySelector("video"),t=null!==g.querySelector("img[src]")||null!==g.querySelector("img[srcset]");if(e){u=m.Video,g=g.querySelector("video");break}if(t){u=m.Image,g=null!==g.querySelector("img[srcset]")?g.querySelector("img[srcset]"):g.querySelector("img[src]");break}}}}else{let t;if(s){t=document.getElementsByTagName("article")[_];let e=null!==t.querySelector("video"),o=null!==t.querySelector("img[src]")||null!==t.querySelector("img[srcset]");e?(u=m.Video,g=t.querySelector("video")):o&&(u=m.Image,g=null!==t.querySelector("img[srcset]")?t.querySelector("img[srcset]"):t.querySelector("img[src]"))}else if(e.regexRootPath.test(e.path)?(y=document.querySelector("main > section"),t=y.querySelectorAll("div > div > div > article")):y&&(t=y.querySelectorAll("div > div > article")),t)for(var r=0;r div > div > div > video"),o=null!==t[r].querySelector("div > div > div > div > img[src]")||null!==t[r].querySelector("div > div > div > div > img[srcset]");e?(u=m.Video,g=t[r].querySelector("video")):o&&(u=m.Image,g=null!==t[r].querySelector("img[srcset]")?t[r].querySelector("img[srcset]"):t[r].querySelector("img[src]"))}}}switch(u){case m.Image:let n=await async function(e){if(e.getAttribute("srcset")){let t=[];if(e.getAttribute("srcset").split(",").forEach((e=>{t.push(e.trim().split(" "))})),e.hasAttribute("src")&&e.getAttribute("src").length>0){let o={};o[0]=e.getAttribute("src"),o[1]="undefined",t.unshift(o)}let n,a=0,i="";for(let e=0;ea&&(a=n,i=t[e][0])}return i.length>0&&i}return!!(e.hasAttribute("src")&&e.getAttribute("src").length>0)&&e.getAttribute("src")}(g);"string"==typeof n&&(f=n),null!=f&&f.length>10?(a=!0,e.foundImage=!0,e.foundVideo=!1,e.foundByModule=this.getName(),window.open(f),t(a,e)):(a=!1,e.foundImage=!1,e.foundVideo=!1,e.foundByModule=void 0,t(a,e));break;case m.Video:if(void 0===g.src||0==g.src.length?(g=g.querySelectorAll("source"),f=g[0].src):f=g.src,null!=f&&f.length>10)if(f=f.replace("amp;","&"),-1!==f.indexOf("blob:")){const o=this;a=!0,e.foundImage=!1,e.foundVideo=!0,e.foundByModule=o.getName(),this.modal.heading=[`
[instantgram] v${e.VERSION}
`],this.modal.content=['

Loading

',"

"+c("modules.modal@isLoading")+"

"],this.modal.open(),setTimeout((function(){i(g,d,l,(function(n){if(o.modal.close(),n){let o=n.replace(/^[^.]*/,"https://scontent");window.open(o),t(a,e)}else o.modal.heading=[`
[instantgram] v${e.VERSION}
`],o.modal.content=[c("index#program#blob@alert_cannotDownload")],o.modal.contentStyle="text-align:center",o.modal.buttonList=[{active:!0,text:c("index#program#blob@alert_cannotDownload")}],o.modal.open(),t(a,e)}))}),500)}else{a=!0,e.foundImage=!1,e.foundVideo=!0,e.foundByModule=this.getName();let o=f.replace(/^[^.]*/,"https://scontent");window.open(o),t(a,e)}else a=!1,e.foundImage=!1,e.foundVideo=!1,e.foundByModule=void 0,t(a,e);break;default:a=!1,e.foundImage=!1,e.foundVideo=!1,e.foundByModule=void 0,t(a,e)}}catch(o){console.error(this.getName()+"()",`[instantgram] ${e.VERSION}`,o),t(!1,e)}}}class g{static add(t,o="default",n=5e3){if(null==document.getElementById("instantgram-alert")){var a=document.createElement("style");a.id="instantgram-alert",a.innerHTML=".instantgram-alert-wrapper{position:fixed;bottom:4rem;left:calc(50% - 225px);width:calc(80vw - 1rem);z-index:2000;max-width:550px}.instantgram-alert{opacity:0;transition:opacity .2s;position:relative;margin-top:20px;padding:15px 29px 15px 15px;animation:fade-in .3s;border-radius:5px}.instantgram-alert.fade-in{opacity:1}.instantgram-alert.fade-out{opacity:0}.instantgram-alert-close{position:absolute;content:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' stroke='white' fill='white' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath stroke='white' d='M14.53 4.53l-1.06-1.06L9 7.94 4.53 3.47 3.47 4.53 7.94 9l-4.47 4.47 1.06 1.06L9 10.06l4.47 4.47 1.06-1.06L10.06 9z'/%3E%3C/svg%3E%0A\");cursor:pointer;right:5px;top:5px}.instantgram-alert-default{background-color:#0095f6;color:#fff}.instantgram-alert-warn{background-color:#f69500;color:#fff}.instantgram-alert-error{background-color:#f65a00;color:#fff}",document.head.appendChild(a)}const i=document.createElement("div");i.classList.add("instantgram-alert","instantgram-alert-"+o);const r=document.createElement("i");r.onclick=()=>g.remove(i),r.classList.add("instantgram-alert-close"),i.appendChild(r);const l=document.createElement("div");l.innerHTML=t,i.appendChild(l),g.wrapper.appendChild(i),g.animateIn(i),e(n).then((()=>g.remove(i)))}static animateIn(e){e.animate([{opacity:"0"},{opacity:"1"}],{duration:300,fill:"forwards"})}static addBaseToPage(){document.querySelectorAll(".instantgram-alert-wrapper").forEach((e=>e.remove()));const e=document.createElement("div");return e.classList.add("instantgram-alert-wrapper"),document.body.appendChild(e),e}static remove(e){e.animate([{opacity:"1"},{opacity:"0"}],{duration:300,fill:"forwards"}).finished.then((()=>{e.remove(),this.wrapper.remove()}))}}g.wrapper=g.addBaseToPage(),"stream"in Blob.prototype||Object.defineProperty(Blob.prototype,"stream",{value(){return new Response(this).body}}),"setBigUint64"in DataView.prototype||Object.defineProperty(DataView.prototype,"setBigUint64",{value(e,t,o){const n=Number(0xffffffffn&t),a=Number(t>>32n);this.setUint32(e+(o?0:4),n,o),this.setUint32(e+(o?4:0),a,o)}});var u=e=>new DataView(new ArrayBuffer(e)),f=e=>new Uint8Array(e.buffer||e),h=e=>Math.min(4294967295,Number(e)),_=e=>Math.min(65535,Number(e));function w(e,t,o){if(void 0===t||t instanceof Uint8Array||(t=b(t)),void 0===o||o instanceof Date||(o=new Date(o)),e instanceof File)return{i:t||b(e.name),o:o||new Date(e.lastModified),A:e.stream()};if(e instanceof Response){const n=e.headers.get("content-disposition"),a=n&&n.match(/;\s*filename\*?=["']?(.*?)["']?$/i),i=a&&a[1]||new URL(e.url).pathname.split("/").pop(),r=i&&decodeURIComponent(i);return{i:t||b(r),o:o||new Date(e.headers.get("Last-Modified")||Date.now()),A:e.body}}if(!t||0===t.length)throw new Error("The file must have a name.");if(void 0===o)o=new Date;else if(isNaN(o))throw new Error("Invalid modification date.");if("string"==typeof e)return{i:t,o,A:b(e)};if(e instanceof Blob)return{i:t,o,A:e.stream()};if(e instanceof Uint8Array||e instanceof ReadableStream)return{i:t,o,A:e};if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return{i:t,o,A:f(e)};if(Symbol.asyncIterator in e)return{i:t,o,A:y(e)};throw new TypeError("Unsupported input format.")}function y(e){const t="next"in e?e:e[Symbol.asyncIterator]();return new ReadableStream({async pull(e){let o=0;for(;e.desiredSize>o;){const n=await t.next();if(!n.value){e.close();break}{const t=v(n.value);e.enqueue(t),o+=t.byteLength}}}})}function v(e){return"string"==typeof e?b(e):e instanceof Uint8Array?e:f(e)}function b(e){return(new TextEncoder).encode(String(e))}var x=new WebAssembly.Instance(new WebAssembly.Module(Uint8Array.from(atob("AGFzbQEAAAABCgJgAABgAn9/AXwDAwIAAQUDAQACBw0DAW0CAAF0AAABYwABCpUBAkkBA38DQCABIQBBACECA0AgAEEBdiAAQQFxQaCG4u1+bHMhACACQQFqIgJBCEcNAAsgAUECdCAANgIAIAFBAWoiAUGAAkcNAAsLSQEBfyABQX9zIQFBgIAEIQJBgIAEIABqIQADQCABQf8BcSACLQAAc0ECdCgCACABQQh2cyEBIAJBAWoiAiAASQ0ACyABQX9zuAs"),(e=>e.charCodeAt(0))))),{t:I,c:S,m:D}=x.exports;I();var P=f(D).subarray(65536);function A(e,t=0){for(const o of function*(e){for(;e.length>65536;)yield e.subarray(0,65536),e=e.subarray(65536);e.length&&(yield e)}(e))P.set(o),t=S(o.length,t);return t}function k(e,t,o=0){const n=e.getSeconds()>>1|e.getMinutes()<<5|e.getHours()<<11,a=e.getDate()|e.getMonth()+1<<5|e.getFullYear()-1980<<9;t.setUint16(o,n,1),t.setUint16(o+2,a,1)}function C(e){const t=u(30);return t.setUint32(0,1347093252),t.setUint32(4,754976768),k(e.o,t,10),t.setUint16(26,e.i.length,1),f(t)}async function*U(e){let{A:t}=e;if("then"in t&&(t=await t),t instanceof Uint8Array)yield t,e.u=A(t,0),e.l=BigInt(t.length);else{e.l=0n;const o=t.getReader();for(;;){const{value:t,done:n}=await o.read();if(n)break;e.u=A(t,e.u),e.l+=BigInt(t.length),yield t}}}function L(e,t){const o=u(16+(t?8:0));return o.setUint32(0,1347094280),o.setUint32(4,e.u,1),t?(o.setBigUint64(8,e.l,1),o.setBigUint64(16,e.l,1)):(o.setUint32(8,h(e.l),1),o.setUint32(12,h(e.l),1)),f(o)}function B(e,t,o){const n=u(46);return n.setUint32(0,1347092738),n.setUint32(4,755182848),n.setUint16(8,2048),k(e.o,n,12),n.setUint32(16,e.u,1),n.setUint32(20,h(e.l),1),n.setUint32(24,h(e.l),1),n.setUint16(28,e.i.length,1),n.setUint16(30,o?28:0,1),n.setUint16(40,33204,1),n.setUint32(42,h(t),1),f(n)}function E(e,t){const o=u(28);return o.setUint16(0,1,1),o.setUint16(2,24,1),o.setBigUint64(4,e.l,1),o.setBigUint64(12,e.l,1),o.setBigUint64(20,t,1),f(o)}const z=function(){let e=document.getElementById("instantgram-bulk-downloader-download");e&&e.remove();let t=document.createElement("a");return t.id="instantgram-bulk-downloader-download",document.body.appendChild(t),t.setAttribute("style","display: none"),function(e,o){const n=window.URL.createObjectURL(e);t.href=n,t.download=o,t.click(),window.URL.revokeObjectURL(n)}}();async function N(e,t=null){const o=await V(e);return{mediaURL:q(o,t),accountName:(n=o,n.owner.username),timestamp:O(o),original:o};var n}const V=(M=async e=>(await(await fetch(`${e}?__a=1`)).json()).graphql.shortcode_media,(...e)=>{try{return M(...e)}catch(e){throw g.add("Looks like Instagram has figured out you are using a downloader.
The download may not work for the next time"),e}});var M;function q(e,t=null){let o;if("GraphImage"===e.__typename)o=[e.display_url];else if("GraphVideo"===e.__typename)o=[e.video_url];else if(-1===t)o=[e.display_url];else if(null===t){o=[];for(const t of Array(e.edge_sidecar_to_children.edges.length).keys())o.push(q(e,t)[0])}else o=q(e.edge_sidecar_to_children.edges[t].node);return o}function O(e){return e.taken_at_timestamp}async function $(e,t,o){let n=[],a=!1,i=[].concat.apply([],e).flatMap((e=>"number"==typeof e?[]:[e])),r=[];for(let t=0;t{const t=+e.fetchResponse.headers.get("Content-Length"),o=(new TextEncoder).encode(e.name).length;a+=t+o+92})),a+=22;const i=(e=>new Response(y(async function*(e){const t=[];let o=0n,n=0n,a=0;for await(const i of e){yield C(i),yield i.i,yield*U(i);const e=i.l>=0xffffffffn||o>=0xffffffffn;yield L(i,e),t.push(B(i,o,e)),t.push(i.i),e&&(t.push(E(i,o)),o+=8n),n++,o+=BigInt(46+i.i.length)+i.l,a||(a=e)}let i=0n;for(const e of t)yield e,i+=BigInt(e.length);if(a||o>=0xffffffffn){const e=u(76);e.setUint32(0,1347094022),e.setBigUint64(4,BigInt(44),1),e.setUint32(12,755182848),e.setBigUint64(24,n,1),e.setBigUint64(32,n,1),e.setBigUint64(40,i,1),e.setBigUint64(48,o,1),e.setUint32(56,1347094023),e.setBigUint64(64,o+i,1),e.setUint32(72,1,1),yield f(e)}const r=u(22);r.setUint32(0,1347093766),r.setUint16(8,_(n),1),r.setUint16(10,_(n),1),r.setUint32(12,h(i),1),r.setUint32(16,h(o),1),yield f(r)}(async function*(e){for await(const t of e)t instanceof File||t instanceof Response?yield w(t):yield w(t.input,t.name,t.lastModified)}(e))),{headers:{"Content-Type":"application/zip","Content-Disposition":"attachment"}}))(e).body.getReader();let r=0;const l=[];for(;;){const{done:e,value:t}=await i.read();if(e){n=!1;break}l.push(t),r+=t.length,o({percent:Number((r/a*100).toFixed()),isFirst:n,isLast:r/a*100==100,type:"compression",error:!1})}const d=new Blob(l);z(d,t?`${t}.zip`:"bulk_download.zip")}(n,t,o),a}function T(e){return e.split("?")[0].split("/").pop()}class R{constructor(){this.modal=new t,this.continueImageLoading=!0,this.resolvedContent=1,this.inProgress=!1,this.downloadIndicator=document.createElement("p"),this.downloadIndicator.id="instantgram-bulk-download-indicator",this.downloadIndicator.setAttribute("style","color:green;")}getName(){return"ProfilePageDownload"}atBottom(){return window.pageYOffset+window.innerHeight+100>document.body.scrollHeight}async collectImageLinks(t){this.showStopCollectingModal();const o=new Set;let n,a;this.continueImageLoading=!0,document.body.scrollTop=0,document.documentElement.scrollTop=0;do{this.collectPostLinks(o),scrollBy(0,window.innerHeight),await e(3/(2e3*t)),this.downloadIndicator.innerText=`${c("index#program#profilePageDownload@str_analyzed_from_to").replace("${data.size}",String(o.size))}`,n=document.querySelectorAll("section > main > div:first-child > div > article > div:nth-child(2) svg").length>0,a=0===document.querySelectorAll("._0mzm-.sqdOP.yWX7d").length}while(this.continueImageLoading&&n&&a||!this.atBottom()&&this.continueImageLoading);return this.collectPostLinks(o),o}showStopCollectingModal(){this.modal.heading=[`
[instantgram] ${c("index#program#profilePageDownload@stop_collecting_modal_title")}v${this.program.VERSION}
`],this.modal.content=[c("index#program#profilePageDownload@stop_collecting_modal_content_1"),c("index#program#profilePageDownload@stop_collecting_modal_content_2"),this.downloadIndicator],this.modal.contentStyle="text-align:center",this.modal.buttonList=[{text:c("index#program#profilePageDownload@stop_collecting_modal_btn"),active:!0,callback:()=>{this.continueImageLoading=!1}}],this.modal.open()}collectPostLinks(e){Array.from(document.querySelectorAll("section > main > div:first-child > div > article a")).forEach((t=>{const o="href"in t?t.href:t.firstChild?.href;var n;n=o,new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(n)&&e.add(o)}))}async collectMedia(t){return await e(3e3),this.modal.heading=[`
[instantgram] ${c("index#program#profilePageDownload@collect_media_modal_title")}v${this.program.VERSION}
`],this.modal.content=[c("index#program#profilePageDownload@collect_media_modal_content"),this.downloadIndicator],this.modal.contentStyle="text-align:center",this.modal.buttonList=[{active:!0,callback:()=>this.resolvedContent=Number.MAX_VALUE,text:c("index#program#profilePageDownload@collect_media_modal_btn")}],await this.modal.open(),this.downloadIndicator.innerText=c("index#program#profilePageDownload@collect_media_modal_content_download_indicator").replace("${this.resolvedContent}",String(this.resolvedContent)).replace("${postLinks.size}",String(t.size)),this.collectDownloadLinks(t)}async collectDownloadLinks(t){this.resolvedContent=1;const o=[];for(const n of t){const a=await N(n);if(await e(2500),o.push([...a.mediaURL,a.timestamp]),this.resolvedContent+=1,this.downloadIndicator.innerText=c("index#program#profilePageDownload@collect_media_modal_content_download_indicator").replace("${this.resolvedContent}",String(this.resolvedContent)).replace("${postLinks.size}",String(t.size)),this.resolvedContent>=t.size)break}return await this.modal.close(),o}displayEndModal(e,t){this.resolvedContent==Number.MAX_VALUE?this.downloadIndicator.innerText=c("index#program#profilePageDownload@collection_complete_modal_title").replace("${this.resolvedContent}",String(e.length)).replace("${postLinks.size}",String(t)):this.downloadIndicator.innerText="",this.modal.heading=[`
[instantgram] ${c("index#program#profilePageDownload@collection_complete_modal_title")}v${this.program.VERSION}
`],this.modal.content=[c("index#program#profilePageDownload@collection_complete_modal_content_1"),c("index#program#profilePageDownload@collection_complete_modal_content_2"),this.downloadIndicator],this.modal.contentStyle="text-align:center",this.modal.buttonList=[{active:!0,callback:()=>{this.cleanUp(),this.modal.close()},text:c("index#program#profilePageDownload@collection_complete_modal_btn")}],this.modal.open()}displayIsPrivateModal(){this.modal.heading=[`
[instantgram] ${c("index#program#profilePageDownload@is_private_modal_title")}v${this.program.VERSION}
`],this.modal.content=[c("index#program#profilePageDownload@is_private_modal_content")],this.modal.contentStyle="text-align:center",this.modal.buttonList=[{active:!0,callback:()=>{this.cleanUp(),this.modal.close()},text:c("index#program#profilePageDownload@is_private_modal_btn")}],this.modal.open()}getAccountName(e,t){let o;try{o=e.querySelector(t).innerText}catch{o="no_account_found"}return o}updateProgress(e){e.isFirst&&(this.inProgress=!0);const t=`${c("index#program#profilePageDownload@"+e.type+"_progress_at")} ${e.percent}%`;e.isLast&&(this.inProgress=!1,this.downloadIndicator.innerHTML=t),e.error&&(this.downloadIndicator.setAttribute("style","color:red;"),this.downloadIndicator.innerHTML=c("index#program#profilePageDownload@download_failed")),this.inProgress&&(this.downloadIndicator.innerHTML=t,e.error&&(this.downloadIndicator.setAttribute("style","color:red;"),this.downloadIndicator.innerText=c("index#program#profilePageDownload@download_failed")))}cleanUp(){let e=document.getElementById("instantgram-bulk-downloader");void 0!==e&&null!=e&&e.remove();let t=document.getElementById("instantgram-bulk-downloader-download");void 0!==t&&null!=t&&t.remove()}async execute(e,t){try{this.program=e;let o=document.getElementById("instantgram-bulk-downloader"),n=document.getElementsByClassName("instantgram-modal-overlay");if(o&&n)return;{let e=document.createElement("div");e.id="instantgram-bulk-downloader",document.body.appendChild(e)}if(2==document.querySelector("section > main > div:first-child > div > article > div:nth-child(1)").classList.length)return this.displayIsPrivateModal(),e.foundProfile=!1,void t(!1,e);e.foundProfile=!0,e.foundByModule=this.getName();const a=await this.collectImageLinks(parseInt("1",0)%3),i=await this.collectMedia(a);this.displayEndModal(i,a.size);let r=await $(i,this.getAccountName(document.body,"section > main > div:first-child > header > section > div:first-child > h2"),(async e=>{this.updateProgress(e)}));this.cleanUp(),this.modal.close(),0==r?(e.foundProfile=!0,e.foundByModule=this.getName(),t(!0,e)):(e.foundProfile=!1,e.foundByModule=void 0,t(!1,e))}catch(t){console.error(this.getName()+"()",`[instantgram] ${e.VERSION}`,t)}}}const G=function(){const e=/^(<|>|[=!<>]=)?\s*(\d+(?:\.\d+){0,2})([a-z][a-z0-9\-]*)?$/i;function t(t,o){let n=(t+"").match(e);return n?(o?n[1]||"==":"")+'"'+(n[2]+".0.0").match(/\d+(?:\.\d+){0,2}/)[0].replace(/(?:^|\.)(\d+)/g,(function(e,t){return Array(9-t.length).join("0")+t}))+(n[3]||"~")+'"':o?"==0":1}return function(e,...o){e=t(e,null);for(var n,a=1;n=arguments[a++];)if(!new Function("return "+e+t(n,1))())return!1;return!0}}();function F(e){console.warn(c("modules.update@consoleWarnOutdatedInfo")),console.warn(c("modules.update@consoleWarnOutdatedInfoVersions").replace("${data.version}",e.version).replace("${data.onlineVersion}",e.onlineVersion))}const H=async function(e){(function(e){var t=window.localStorage.getItem("instantgram");if("string"==typeof t){let o=JSON.parse(t);return window.localStorage.setItem("instantgram",JSON.stringify({version:e,onlineVersion:o.onlineVersion,lastVerification:o.lastVerification,dateExpiration:o.dateExpiration})),G(o.onlineVersion,"> "+o.version)&&F(o),Date.now()>o.dateExpiration}return!0})(e)&&(console.info(c("modules.update@determineIfGetUpdateIsNecessary_contacting")),await fetch("https://www.instagram.com/graphql/query/?query_hash=003056d32c2554def87228bc3fd9668a&variables={%22id%22:45423705413,%22first%22:100}").then((function(e){return e.json()})).then((function(o){let n=o.data.user.edge_owner_to_timeline_media.edges[0].node.edge_media_to_caption.edges[0].node.text,a=n.match(/(\*|\d+(\.\d+){0,2}(\.\*)?)+/gm)[0],i=new Date;if(i.setDate(i.getDate()+2),window.localStorage.setItem("instantgram",JSON.stringify({version:e,onlineVersion:a,lastVerification:Date.now(),dateExpiration:i.valueOf()})),console.info(c("modules.update@determineIfGetUpdateIsNecessary_updated")),G(a,"> "+e)){new t({heading:[`
[instantgram] v${e}
`],content:[`
Es ist ein neues Update verfügbar v${a}
`,"
","
","

Changelog

"+n.split("Changelog ")[1]+"
","
",""+c("modules.update@determineIfGetUpdateIsNecessary_@load_update")+"",""],buttonList:[{active:!0,text:"Ok"}]}).open(),F(JSON.parse(window.localStorage.getItem("instantgram")))}else console.info(window.localStorage.getItem("instantgram"))})).catch((e=>{console.error("Error:",e)})))};console.clear();const W={VERSION:"10.0.3",hostname:window.location.hostname,path:window.location.pathname,regexHostname:/instagram\.com/,regexRootPath:/^\/+$/,regexProfilePath:/^\/([A-Za-z0-9._]{2,3})+\/$/,regexPostPath:/^\/p\//,regexStoriesURI:/stories\/(.*)+/,foundByModule:null,foundVideo:!1,foundImage:!1,foundProfile:!1};W.regexHostname.test(W.hostname)?((new p).execute(W,(function(e,o){W.foundVideo=o.foundVideo,W.foundImage=o.foundImage,W.foundByModule=o.foundByModule,0==e&&o.regexProfilePath.test(o.path)&&(new R).execute(o,(function(e,o){W.foundVideo=o.foundVideo,W.foundImage=o.foundImage,W.foundByModule=o.foundByModule,0==e&&new t({heading:[`
[instantgram] v${o.VERSION}
`],content:[c("index#program#profilePageDownload@cannot_download")],contentStyle:"text-align:center",buttonList:[{active:!0,text:"Ok"}]}).open()})),null==W.foundByModule&&0==W.foundVideo&&0==W.foundImage&&new t({heading:[`
[instantgram] v${W.VERSION}
`],content:[c("index#program@alert_dontFound")],contentStyle:"text-align:center",buttonList:[{active:!0,text:"Ok"}]}).open()})),H(W.VERSION)):new t({heading:[`
[instantgram] v${W.VERSION}
`],content:[c("index@alert_onlyWorks")],contentStyle:"text-align:center",buttonList:[{active:!0,text:"Ok"}]}).open()})(); \ No newline at end of file +(()=>{"use strict";function e(e){return new Promise((function(t){setTimeout(t,e)}))}class t{constructor(e){if(this.modal=null,this.imageURL=e?.imageURL||"",this.heading=e?.heading||[""],this.headingStyle=e?.headingStyle||"",this.content=e?.content||[""],this.contentStyle=e?.contentStyle||"",this.buttonList=e?.buttonList||[],null==document.getElementById("instantgram-modal")){var t=document.createElement("style");t.id="instantgram-modal",t.innerHTML='.instantgram-modal-overlay{display:none!important;opacity:0!important;transition:all ease .1s!important;position:fixed!important;top:0!important;left:0!important;right:0!important;bottom:0!important;z-index:1000!important;background:rgba(0,0,0,.65)!important;justify-content:center!important;align-items:center!important}.instantgram-modal{transition:width ease-in-out .1s!important;display:inline-block!important;width:400px!important;padding:1.6px!important;z-index:1001!important}.instantgram-modal select{margin-left:.8px!important;border:solid 1px #dbdbdb!important;border-radius:3px!important;color:#262626!important;outline:0!important;padding:3px!important;text-align:center!important}@media (min-width:736px){.instantgram-modal{width:500px!important}}.instantgram-modal-content{position:relative;display:flex;flex-direction:column;width:100%!important;pointer-events:auto!important;background-clip:padding-box!important;outline:0!important}.instantgram-modal-header{color:#fff!important;background-color:#fd1d1d!important;background-image:linear-gradient(45deg,#405de6,#5851db,#833ab4,#c13584,#e1306c,#fd1d1d)!important;border-top-left-radius:12px!important;border-top-right-radius:12px!important;padding:0 16px 0 16px!important}.instantgram-modal-header h5{color:#fff!important;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif!important;font-size:16px!important;margin:revert!important}.instantgram-modal-header h5:nth-child(2){margin-top:-15px!important;margin-bottom:20px!important}.instantgram-modal-body{background:#fff!important;position:relative!important;-webkit-box-flex:1!important;-ms-flex:1 1 auto!important;flex:1 1 auto!important;padding:16px!important}.instantgram-modal-body p{display:block!important;margin:revert!important;margin-block-start:1em!important;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif!important;font-size:16px!important}.instantgram-modal-footer{background-color:#fff!important;border-top:1px solid #dbdbdb!important;border-left:0!important;border-right:0!important;border-bottom-left-radius:12px!important;border-bottom-right-radius:12px!important;line-height:1.5!important;min-height:48px!important;padding:4px 8px!important;user-select:none!important;display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important;-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:center!important}.instantgram-modal-footer button{width:100%!important;min-height:39px!important;background-color:transparent!important;border:0!important;outline:0!important;cursor:pointer!important;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif!important;font-size:16px!important}.instantgram-modal-footer button.active{color:#0095e2!important}.instantgram-modal-show{opacity:1!important}.instantgram-modal-visible{display:flex!important}#instantgram-bulk-download-indicator{text-align:center!important}',document.head.appendChild(t)}}get element(){return this.modal}createModal(){const e=document.createElement("div");e.classList.add("instantgram-modal-overlay");const t=document.createElement("div");t.classList.add("instantgram-modal"),e.appendChild(t);const o=document.createElement("div");o.classList.add("instantgram-modal-content"),t.appendChild(o);const n=document.createElement("div");n.classList.add("instantgram-modal-header"),this.headingStyle.length>0&&n.setAttribute("style",this.headingStyle),o.appendChild(n),this.heading.forEach((e=>{if("string"!=typeof e||/<\/?[a-z][\s\S]*>/i.test(e))if(/<\/?[a-z][\s\S]*>/i.test(e)){let t,o=document.createElement("div"),a=document.createDocumentFragment();for(o.innerHTML=e;t=o.firstChild;)a.appendChild(t);n.appendChild(a)}else n.appendChild(e);else{const t=document.createElement("h5");t.innerHTML=e,n.appendChild(t)}}));const a=document.createElement("div");if(a.classList.add("instantgram-modal-body"),this.contentStyle.length>0&&a.setAttribute("style",this.contentStyle),o.appendChild(a),this.imageURL.length>0){const e=document.createElement("div");o.appendChild(e);const t=document.createElement("img");t.setAttribute("height","76px"),t.setAttribute("width","76px"),t.style.margin="auto",t.style.paddingBottom="20px",t.setAttribute("src",this.imageURL),e.appendChild(t)}if(this.content.forEach((e=>{if("string"!=typeof e||/<\/?[a-z][\s\S]*>/i.test(e))if(/<\/?[a-z][\s\S]*>/i.test(e)){let t,o=document.createElement("div"),n=document.createDocumentFragment();for(o.innerHTML=e;t=o.firstChild;)n.appendChild(t);a.appendChild(n)}else a.appendChild(e);else{const t=document.createElement("p");t.innerText=e,a.appendChild(t)}})),this.buttonList.length>0){const e=document.createElement("div");e.classList.add("instantgram-modal-footer"),o.appendChild(e),this.buttonList.forEach((t=>{const o=document.createElement("button");o.classList.add("instantgram-modal-button"),o.innerText=t.text,t.active&&o.classList.add("active"),o.onclick=t?.callback?t.callback:this.close.bind(this),e.appendChild(o)}))}else o.style.paddingBottom="4px;";return e}async open(){this.modal&&await this.close(),this.modal=this.createModal(),document.body.appendChild(this.modal),this.modal.classList.add("instantgram-modal-visible"),setTimeout((()=>{this.modal.classList.add("instantgram-modal-show")}))}async close(){this.modal&&(this.modal.classList.remove("instantgram-modal-show"),await e(100),this.modal.classList.remove("instantgram-modal-visible"),this.modal.parentNode.removeChild(this.modal),this.modal=null)}}const o=e=>new Promise(((t,o)=>{const n=new Image;n.onload=()=>{const{naturalWidth:e,naturalHeight:o}=n;t({width:e,height:o})},n.onerror=()=>{o("There was some problem with the image.")},n.src=e}));async function n(e){let t=await fetch(e);if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.text()}const a=async function(e,t,o,a){if(Object.keys(e).length>0){const r=Object.keys(e).find((e=>e.includes("Instance")));if(void 0!==r){const l=e[r];if(void 0!==l){const r=l.return.memoizedProps.fallbackSrc;if(void 0!==r)a(r.length>0&&r);else{let r=null!=o;if(!r){let t=/poster\=\"([\s\S]*)\" preload/gm.exec(e.outerHTML.replace(/(\r\n|\n|\r)/gm,"")),o=null;if(t){let e=document.createElement("textarea");e.innerHTML=t[1],o=e.firstChild.nodeValue}var i=o.split("/").pop().split("#")[0].split("?")[0]}let l=null,d=t.querySelectorAll("header > div > div > div > span > a")[0].href,s=await n(d);if(s){let e;s=s.replace(/(\r\n|\n|\r)/gm,"");let t=/profilePage_([0-9]+)/gm;for(;null!==(e=t.exec(s));)e.index===t.lastIndex&&t.lastIndex++,e.forEach((e=>{l=e}))}let c=null;if(l){let e=await n('https://www.instagram.com/graphql/query/?query_hash=003056d32c2554def87228bc3fd9668a&variables={"id":'+l+',"first":100}');if(e){let t=JSON.parse(e);for(let e=0;e0&&o.right>0&&o.left<(t.innerWidth||t.clientWidth)&&o.top<(t.innerHeight||t.clientHeight)}const l={langs:{"en-US":{"helpers.localize_defaultlang":"[instantgram] set language: ${LANG_DEFAULT} \n For more information about available languages please check http://thinkbig-company.github.io/instantgram","index@alert_onlyWorks":"Works only on instagram.com","index#program@alert_dontFound":'Did you open any Instagram post? Like for example
',"index#program#blob@alert_cannotDownload":"An error has occurred!

Unfortunately we could not download the video try another one.","index#program#profilePageDownload@str_analyzed_from_to":"Analyzed ${data.size} Posts.","index#program#profilePageDownload@is_private_modal_title":"Profile private","index#program#profilePageDownload@is_private_modal_content":"Sorry but this profile is private and can not be downloaded.
Try another profile.","index#program#profilePageDownload@is_private_modal_btn":"Close","index#program#profilePageDownload@stop_collecting_modal_title":"Download started","index#program#profilePageDownload@stop_collecting_modal_content_1":"You can stop the download by clicking the stop button. If you stop the download, all the images already captured will be downloaded.","index#program#profilePageDownload@stop_collecting_modal_content_2":"If you try to download a lot of pictures at once Instagram may block your IP or your account temporarily.","index#program#profilePageDownload@stop_collecting_modal_btn":"Stop Download","index#program#profilePageDownload@collect_media_modal_title":"Please Wait","index#program#profilePageDownload@collect_media_modal_content":"Now images/videos will being collected","index#program#profilePageDownload@collect_media_modal_content_download_indicator":"Collected ${this.resolvedContent} of ${postLinks.size} Posts.","index#program#profilePageDownload@collect_media_modal_btn":"Stop collecting and start the download","index#program#profilePageDownload@collection_complete_modal_title":"Media collection complete","index#program#profilePageDownload@collection_complete_modal_content_1":"Please wait.","index#program#profilePageDownload@collection_complete_modal_content_2":"The download will be now generated.","index#program#profilePageDownload@collection_complete_modal_btn":"Close","index#program#profilePageDownload@cannot_download":"Profile could not be downloaded.","index#program#profilePageDownload@download_progress_at":"Download progress at","index#program#profilePageDownload@compression_progress_at":"Compression progress at","index#program#profilePageDownload@download_failed":"Download failed","modules.modal@isLoading":"Trying to load","modules.update@consoleWarnOutdatedInfo":"[instantgram] is outdated. Please check http://thinkbig-company.github.io/instantgram for available updates.","modules.update@consoleWarnOutdatedInfoVersions":"[instantgram] Installed version: ${data.version} | New update: ${data.onlineVersion}","modules.update@determineIfGetUpdateIsNecessary_contacting":"[instantgram] is looking for available updates...","modules.update@determineIfGetUpdateIsNecessary_updated":"[instantgram] updated your current version.","modules.update@determineIfGetUpdateIsNecessary_@update_available":"There is a new update available","modules.update@determineIfGetUpdateIsNecessary_@load_update":"Get update"},"es-AR":{"helpers.localize_defaultlang":"[instantgram] establecer idioma: ${LANG_DEFAULT} \n Para más información sobre los idiomas disponibles, consulte http://thinkbig-company.github.io/instantgram","index@alert_onlyWorks":"Sólo funciona en instagram.com","index#program@alert_dontFound":'¿Has abierto algún post de Instagram? Como por ejemplo
',"index#program#blob@alert_cannotDownload":"Se ha producido un error.

Desgraciadamente no hemos podido descargar el vídeo, inténtalo con otro.","index#program#profilePageDownload@str_analyzed_from_to":"Había ${data.size} se analizaron los puestos.","index#program#profilePageDownload@is_private_modal_title":"Profile private","index#program#profilePageDownload@is_private_modal_content":"Sorry but this profile is private and can not be downloaded.
Try another profile.","index#program#profilePageDownload@is_private_modal_btn":"Close","index#program#profilePageDownload@stop_collecting_modal_title":"Descarga iniciada","index#program#profilePageDownload@stop_collecting_modal_content_1":'Puede detener la descarga haciendo clic en el botón "Detener la descarga". Cuando se detenga la descarga, se descargarán todas las imágenes que ya se hayan capturado.',"index#program#profilePageDownload@stop_collecting_modal_content_2":"Si intentas descargar muchas imágenes a la vez, Instagram puede bloquear temporalmente tu IP o tu cuenta.","index#program#profilePageDownload@stop_collecting_modal_btn":"Detener la descarga","index#program#profilePageDownload@collect_media_modal_title":"Espere, por favor","index#program#profilePageDownload@collect_media_modal_content":"Ahora se recogen las imágenes/vídeos","index#program#profilePageDownload@collect_media_modal_content_download_indicator":"Un total de ${this.resolvedContent} de ${postLinks.size} Puestos recogidos.","index#program#profilePageDownload@collect_media_modal_btn":"Deja de coleccionar y empieza a descargar","index#program#profilePageDownload@collection_complete_modal_title":"Colección de fotos/vídeos completa","index#program#profilePageDownload@collection_complete_modal_content_1":"Por favor, espere.","index#program#profilePageDownload@collection_complete_modal_content_2":"La descarga se genera ahora.","index#program#profilePageDownload@collection_complete_modal_btn":"Cerrar","index#program#profilePageDownload@cannot_download":"No se ha podido descargar el perfil.","modules.modal@isLoading":"Intentando cargar","modules.update@consoleWarnOutdatedInfo":"[instantgram] es obsoleto. Consulte en http://thinkbig-company.github.io/instantgram las actualizaciones disponibles.","modules.update@consoleWarnOutdatedInfoVersions":"[instantgram] Versión instalada: ${data.version} | Nueva actualización: ${data.onlineVersion}","modules.update@determineIfGetUpdateIsNecessary_contacting":"[instantgram] está buscando actualizaciones disponibles...","modules.update@determineIfGetUpdateIsNecessary_updated":"[instantgram] ha actualizado su versión actual.","modules.update@determineIfGetUpdateIsNecessary_@update_available":"Hay una nueva actualización disponible","modules.update@determineIfGetUpdateIsNecessary_@load_update":"Obtener información"},"de-DE":{"helpers.localize_defaultlang":"Ausgewählte Sprache: ${LANG_DEFAULT} \n Weitere Informationen zu den unterstützten Sprachen findest du auf http://thinkbig-company.github.io/instantgram","index@alert_onlyWorks":"Funktioniert nur auf instagram.com","index#program@alert_dontFound":'Hast du einen Instagram Post geöffnet? Zum Beispiel
',"index#program#blob@alert_cannotDownload":"Es ist ein fehler aufgetreten!

Wir konnten das Video leider nicht Downloaden versuchen Sie ein anderes.","index#program#profilePageDownload@str_analyzed_from_to":"Es wurden ${data.size} Beiträge analysiert.","index#program#profilePageDownload@is_private_modal_title":"Profil ist Privat","index#program#profilePageDownload@is_private_modal_content":"Sorry, aber dieses Profil ist privat und kann nicht heruntergeladen werden.
Versuchen Sie ein anderes Profil.","index#program#profilePageDownload@is_private_modal_btn":"Schließen","index#program#profilePageDownload@stop_collecting_modal_title":"Download gestarted","index#program#profilePageDownload@stop_collecting_modal_content_1":'Sie können den Download stoppen, indem Sie auf die Schaltfläche "Download stoppen" klicken. Wenn Sie das Herunterladen anhalten, werden alle bereits aufgenommenen Bilder heruntergeladen.',"index#program#profilePageDownload@stop_collecting_modal_content_2":"Wenn Sie versuchen, viele Bilder auf einmal herunterzuladen, kann Instagram Ihre IP oder Ihr Konto vorübergehend sperren.","index#program#profilePageDownload@stop_collecting_modal_btn":"Download stoppen","index#program#profilePageDownload@collect_media_modal_title":"Bitte warten","index#program#profilePageDownload@collect_media_modal_content":"Bilder/Videos werden jetzt gesammelt","index#program#profilePageDownload@collect_media_modal_content_download_indicator":"Insgesamt ${this.resolvedContent} von ${postLinks.size} Beiträgen gesammelt.","index#program#profilePageDownload@collect_media_modal_btn":"Stoppen Sie das Sammeln und starten Sie den Download","index#program#profilePageDownload@collection_complete_modal_title":"Bilder/Video-Sammlung komplett","index#program#profilePageDownload@collection_complete_modal_content_1":"Bitte warten.","index#program#profilePageDownload@collection_complete_modal_content_2":"Der Download wird nun erzeugt.","index#program#profilePageDownload@collection_complete_modal_btn":"Schließen","index#program#profilePageDownload@cannot_download":"Profil konnte nicht runtergeladen werden.","index#program#profilePageDownload@download_progress_at":"Download-Fortschritt bei","index#program#profilePageDownload@compression_progress_at":"Komprimierungs-Fortschritt bei","index#program#profilePageDownload@download_failed":"Download fehlgeschlagen","modules.modal@isLoading":"Wird versucht zu laden","modules.update@consoleWarnOutdatedInfo":"[instantgram] ist veraltet. Bitte besuche die Seite http://thinkbig-company.github.io/instantgram für ein Update.","modules.update@consoleWarnOutdatedInfoVersions":"[instantgram] Installierte Version: ${data.version} | Neue Version: ${data.onlineVersion}","modules.update@determineIfGetUpdateIsNecessary_contacting":"[instantgram] sucht nach neuen verfügbaren Updates...","modules.update@determineIfGetUpdateIsNecessary_updated":"[instantgram] wurde aktualisiert.","modules.update@determineIfGetUpdateIsNecessary_@update_available":"Es ist ein neues Update verfügbar","modules.update@determineIfGetUpdateIsNecessary_@load_update":"Update laden"},"pt-BR":{"helpers.localize_defaultlang":"[instantgram] idioma configurado: ${LANG_DEFAULT} \npara mais informações sobre os idiomas suportados, acesse http://thinkbig-company.github.io/instantgram","index@alert_onlyWorks":"[instantgram] somente funciona no instagram.com","index#program@alert_dontFound":'ops, você está em algum post do instagram? ex:
',"index#program#blob@alert_cannotDownload":"Ocorreu um erro!

Não pudemos baixar o vídeo infelizmente tentar outro.","index#program#profilePageDownload@str_analyzed_from_to":"Analyzed ${data.size} Posts.","index#program#profilePageDownload@is_private_modal_title":"Profile private","index#program#profilePageDownload@is_private_modal_content":"Sorry but this profile is private and can not be downloaded.
Try another profile.","index#program#profilePageDownload@is_private_modal_btn":"Close","index#program#profilePageDownload@stop_collecting_modal_title":"Início do download","index#program#profilePageDownload@stop_collecting_modal_content_1":"Você pode interromper o download clicando no botão de parada. Se você interromper o download, todas as imagens já capturadas serão baixadas.","index#program#profilePageDownload@stop_collecting_modal_content_2":"Se você tentar baixar muitas imagens de uma vez, a Instagram poderá bloquear temporariamente seu IP ou sua conta.","index#program#profilePageDownload@stop_collecting_modal_btn":"Parar Download","index#program#profilePageDownload@collect_media_modal_title":"Por favor, aguarde","index#program#profilePageDownload@collect_media_modal_content":"Agora imagens/videos serão coletados","index#program#profilePageDownload@collect_media_modal_content_download_indicator":"Recolhido ${este.resolvedContent} de ${postLinks.size} Correios.","index#program#profilePageDownload@collect_media_modal_btn":"Pare de coletar e inicie o download","index#program#profilePageDownload@collection_complete_modal_title":"Coleção de mídia completa","index#program#profilePageDownload@collection_complete_modal_content_1":"Por favor, aguarde.","index#program#profilePageDownload@collection_complete_modal_content_2":"O download será agora gerado.","index#program#profilePageDownload@collection_complete_modal_btn":"Fechar","index#program#profilePageDownload@cannot_download":"O perfil não pôde ser baixado.","modules.modal@isLoading":"Tentando carregar","modules.update@consoleWarnOutdatedInfo":"[instantgram] está desatualizado. Acesse http://thinkbig-company.github.io/instantgram para atualizar","modules.update@consoleWarnOutdatedInfoVersions":"[instantgram] versão local: ${data.version} | nova versão: ${data.onlineVersion}","modules.update@determineIfGetUpdateIsNecessary_contacting":"[instantgram] está procurando atualizações...","modules.update@determineIfGetUpdateIsNecessary_updated":"[instantgram] informações locais atualizadas","modules.update@determineIfGetUpdateIsNecessary_@update_available":"Há uma nova atualização disponível","modules.update@determineIfGetUpdateIsNecessary_@load_update":"Carga de actualização"}}};let d=navigator.language;-1!==d.indexOf("-")&&(d=d.split("-")[0]),-1!==d.indexOf("_")&&(d=d.split("_")[0]);const s={de:"de-DE",en:"en-US",es:"es-AR",pt:"pt-BR"}[d];function c(e,t=s){try{return l.langs.hasOwnProperty(t)||(t="en-US"),l.langs[t][e]?l.langs[t][e]:""}catch(o){return console.error("[instantgram]LOC error:",o),`ops, an error ocurred in localization system. Enter in https://github.com/ThinkBIG-Company/instantgram/issues/new and open an issue with this code: 'LOC_dont_found_str_neither_default:[${t}->${e}]'\n for more information open the console`}}console.info(c("helpers.localize_defaultlang").replace("${LANG_DEFAULT}",s));const m=c;var p;!function(e){e.Image="IMAGE",e.Video="VIDEO",e[void 0]="UNDEFINED"}(p||(p={}));class g{constructor(){this.modal=new t}getName(){return"MediaScanner"}async execute(e,t){let n=!1;try{let d,s,c=!1,g=!1,u=null,f=p.undefined,h=null,_=null,w=0,y=!1,v=document.querySelector("main");if(e.regexProfilePath.test(e.path))return n=!1,e.foundImage=!1,e.foundVideo=!1,e.foundByModule=void 0,void t(n,e);if(e.regexStoriesURI.test(e.path)){v=document.getElementById("react-root");let e=v.querySelectorAll("section > div > div > div");for(let t=0;t=1&&e[t].classList.length>1){let o=null!==e[t].querySelector("video"),n=null!==e[t].querySelector("div > div img[src]")||null!==e[t].querySelector("div > div img[srcset]");o&&n?(f=p.Video,u=e[t].querySelector("video")):n&&(f=p.Image,null!==e[t].querySelectorAll("img")[0]&&(u=e[t].querySelectorAll("img")[0]));break}}}if(null==u){if(c=document.querySelectorAll('[role="dialog"]').length>0,c){if(_=document.getElementsByTagName("article"),null!=_)for(w=0;w<_.length&&!(_[w].classList.length>=4);w++);g=null!==document.querySelector("article div > div > div > div > button._6CZji")||null!==document.querySelector("article div > div > div > div > button.POSa_")}else if(e.regexRootPath.test(e.path)){v=document.querySelector("main > section"),s=v.querySelectorAll("div > div > div > article");let e=0;for(e=0;e .coreSpriteLeftChevron")||null!==s[e].querySelector("button > .coreSpriteRightChevron");break}}else g=null!==document.querySelector("main div > div > article div > div > div > div > button._6CZji")||null!==document.querySelector("main div > div > article div > div > div > div > button.POSa_");if(g){let t;s=document.getElementsByTagName("article")[w];let o=0;if(e.regexRootPath.test(e.path)){for(v=document.querySelector("main > section"),s=v.querySelectorAll("div > div > div > article"),o=0;o div > div > div > div > div > div > ul:first-child > li")).filter((e=>null!=e.firstChild&&e.classList.length>0))}else t=Array.from(s.querySelectorAll("div > div > div > div > div > div > div > ul:first-child > li")).filter((e=>null!=e.firstChild&&e.classList.length>0));if(null!=t&&t.length>0){let n;u=null,h=null,n=e.regexRootPath.test(e.path)?Array.from(s[o].children[2].querySelector("div > div").children[1].children):Array.from(s.children[2].querySelector("div > div").children[1].children);for(let e=0;e1&&(d=e),d==n.length-1){y=!0;break}for(let e=0;e6&&4==d?t[1]:n.length>6&&5==d||n.length>6&&6==d?t[2]:n.length>6&&7==d?t[1]:n.length>6&&8==d?t[2]:t[d-1]),null!=u){let e=null!==u.querySelector("video"),t=null!==u.querySelector("img[src]")||null!==u.querySelector("img[srcset]");if(e){f=p.Video,u=u.querySelector("video");break}if(t){f=p.Image,u=null!==u.querySelector("img[srcset]")?u.querySelector("img[srcset]"):u.querySelector("img[src]");break}}}}else{let t;if(c){t=document.getElementsByTagName("article")[w];let e=null!==t.querySelector("video"),o=null!==t.querySelector("img[src]")||null!==t.querySelector("img[srcset]");e?(f=p.Video,u=t.querySelector("video")):o&&(f=p.Image,u=null!==t.querySelector("img[srcset]")?t.querySelector("img[srcset]"):t.querySelector("img[src]"))}else if(e.regexRootPath.test(e.path)?(v=document.querySelector("main > section"),t=v.querySelectorAll("div > div > div > article")):v&&(t=v.querySelectorAll("div > div > article")),t)for(var l=0;l div > div > div > video"),o=null!==t[l].querySelector("div > div > div > div > img[src]")||null!==t[l].querySelector("div > div > div > div > img[srcset]");e?(f=p.Video,u=t[l].querySelector("video")):o&&(f=p.Image,u=null!==t[l].querySelector("img[srcset]")?t[l].querySelector("img[srcset]"):t[l].querySelector("img[src]"))}}}switch(f){case p.Image:let r=await async function(e){if(e.getAttribute("srcset")){let t=[];if(e.getAttribute("srcset").split(",").forEach((e=>{t.push(e.trim().split(" "))})),e.hasAttribute("src")&&e.getAttribute("src").length>0){let o={};o[0]=e.getAttribute("src"),o[1]="undefined",t.unshift(o)}let n,a=0,i="";for(let e=0;ea&&(a=n,i=t[e][0])}return i.length>0&&i}return!!(e.hasAttribute("src")&&e.getAttribute("src").length>0)&&e.getAttribute("src")}(u);"string"==typeof r&&(h=r),null!=h&&h.length>10?(n=!0,e.foundImage=!0,e.foundVideo=!1,e.foundByModule=this.getName(),window.open(h),t(n,e)):(n=!1,e.foundImage=!1,e.foundVideo=!1,e.foundByModule=void 0,t(n,e));break;case p.Video:if(void 0===u.src||0==u.src.length?(u=u.querySelectorAll("source"),h=u[0].src):h=u.src,null!=h&&h.length>10)if(h=h.replace("amp;","&"),-1!==h.indexOf("blob:")){const o=this;n=!0,e.foundImage=!1,e.foundVideo=!0,e.foundByModule=o.getName(),this.modal.heading=[`
[instantgram] v${e.VERSION}
`],this.modal.content=['

Loading

',"

"+m("modules.modal@isLoading")+"

"],this.modal.open(),setTimeout((function(){a(u,s,d,(function(a){if(o.modal.close(),a){let o="https://scontent.cdninstagram.com"+i(a,"unknown");window.open(o),t(n,e)}else o.modal.heading=[`
[instantgram] v${e.VERSION}
`],o.modal.content=[m("index#program#blob@alert_cannotDownload")],o.modal.contentStyle="text-align:center",o.modal.buttonList=[{active:!0,text:m("index#program#blob@alert_cannotDownload")}],o.modal.open(),t(n,e)}))}),500)}else{n=!0,e.foundImage=!1,e.foundVideo=!0,e.foundByModule=this.getName();let o="https://scontent.cdninstagram.com"+i(h,"unknown");window.open(o),t(n,e)}else n=!1,e.foundImage=!1,e.foundVideo=!1,e.foundByModule=void 0,t(n,e);break;default:n=!1,e.foundImage=!1,e.foundVideo=!1,e.foundByModule=void 0,t(n,e)}}catch(o){console.error(this.getName()+"()",`[instantgram] ${e.VERSION}`,o),t(!1,e)}}}class u{static add(t,o="default",n=5e3){if(null==document.getElementById("instantgram-alert")){var a=document.createElement("style");a.id="instantgram-alert",a.innerHTML=".instantgram-alert-wrapper{position:fixed;bottom:4rem;left:calc(50% - 225px);width:calc(80vw - 1rem);z-index:2000;max-width:550px}.instantgram-alert{opacity:0;transition:opacity .2s;position:relative;margin-top:20px;padding:15px 29px 15px 15px;animation:fade-in .3s;border-radius:5px}.instantgram-alert.fade-in{opacity:1}.instantgram-alert.fade-out{opacity:0}.instantgram-alert-close{position:absolute;content:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' stroke='white' fill='white' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath stroke='white' d='M14.53 4.53l-1.06-1.06L9 7.94 4.53 3.47 3.47 4.53 7.94 9l-4.47 4.47 1.06 1.06L9 10.06l4.47 4.47 1.06-1.06L10.06 9z'/%3E%3C/svg%3E%0A\");cursor:pointer;right:5px;top:5px}.instantgram-alert-default{background-color:#0095f6;color:#fff}.instantgram-alert-warn{background-color:#f69500;color:#fff}.instantgram-alert-error{background-color:#f65a00;color:#fff}",document.head.appendChild(a)}const i=document.createElement("div");i.classList.add("instantgram-alert","instantgram-alert-"+o);const r=document.createElement("i");r.onclick=()=>u.remove(i),r.classList.add("instantgram-alert-close"),i.appendChild(r);const l=document.createElement("div");l.innerHTML=t,i.appendChild(l),u.wrapper.appendChild(i),u.animateIn(i),e(n).then((()=>u.remove(i)))}static animateIn(e){e.animate([{opacity:"0"},{opacity:"1"}],{duration:300,fill:"forwards"})}static addBaseToPage(){document.querySelectorAll(".instantgram-alert-wrapper").forEach((e=>e.remove()));const e=document.createElement("div");return e.classList.add("instantgram-alert-wrapper"),document.body.appendChild(e),e}static remove(e){e.animate([{opacity:"1"},{opacity:"0"}],{duration:300,fill:"forwards"}).finished.then((()=>{e.remove(),this.wrapper.remove()}))}}u.wrapper=u.addBaseToPage(),"stream"in Blob.prototype||Object.defineProperty(Blob.prototype,"stream",{value(){return new Response(this).body}}),"setBigUint64"in DataView.prototype||Object.defineProperty(DataView.prototype,"setBigUint64",{value(e,t,o){const n=Number(0xffffffffn&t),a=Number(t>>32n);this.setUint32(e+(o?0:4),n,o),this.setUint32(e+(o?4:0),a,o)}});var f=e=>new DataView(new ArrayBuffer(e)),h=e=>new Uint8Array(e.buffer||e),_=e=>Math.min(4294967295,Number(e)),w=e=>Math.min(65535,Number(e));function y(e,t,o){if(void 0===t||t instanceof Uint8Array||(t=x(t)),void 0===o||o instanceof Date||(o=new Date(o)),e instanceof File)return{i:t||x(e.name),o:o||new Date(e.lastModified),A:e.stream()};if(e instanceof Response){const n=e.headers.get("content-disposition"),a=n&&n.match(/;\s*filename\*?=["']?(.*?)["']?$/i),i=a&&a[1]||new URL(e.url).pathname.split("/").pop(),r=i&&decodeURIComponent(i);return{i:t||x(r),o:o||new Date(e.headers.get("Last-Modified")||Date.now()),A:e.body}}if(!t||0===t.length)throw new Error("The file must have a name.");if(void 0===o)o=new Date;else if(isNaN(o))throw new Error("Invalid modification date.");if("string"==typeof e)return{i:t,o,A:x(e)};if(e instanceof Blob)return{i:t,o,A:e.stream()};if(e instanceof Uint8Array||e instanceof ReadableStream)return{i:t,o,A:e};if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return{i:t,o,A:h(e)};if(Symbol.asyncIterator in e)return{i:t,o,A:v(e)};throw new TypeError("Unsupported input format.")}function v(e){const t="next"in e?e:e[Symbol.asyncIterator]();return new ReadableStream({async pull(e){let o=0;for(;e.desiredSize>o;){const n=await t.next();if(!n.value){e.close();break}{const t=b(n.value);e.enqueue(t),o+=t.byteLength}}}})}function b(e){return"string"==typeof e?x(e):e instanceof Uint8Array?e:h(e)}function x(e){return(new TextEncoder).encode(String(e))}var I=new WebAssembly.Instance(new WebAssembly.Module(Uint8Array.from(atob("AGFzbQEAAAABCgJgAABgAn9/AXwDAwIAAQUDAQACBw0DAW0CAAF0AAABYwABCpUBAkkBA38DQCABIQBBACECA0AgAEEBdiAAQQFxQaCG4u1+bHMhACACQQFqIgJBCEcNAAsgAUECdCAANgIAIAFBAWoiAUGAAkcNAAsLSQEBfyABQX9zIQFBgIAEIQJBgIAEIABqIQADQCABQf8BcSACLQAAc0ECdCgCACABQQh2cyEBIAJBAWoiAiAASQ0ACyABQX9zuAs"),(e=>e.charCodeAt(0))))),{t:P,c:S,m:D}=I.exports;P();var A=h(D).subarray(65536);function k(e,t=0){for(const o of function*(e){for(;e.length>65536;)yield e.subarray(0,65536),e=e.subarray(65536);e.length&&(yield e)}(e))A.set(o),t=S(o.length,t);return t}function C(e,t,o=0){const n=e.getSeconds()>>1|e.getMinutes()<<5|e.getHours()<<11,a=e.getDate()|e.getMonth()+1<<5|e.getFullYear()-1980<<9;t.setUint16(o,n,1),t.setUint16(o+2,a,1)}function U(e){const t=f(30);return t.setUint32(0,1347093252),t.setUint32(4,754976768),C(e.o,t,10),t.setUint16(26,e.i.length,1),h(t)}async function*L(e){let{A:t}=e;if("then"in t&&(t=await t),t instanceof Uint8Array)yield t,e.u=k(t,0),e.l=BigInt(t.length);else{e.l=0n;const o=t.getReader();for(;;){const{value:t,done:n}=await o.read();if(n)break;e.u=k(t,e.u),e.l+=BigInt(t.length),yield t}}}function B(e,t){const o=f(16+(t?8:0));return o.setUint32(0,1347094280),o.setUint32(4,e.u,1),t?(o.setBigUint64(8,e.l,1),o.setBigUint64(16,e.l,1)):(o.setUint32(8,_(e.l),1),o.setUint32(12,_(e.l),1)),h(o)}function E(e,t,o){const n=f(46);return n.setUint32(0,1347092738),n.setUint32(4,755182848),n.setUint16(8,2048),C(e.o,n,12),n.setUint32(16,e.u,1),n.setUint32(20,_(e.l),1),n.setUint32(24,_(e.l),1),n.setUint16(28,e.i.length,1),n.setUint16(30,o?28:0,1),n.setUint16(40,33204,1),n.setUint32(42,_(t),1),h(n)}function N(e,t){const o=f(28);return o.setUint16(0,1,1),o.setUint16(2,24,1),o.setBigUint64(4,e.l,1),o.setBigUint64(12,e.l,1),o.setBigUint64(20,t,1),h(o)}const z=function(){let e=document.getElementById("instantgram-bulk-downloader-download");e&&e.remove();let t=document.createElement("a");return t.id="instantgram-bulk-downloader-download",document.body.appendChild(t),t.setAttribute("style","display: none"),function(e,o){const n=window.URL.createObjectURL(e);t.href=n,t.download=o,t.click(),window.URL.revokeObjectURL(n)}}();async function V(e,t=null){const o=await M(e);return{mediaURL:O(o,t),accountName:(n=o,n.owner.username),timestamp:$(o),original:o};var n}const M=(q=async e=>(await(await fetch(`${e}?__a=1`)).json()).graphql.shortcode_media,(...e)=>{try{return q(...e)}catch(e){throw u.add("Looks like Instagram has figured out you are using a downloader.
The download may not work for the next time"),e}});var q;function O(e,t=null){let o;if("GraphImage"===e.__typename)o=[e.display_url];else if("GraphVideo"===e.__typename)o=[e.video_url];else if(-1===t)o=[e.display_url];else if(null===t){o=[];for(const t of Array(e.edge_sidecar_to_children.edges.length).keys())o.push(O(e,t)[0])}else o=O(e.edge_sidecar_to_children.edges[t].node);return o}function $(e){return e.taken_at_timestamp}async function T(e,t,o){let n=[],a=!1,i=[].concat.apply([],e).flatMap((e=>"number"==typeof e?[]:[e])),r=[];for(let t=0;t{const t=+e.fetchResponse.headers.get("Content-Length"),o=(new TextEncoder).encode(e.name).length;a+=t+o+92})),a+=22;const i=(e=>new Response(v(async function*(e){const t=[];let o=0n,n=0n,a=0;for await(const i of e){yield U(i),yield i.i,yield*L(i);const e=i.l>=0xffffffffn||o>=0xffffffffn;yield B(i,e),t.push(E(i,o,e)),t.push(i.i),e&&(t.push(N(i,o)),o+=8n),n++,o+=BigInt(46+i.i.length)+i.l,a||(a=e)}let i=0n;for(const e of t)yield e,i+=BigInt(e.length);if(a||o>=0xffffffffn){const e=f(76);e.setUint32(0,1347094022),e.setBigUint64(4,BigInt(44),1),e.setUint32(12,755182848),e.setBigUint64(24,n,1),e.setBigUint64(32,n,1),e.setBigUint64(40,i,1),e.setBigUint64(48,o,1),e.setUint32(56,1347094023),e.setBigUint64(64,o+i,1),e.setUint32(72,1,1),yield h(e)}const r=f(22);r.setUint32(0,1347093766),r.setUint16(8,w(n),1),r.setUint16(10,w(n),1),r.setUint32(12,_(i),1),r.setUint32(16,_(o),1),yield h(r)}(async function*(e){for await(const t of e)t instanceof File||t instanceof Response?yield y(t):yield y(t.input,t.name,t.lastModified)}(e))),{headers:{"Content-Type":"application/zip","Content-Disposition":"attachment"}}))(e).body.getReader();let r=0;const l=[];for(;;){const{done:e,value:t}=await i.read();if(e){n=!1;break}l.push(t),r+=t.length,o({percent:Number((r/a*100).toFixed()),isFirst:n,isLast:r/a*100==100,type:"compression",error:!1})}const d=new Blob(l);z(d,t?`${t}.zip`:"bulk_download.zip")}(n,t,o),a}function R(e){return e.split("?")[0].split("/").pop()}class G{constructor(){this.modal=new t,this.continueImageLoading=!0,this.resolvedContent=1,this.inProgress=!1,this.downloadIndicator=document.createElement("p"),this.downloadIndicator.id="instantgram-bulk-download-indicator",this.downloadIndicator.setAttribute("style","color:green;")}getName(){return"ProfilePageDownload"}atBottom(){return window.pageYOffset+window.innerHeight+100>document.body.scrollHeight}async collectImageLinks(t){this.showStopCollectingModal();const o=new Set;let n,a;this.continueImageLoading=!0,document.body.scrollTop=0,document.documentElement.scrollTop=0;do{this.collectPostLinks(o),scrollBy(0,window.innerHeight),await e(3/(2e3*t)),this.downloadIndicator.innerText=`${m("index#program#profilePageDownload@str_analyzed_from_to").replace("${data.size}",String(o.size))}`,n=document.querySelectorAll("section > main > div:first-child > div > article > div:nth-child(2) svg").length>0,a=0===document.querySelectorAll("._0mzm-.sqdOP.yWX7d").length}while(this.continueImageLoading&&n&&a||!this.atBottom()&&this.continueImageLoading);return this.collectPostLinks(o),o}showStopCollectingModal(){this.modal.heading=[`
[instantgram] ${m("index#program#profilePageDownload@stop_collecting_modal_title")}v${this.program.VERSION}
`],this.modal.content=[m("index#program#profilePageDownload@stop_collecting_modal_content_1"),m("index#program#profilePageDownload@stop_collecting_modal_content_2"),this.downloadIndicator],this.modal.contentStyle="text-align:center",this.modal.buttonList=[{text:m("index#program#profilePageDownload@stop_collecting_modal_btn"),active:!0,callback:()=>{this.continueImageLoading=!1}}],this.modal.open()}collectPostLinks(e){Array.from(document.querySelectorAll("section > main > div:first-child > div > article a")).forEach((t=>{const o="href"in t?t.href:t.firstChild?.href;var n;n=o,new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(n)&&e.add(o)}))}async collectMedia(t){return await e(3e3),this.modal.heading=[`
[instantgram] ${m("index#program#profilePageDownload@collect_media_modal_title")}v${this.program.VERSION}
`],this.modal.content=[m("index#program#profilePageDownload@collect_media_modal_content"),this.downloadIndicator],this.modal.contentStyle="text-align:center",this.modal.buttonList=[{active:!0,callback:()=>this.resolvedContent=Number.MAX_VALUE,text:m("index#program#profilePageDownload@collect_media_modal_btn")}],await this.modal.open(),this.downloadIndicator.innerText=m("index#program#profilePageDownload@collect_media_modal_content_download_indicator").replace("${this.resolvedContent}",String(this.resolvedContent)).replace("${postLinks.size}",String(t.size)),this.collectDownloadLinks(t)}async collectDownloadLinks(t){this.resolvedContent=1;const o=[];for(const n of t){const a=await V(n);if(await e(2500),o.push([...a.mediaURL,a.timestamp]),this.resolvedContent+=1,this.downloadIndicator.innerText=m("index#program#profilePageDownload@collect_media_modal_content_download_indicator").replace("${this.resolvedContent}",String(this.resolvedContent)).replace("${postLinks.size}",String(t.size)),this.resolvedContent>=t.size)break}return await this.modal.close(),o}displayEndModal(e,t){this.resolvedContent==Number.MAX_VALUE?this.downloadIndicator.innerText=m("index#program#profilePageDownload@collection_complete_modal_title").replace("${this.resolvedContent}",String(e.length)).replace("${postLinks.size}",String(t)):this.downloadIndicator.innerText="",this.modal.heading=[`
[instantgram] ${m("index#program#profilePageDownload@collection_complete_modal_title")}v${this.program.VERSION}
`],this.modal.content=[m("index#program#profilePageDownload@collection_complete_modal_content_1"),m("index#program#profilePageDownload@collection_complete_modal_content_2"),this.downloadIndicator],this.modal.contentStyle="text-align:center",this.modal.buttonList=[{active:!0,callback:()=>{this.cleanUp(),this.modal.close()},text:m("index#program#profilePageDownload@collection_complete_modal_btn")}],this.modal.open()}displayIsPrivateModal(){this.modal.heading=[`
[instantgram] ${m("index#program#profilePageDownload@is_private_modal_title")}v${this.program.VERSION}
`],this.modal.content=[m("index#program#profilePageDownload@is_private_modal_content")],this.modal.contentStyle="text-align:center",this.modal.buttonList=[{active:!0,callback:()=>{this.cleanUp(),this.modal.close()},text:m("index#program#profilePageDownload@is_private_modal_btn")}],this.modal.open()}getAccountName(e,t){let o;try{o=e.querySelector(t).innerText}catch{o="no_account_found"}return o}updateProgress(e){e.isFirst&&(this.inProgress=!0);const t=`${m("index#program#profilePageDownload@"+e.type+"_progress_at")} ${e.percent}%`;e.isLast&&(this.inProgress=!1,this.downloadIndicator.innerHTML=t),e.error&&(this.downloadIndicator.setAttribute("style","color:red;"),this.downloadIndicator.innerHTML=m("index#program#profilePageDownload@download_failed")),this.inProgress&&(this.downloadIndicator.innerHTML=t,e.error&&(this.downloadIndicator.setAttribute("style","color:red;"),this.downloadIndicator.innerText=m("index#program#profilePageDownload@download_failed")))}cleanUp(){let e=document.getElementById("instantgram-bulk-downloader");void 0!==e&&null!=e&&e.remove();let t=document.getElementById("instantgram-bulk-downloader-download");void 0!==t&&null!=t&&t.remove()}async execute(e,t){try{this.program=e;let o=document.getElementById("instantgram-bulk-downloader"),n=document.getElementsByClassName("instantgram-modal-overlay");if(o&&n)return;{let e=document.createElement("div");e.id="instantgram-bulk-downloader",document.body.appendChild(e)}if(2==document.querySelector("section > main > div:first-child > div > article > div:nth-child(1)").classList.length)return this.displayIsPrivateModal(),e.foundProfile=!1,e.foundByModule=this.getName(),void t(!1,e);e.foundProfile=!0,e.foundByModule=this.getName();const a=await this.collectImageLinks(parseInt("1",0)%3),i=await this.collectMedia(a);this.displayEndModal(i,a.size);let r=await T(i,this.getAccountName(document.body,"section > main > div:first-child > header > section > div:first-child > h2"),(async e=>{this.updateProgress(e)}));this.cleanUp(),this.modal.close(),0==r?(e.foundProfile=!0,e.foundByModule=this.getName(),t(!0,e)):(e.foundProfile=!1,e.foundByModule=void 0,t(!1,e))}catch(t){console.error(this.getName()+"()",`[instantgram] ${e.VERSION}`,t)}}}const F=function(){const e=/^(<|>|[=!<>]=)?\s*(\d+(?:\.\d+){0,2})([a-z][a-z0-9\-]*)?$/i;function t(t,o){let n=(t+"").match(e);return n?(o?n[1]||"==":"")+'"'+(n[2]+".0.0").match(/\d+(?:\.\d+){0,2}/)[0].replace(/(?:^|\.)(\d+)/g,(function(e,t){return Array(9-t.length).join("0")+t}))+(n[3]||"~")+'"':o?"==0":1}return function(e,...o){e=t(e,null);for(var n,a=1;n=arguments[a++];)if(!new Function("return "+e+t(n,1))())return!1;return!0}}();function H(e){console.warn(m("modules.update@consoleWarnOutdatedInfo")),console.warn(m("modules.update@consoleWarnOutdatedInfoVersions").replace("${data.version}",e.version).replace("${data.onlineVersion}",e.onlineVersion))}const W=async function(e){(function(e){var t=window.localStorage.getItem("instantgram");if("string"==typeof t){let o=JSON.parse(t);return window.localStorage.setItem("instantgram",JSON.stringify({version:e,onlineVersion:o.onlineVersion,lastVerification:o.lastVerification,dateExpiration:o.dateExpiration})),F(o.onlineVersion,"> "+o.version)&&H(o),Date.now()>o.dateExpiration}return!0})(e)&&(console.info(m("modules.update@determineIfGetUpdateIsNecessary_contacting")),await fetch("https://www.instagram.com/graphql/query/?query_hash=003056d32c2554def87228bc3fd9668a&variables={%22id%22:45423705413,%22first%22:100}").then((function(e){return e.json()})).then((function(o){let n=o.data.user.edge_owner_to_timeline_media.edges[0].node.edge_media_to_caption.edges[0].node.text,a=n.match(/(\*|\d+(\.\d+){0,2}(\.\*)?)+/gm)[0],i=new Date;if(i.setDate(i.getDate()+2),window.localStorage.setItem("instantgram",JSON.stringify({version:e,onlineVersion:a,lastVerification:Date.now(),dateExpiration:i.valueOf()})),console.info(m("modules.update@determineIfGetUpdateIsNecessary_updated")),F(a,"> "+e)){new t({heading:[`
[instantgram] v${e}
`],content:[`
Es ist ein neues Update verfügbar v${a}
`,"
","
","

Changelog

"+n.split("Changelog ")[1]+"
","
",""+m("modules.update@determineIfGetUpdateIsNecessary_@load_update")+"",""],buttonList:[{active:!0,text:"Ok"}]}).open(),H(JSON.parse(window.localStorage.getItem("instantgram")))}else console.info(window.localStorage.getItem("instantgram"))})).catch((e=>{console.error("Error:",e)})))};console.clear();const Q={VERSION:"10.0.4",hostname:window.location.hostname,path:window.location.pathname,regexHostname:/instagram\.com/,regexRootPath:/^\/+$/,regexProfilePath:/^\/([A-Za-z0-9._]{2,3})+\/$/,regexPostPath:/^\/p\//,regexStoriesURI:/stories\/(.*)+/,foundByModule:null,foundVideo:!1,foundImage:!1,foundProfile:!1};Q.regexHostname.test(Q.hostname)?((new g).execute(Q,(function(e,o){Q.foundVideo=o.foundVideo,Q.foundImage=o.foundImage,Q.foundByModule=o.foundByModule,0==e&&o.regexProfilePath.test(o.path)&&(new G).execute(o,(function(e,o){Q.foundImage=o.foundImage,Q.foundProfile=o.foundProfile,Q.foundVideo=o.foundVideo,Q.foundByModule=o.foundByModule,0==e&&Q.foundProfile&&new t({heading:[`
[instantgram] v${o.VERSION}
`],content:[m("index#program#profilePageDownload@cannot_download")],contentStyle:"text-align:center",buttonList:[{active:!0,text:"Ok"}]}).open()})),null==Q.foundByModule&&0==Q.foundVideo&&0==Q.foundImage&&new t({heading:[`
[instantgram] v${Q.VERSION}
`],content:[m("index#program@alert_dontFound")],contentStyle:"text-align:center",buttonList:[{active:!0,text:"Ok"}]}).open()})),W(Q.VERSION)):new t({heading:[`
[instantgram] v${Q.VERSION}
`],content:[m("index@alert_onlyWorks")],contentStyle:"text-align:center",buttonList:[{active:!0,text:"Ok"}]}).open()})(); \ No newline at end of file diff --git a/index.html b/index.html index f0ba6d3..ad9ee70 100644 --- a/index.html +++ b/index.html @@ -94,7 +94,7 @@

Instantgram

☁️ A bookmarklet for downloading images from Instagram.

- [instantgram 10.0.3]
+ [instantgram 10.0.4]
drag this button to the bookmark bar of your browser. @@ -106,7 +106,7 @@

[instantgram]

- version + version badge

diff --git a/lang/de-de/index.html b/lang/de-de/index.html index aa0eb73..a022d0d 100644 --- a/lang/de-de/index.html +++ b/lang/de-de/index.html @@ -94,7 +94,7 @@

Instantgram

☁️ Ein Bookmarklet, um Bilder auf Instagram herunterzuladen

- [instantgram 10.0.3]
+ [instantgram 10.0.4]
Ziehe diesen Button in die Favoritenleiste deines Browsers. @@ -106,7 +106,7 @@

[instantgram]

- version + version badge

diff --git a/lang/en-us/index.html b/lang/en-us/index.html index f0ba6d3..ad9ee70 100644 --- a/lang/en-us/index.html +++ b/lang/en-us/index.html @@ -94,7 +94,7 @@

Instantgram

☁️ A bookmarklet for downloading images from Instagram.

- [instantgram 10.0.3]
+ [instantgram 10.0.4]
drag this button to the bookmark bar of your browser. @@ -106,7 +106,7 @@

[instantgram]

- version + version badge

diff --git a/lang/es-ar/index.html b/lang/es-ar/index.html index f798092..3fea666 100644 --- a/lang/es-ar/index.html +++ b/lang/es-ar/index.html @@ -94,7 +94,7 @@

Instantgram

☁️ Un bookmarklet para descargar imágenes de Instagram.

- [instantgram 10.0.3]
+ [instantgram 10.0.4]
Arrastre este botón a la barra de favoritos de su navegador. @@ -106,7 +106,7 @@

[instantgram]

- version + version badge

diff --git a/lang/pt-br/index.html b/lang/pt-br/index.html index 37e6a8c..fadeac0 100644 --- a/lang/pt-br/index.html +++ b/lang/pt-br/index.html @@ -94,7 +94,7 @@

Instantgram

☁️ Um bookmarklet para download de fotos do Instagram

- [instantgram 10.0.3]
+ [instantgram 10.0.4]
arraste o botão acima para a barra de favoritos do navegador @@ -106,7 +106,7 @@

[instantgram]

- version + version badge

diff --git a/package.json b/package.json index d45d8be..006d90a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "instantgram", - "version": "10.0.3", + "version": "10.0.4", "description": "A bookmarklet for download photos in Instagram", "author": "Matheus Falcão as of 4.0.0 Sascha Heim", "homepage": "https://thinkbig-company.github.io/instantgram/", diff --git a/src/_langs/partials/button.html b/src/_langs/partials/button.html index 9aa3071..b1948ae 100644 --- a/src/_langs/partials/button.html +++ b/src/_langs/partials/button.html @@ -1 +1 @@ -[instantgram 10.0.3] \ No newline at end of file +[instantgram 10.0.4] \ No newline at end of file diff --git a/src/helpers/getPath.ts b/src/helpers/getPath.ts new file mode 100644 index 0000000..625bd22 --- /dev/null +++ b/src/helpers/getPath.ts @@ -0,0 +1,7 @@ +export default function getPath(url, defaults) { + var reUrlPath = /(?:\w+:)?\/\/[^\/]+([^?#]+)/; + var query = /(?:\w+:)?\/\/[^\/]+([^?#]+)([^\?]+)(\?.*)?/; + var urlParts = url.match(reUrlPath) || [url, defaults]; + + return urlParts.pop() + url.match(query).pop(); +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index d04cc1b..11becea 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,3 @@ - import { Program } from './App'; import { MediaScanner } from './modules/MediaScanner'; import { ProfilePageDownload } from './modules/ProfilePageDownload'; @@ -53,11 +52,12 @@ if (program.regexHostname.test(program.hostname)) { console.log('profilePageDownload', profilePageDownload); } - program.foundVideo = profilePageDownloadProgram.foundVideo; program.foundImage = profilePageDownloadProgram.foundImage; + program.foundProfile = profilePageDownloadProgram.foundProfile; + program.foundVideo = profilePageDownloadProgram.foundVideo; program.foundByModule = profilePageDownloadProgram.foundByModule; - if (profilePageDownload == false) { + if (profilePageDownload == false && program.foundProfile) { new Modal({ heading: [ `
[instantgram] v${profilePageDownloadProgram.VERSION}
` diff --git a/src/modules/MediaScanner.ts b/src/modules/MediaScanner.ts index 6e16dc3..9dde646 100644 --- a/src/modules/MediaScanner.ts +++ b/src/modules/MediaScanner.ts @@ -2,9 +2,10 @@ import { Program } from '../App'; import { Module } from './Module'; import { Modal } from '../components/Modal'; import getHighestResImg from '../helpers/getHighestResImg'; -import isElementInViewport from '../helpers/isElementInViewport'; import getBlobVideoUrl from '../helpers/getBlobVideoUrl'; +import getPath from '../helpers/getPath'; import getPreLoader from '../helpers/getPreLoader'; +import isElementInViewport from '../helpers/isElementInViewport'; import localize from '../helpers/localize'; enum MediaType { @@ -384,7 +385,7 @@ export class MediaScanner implements Module { if (scrapedBlobVideoUrl) { /* Fix error network error since mai 2021 cannot download */ - let _newVideoUrl = scrapedBlobVideoUrl.replace(/^[^.]*/, 'https://scontent'); + let _newVideoUrl = 'https://scontent.cdninstagram.com' + getPath(scrapedBlobVideoUrl, 'unknown'); window.open(_newVideoUrl); callback(found, program); @@ -413,7 +414,7 @@ export class MediaScanner implements Module { program.foundByModule = this.getName(); /* Fix error network error since mai 2021 cannot download */ - let _newVideoUrl = mediaLink.replace(/^[^.]*/, 'https://scontent'); + let _newVideoUrl = 'https://scontent.cdninstagram.com' + getPath(mediaLink, 'unknown'); window.open(_newVideoUrl); callback(found, program); diff --git a/src/modules/ProfilePageDownload.ts b/src/modules/ProfilePageDownload.ts index 2e5d86a..ff9d92b 100644 --- a/src/modules/ProfilePageDownload.ts +++ b/src/modules/ProfilePageDownload.ts @@ -310,6 +310,7 @@ export class ProfilePageDownload implements Module { this.displayIsPrivateModal(); program.foundProfile = false; + program.foundByModule = this.getName(); callback(false, program); return;