From 200e081294618ea7f31a1f8b75f2117c7f96910a Mon Sep 17 00:00:00 2001 From: Sascha Heim Date: Sat, 10 Dec 2022 15:54:59 +0100 Subject: [PATCH] v2022.12.10 :love_you_gesture: Service update [instangram] Fixed issue #27 [Stories completely nonfunctional]. Fixed some other bugs. --- README.md | 6 ++++-- dist/main.js | 2 +- index.html | 4 ++-- lang/de-de/index.html | 4 ++-- lang/en-us/index.html | 4 ++-- lang/es-ar/index.html | 4 ++-- lang/pt-br/index.html | 4 ++-- package.json | 2 +- src/_langs/partials/button.html | 2 +- src/helpers/getDataFromIGUrl.ts | 3 --- src/modules/FeedScanner.ts | 4 ++++ src/modules/MediaScanner.ts | 23 +++++++++++++++-------- src/modules/PostScanner.ts | 4 ++++ src/modules/StoryScanner.ts | 7 ++++++- 14 files changed, 46 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index de61e01..27227ff 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# [instantgram] v2022.10.28 :rocket: Launch into the sun -![GitHub release](https://img.shields.io/badge/release-v2022.10.28-green) +# [instantgram] v2022.12.10 :rocket: Launch into the sun +![GitHub release](https://img.shields.io/badge/release-v2022.12.10-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,8 @@ With this version we support all modern browsers that have ECMAScript 2015 (es6) Read [CONTRIBUTING.md](CONTRIBUTING.md) for more information. :heart: ## Changelog +- v2022.12.10 - [instangram] Fixed issue #27 [Stories completely nonfunctional]. \ +Fixed some other bugs. - v2022.10.28 - [instangram] Support for the latest backend version of instagram. \ New versioning. Fixed stories video detection. #23 diff --git a/dist/main.js b/dist/main.js index 4a0c48e..c19191b 100644 --- a/dist/main.js +++ b/dist/main.js @@ -1 +1 @@ -(()=>{"use strict";var e;function t(e){let t;t=null!==window&&void 0!==window?{top:window.pageYOffset,bottom:window.pageYOffset+window.innerHeight}:document.documentElement;const o=e.getBoundingClientRect(),a=o.y+window.pageYOffset,n=o.y+o.height+window.pageYOffset;if(t.top>n||t.bottomn)return 100;if(at.bottom)return 100;const i=o.height;let r=i;at.bottom&&(r-=n-t.bottom);const l=r/window.innerHeight*100;return Math.round(l)}!function(e){e.Image="IMAGE",e.Video="VIDEO",e.UNDEFINED="UNDEFINED"}(e||(e={}));class o{getName(){return"FeedScanner"}async execute(o,a){try{let n,i,r,l,d=null,s=e.UNDEFINED,c=!1,m="._aagv",g="._9zm0",p="._9zm2";if(null==d){l=document.getElementsByTagName("article");let e=[];for(let o=0;o :nth-child(2) > :first-child ul > li:nth-child(2) img[crossorigin='anonymous']")||l[o].querySelector(":first-child > :nth-child(2) > :first-child ul > li:nth-child(2) video[crossorigin='anonymous']"):l[o].querySelector(":first-child > :nth-child(2) > [role=button] img[crossorigin='anonymous']")||l[o].querySelector(":first-child > :nth-child(2) video[crossorigin='anonymous']"),null!=a&&null!=typeof a.getBoundingClientRect()){let i=t(a);e.push({i1:o,mediaEl:a,elemVisiblePercentage:i,isCarousel:n})}else e.push({i1:o,mediaEl:a,elemVisiblePercentage:0,isCarousel:n})}let o=e.reduce(((e,t)=>e.elemVisiblePercentage>t.elemVisiblePercentage?e:t));r=l[o.i1],n=e[o.i1]}if(n.isCarousel){let t=Array.from(r.querySelectorAll("div > :first-child > :first-child > :first-child > ul li")).filter((e=>null!=e.firstChild&&e.classList.length>0));if(null!=t&&t.length>0){let a=Array.from(r.querySelectorAll(":first-child > div:nth-child(2) > div > div:nth-child(2) > div")).filter((e=>e.classList.length<=2));for(let e=0;e img[src]`)||null!==r.querySelector(`${m} > img[srcset]`);t?(s=e.Video,d=r.querySelector("video")):o&&(s=e.Image,d=null!==r.querySelector(`${m} > img[srcset]`)?r.querySelector(`${m} > img[srcset]`):r.querySelector(`${m} > img[src]`))}a(false,d,s,o)}catch(e){console.error(this.getName()+"()",`[instantgram] ${o.VERSION}`,e),a(!1,null,o)}}}class a{getName(){return"PostScanner"}async execute(t,o,a){try{let n,i,r=o,l=!1,d=null,s=e.UNDEFINED,c=!1,m=document.querySelector("main"),g="._aagv",p="._9zm0",h="._9zm2";if(r?(i=document.querySelectorAll('[role="dialog"]')[1],l=0!==i.querySelectorAll(p).length||0!==i.querySelectorAll(h).length):(m=document.querySelector("section main > div > :first-child"),i=m.querySelector("article"),l=0!==i.querySelectorAll(p).length||0!==i.querySelectorAll(h).length),l){let o=Array.from(i.querySelectorAll("div > :first-child > :first-child > :first-child > ul li")).filter((e=>null!=e.firstChild&&e.classList.length>0));if(null!=o&&o.length>0){let a=Array.from(i.querySelectorAll("article > :first-child > :first-child > :first-child > div:nth-child(2) > div")).filter((e=>e.classList.length<=2));for(let e=0;e img[src]`)||null!==i.querySelector(`${g} > img[srcset]`);t?(s=e.Video,d=i.querySelector("video")):o&&(s=e.Image,d=null!==i.querySelector(`${g} > img[srcset]`)?i.querySelector(`${g} > img[srcset]`):i.querySelector(`${g} > img[src]`))}a(false,d,s,t)}catch(e){console.error(this.getName()+"()",`[instantgram] ${t.VERSION}`,e),a(!1,null,t)}}}class n{getName(){return"StoryScanner"}async execute(t,o){try{let a=null,n=e.UNDEFINED,i=document.querySelector("main");i=document.querySelector("body > div");let r=i.querySelectorAll("section > div > div > div");for(let t=0;t=1&&r[t].classList.length>1){let o=null!==r[t].querySelector("video"),i=null!==r[t].querySelector("div > div img[src]")||null!==r[t].querySelector("div > div img[srcset]");0,o?(n=e.Video,a=r[t].querySelector("video")):i&&(n=e.Image,null!==r[t].querySelectorAll("img")[0]&&(a=r[t].querySelectorAll("img")[0]));break}}o(false,a,n,t)}catch(e){console.error(this.getName()+"()",`[instantgram] ${t.VERSION}`,e),o(!1,null,t)}}}class i{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 a=document.createElement("div");a.classList.add("instantgram-modal-header"),this.headingStyle.length>0&&a.setAttribute("style",this.headingStyle),o.appendChild(a),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"),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("h5");t.innerHTML=e,a.appendChild(t)}}));const n=document.createElement("div");if(n.classList.add("instantgram-modal-body"),this.contentStyle.length>0&&n.setAttribute("style",this.contentStyle),o.appendChild(n),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"),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("p");t.innerText=e,n.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(){var e;this.modal&&(this.modal.classList.remove("instantgram-modal-show"),await(e=100,new Promise((function(t){setTimeout(t,e)}))),this.modal.classList.remove("instantgram-modal-visible"),this.modal.parentNode.removeChild(this.modal),this.modal=null)}}const r=async function(e,t){if(e.src&&!e.src.startsWith("blob:"))return t(e.src),!1;const o=e[Object.keys(e).find((e=>e.includes("Instance")||e.includes("Fiber")))];if(o.return.return.memoizedProps.manifest){var a,n=(new DOMParser).parseFromString(o.return.return.memoizedProps.manifest,"text/xml"),i=Array.from(n.querySelectorAll('Representation[mimeType="video/mp4"][FBQualityClass="hd"]')).map((function(e){var t,o;return{quality:e.getAttribute("FBQualityClass"),bandwidth:parseInt(e.getAttribute("bandwidth")),baseUrl:null===(o=null===(t=e.querySelector("BaseURL"))||void 0===t?void 0:t.textContent)||void 0===o?void 0:o.trim()}})).filter((function(e){return e.baseUrl}));t(i.sort((function(e,t){return"hd"===e.quality&&"hd"!==t.quality?-1:"hd"!==e.quality&&"hd"===t.quality?1:t.bandwidth-e.bandwidth})),null===(a=i[0])||void 0===a?void 0:a.baseUrl)}else{let e,a;if(o.return.return.memoizedProps.hdSrc?(e=o.return.return.memoizedProps.hdSrc,a="hd"):o.return.return.memoizedProps.sdSrc?(e=o.return.return.memoizedProps.sdSrc,a="sd"):o.return.return.memoizedProps.children[0].props.fallbackSrc?(e=o.return.return.memoizedProps.children[0].props.fallbackSrc,a="fallback"):(e=null,a=null),e.length>80)if("fallback"==a){t("https://scontent.cdninstagram.com"+(r=o.return.return.memoizedProps.children[0].props.fallbackSrc,l="unknown",(r.match(/(?:\w+:)?\/\/[^\/]+([^?#]+)/)||[r,l]).pop()+r.match(/(?:\w+:)?\/\/[^\/]+([^?#]+)([^\?]+)(\?.*)?/).pop()))}else t(e);else t(null)}var r,l;return!1};const l=e=>new Promise(((t,o)=>{const a=new Image;a.onload=()=>{const{naturalWidth:e,naturalHeight:o}=a;t({width:e,height:o})},a.onerror=()=>{o("There was some problem with the image.")},a.src=e})),d={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@profilepage_downloader_disabled":"Sorry the ProfilePage downloader is currently disabled because instagram changed their system.\n\nMaybe in the future there will be a solution to fix the problem.","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@profilepage_downloader_disabled":"Lo siento, la descarga de ProfilePage está deshabilitada actualmente porque Instagram cambió su sistema.\n\nTal vez en el futuro haya una solución para solucionar el problema.","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@profilepage_downloader_disabled":"Leider ist der ProfilePage-Downloader derzeit deaktiviert, da Instagram sein System geändert hat.\n\nVielleicht gibt es in Zukunft eine Lösung für dieses Problem.","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@profilepage_downloader_disabled":"Lamentamos que o programa de download ProfilePage esteja atualmente desativado porque o programa mudou seu sistema.\n\nTalvez, no futuro, haja uma solução para resolver o problema.","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 s=navigator.language;-1!==s.indexOf("-")&&(s=s.split("-")[0]),-1!==s.indexOf("_")&&(s=s.split("_")[0]);const c={de:"de-DE",en:"en-US",es:"es-AR",pt:"pt-BR"}[s];function m(e,t=c){try{return d.langs.hasOwnProperty(t)||(t="en-US"),d.langs[t][e]?d.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(m("helpers.localize_defaultlang").replace("${LANG_DEFAULT}",c));const g=m;class p{constructor(){this.modal=new i}getName(){return"MediaScanner"}async execute(t,i){let d=!1;try{let c=!1,m={mediaEl:void 0,mediaType:e.UNDEFINED},p=null;if(t.regexProfilePath.test(t.path))return d=!1,t.foundImage=!1,t.foundVideo=!1,t.foundByModule=void 0,void i(d,null,t);switch(t.regexStoriesURI.test(t.path)&&(new n).execute(t,(function(e,t,o,a){m.mediaEl=t,m.mediaType=o})),null==m.mediaEl&&(c=document.querySelectorAll('[role="dialog"]').length>0,t.regexRootPath.test(t.path)&&(new o).execute(t,(function(e,t,o,a){m.mediaEl=t,m.mediaType=o})),t.regexPostPath.test(t.path)&&(new a).execute(t,c,(function(e,t,o,a){m.mediaEl=t,m.mediaType=o}))),m.mediaType){case e.Image:var s=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 o,a=0,n="";for(let e=0;ea&&(a=o,n=t[e][0])}return n.length>0&&n}return!!(e.hasAttribute("src")&&e.getAttribute("src").length>0)&&e.getAttribute("src")}(m.mediaEl);"string"==typeof s&&(p=s),null!=p&&p.length>10?(d=!0,t.foundImage=!0,t.foundVideo=!1,t.foundByModule=this.getName(),i(d,p,t)):(d=!1,t.foundImage=!1,t.foundVideo=!1,t.foundByModule=void 0,i(d,null,t));break;case e.Video:if(void 0===m.mediaEl.src||0==m.mediaEl.src.length?(m.mediaEl=m.mediaEl.querySelectorAll("source"),p=m.mediaEl[0].src):p=m.mediaEl.src,null!=p&&p.length>10){let e=this;r(m.mediaEl,(function(o){let a;d=!0,t.foundImage=!1,t.foundVideo=!0,t.foundByModule=e.getName(),a="string"==typeof o||o instanceof String?o:o[0].baseUrl&&o[0].baseUrl.length>80?o[0].baseUrl:null,a?i(d,a,t):(e.modal.heading=[`
[instantgram] v${t.VERSION}
`],e.modal.content=[g("index#program#blob@alert_cannotDownload")],e.modal.contentStyle="text-align:center",e.modal.buttonList=[{active:!0,text:"Ok"}],e.modal.open(),i(d,null,t))}))}else d=!1,t.foundImage=!1,t.foundVideo=!1,t.foundByModule=void 0,i(d,null,t);break;default:d=!1,t.foundImage=!1,t.foundVideo=!1,t.foundByModule=void 0,i(d,null,t)}}catch(e){console.error(this.getName()+"()",`[instantgram] ${t.VERSION}`,e),i(!1,null,t)}}}const h=function(){const e=/^(<|>|[=!<>]=)?\s*(\d+(?:\.\d+){0,2})([a-z][a-z0-9\-]*)?$/i;function t(t,o){let a=(t+"").match(e);return a?(o?a[1]||"==":"")+'"'+(a[2]+".0.0").match(/\d+(?:\.\d+){0,2}/)[0].replace(/(?:^|\.)(\d+)/g,(function(e,t){return Array(9-t.length).join("0")+t}))+(a[3]||"~")+'"':o?"==0":1}return function(e,...o){e=t(e,null);for(var a,n=1;a=arguments[n++];)if(!new Function("return "+e+t(a,1))())return!1;return!0}}();function u(e){console.warn(g("modules.update@consoleWarnOutdatedInfo")),console.warn(g("modules.update@consoleWarnOutdatedInfoVersions").replace("${data.version}",e.version).replace("${data.onlineVersion}",e.onlineVersion))}const f=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})),h(o.onlineVersion,"> "+o.version)&&u(o),Date.now()>o.dateExpiration}return!0})(e)&&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(t){let o=t.data.user.edge_owner_to_timeline_media.edges[0].node.edge_media_to_caption.edges[0].node.text,a=o.match(/(\*|\d+(\.\d+){0,2}(\.\*)?)+/gm)[0],n=new Date;if(n.setTime(n.getTime()+216e5),window.localStorage.setItem("instantgram",JSON.stringify({version:e,onlineVersion:a,lastVerification:Date.now(),dateExpiration:n.valueOf()})),console.info(g("modules.update@determineIfGetUpdateIsNecessary_updated")),h(a,"> "+e)){new i({heading:[`
[instantgram] v${e}
`],content:[`
Es ist ein neues Update verfügbar v${a}
`,"
","
","

Changelog

"+o.split("Changelog ")[1]+"
","
",""+g("modules.update@determineIfGetUpdateIsNecessary_@load_update")+"",""],buttonList:[{active:!0,text:"Ok"}]}).open(),u(JSON.parse(window.localStorage.getItem("instantgram")))}else console.info(window.localStorage.getItem("instantgram"))})).catch((e=>{console.error("Error:",e)}))};var w=function(e,t,o){if(o||2===arguments.length)for(var a,n=0,i=t.length;n[instantgram] ProfilePage downloader v${O.VERSION}`],content:[g("index@profilepage_downloader_disabled")],contentStyle:"text-align:center",buttonList:[{active:!0,text:"Ok"}]}).open()),e&&null!==t&&window.open(t),null==O.foundByModule&&0==O.foundVideo&&0==O.foundImage&&new i({heading:[`
[instantgram] v${O.VERSION}
`],content:[g("index#program@alert_dontFound")],contentStyle:"text-align:center",buttonList:[{active:!0,text:"Ok"}]}).open()})),f(O.VERSION)):new i({heading:[`
[instantgram] v${O.VERSION}
`],content:[g("index@alert_onlyWorks")],contentStyle:"text-align:center",buttonList:[{active:!0,text:"Ok"}]}).open()})(); \ No newline at end of file +(()=>{"use strict";var e;function t(e){let t;t=null!==window&&void 0!==window?{top:window.pageYOffset,bottom:window.pageYOffset+window.innerHeight}:document.documentElement;const o=e.getBoundingClientRect(),n=o.y+window.pageYOffset,a=o.y+o.height+window.pageYOffset;if(t.top>a||t.bottoma)return 100;if(nt.bottom)return 100;const i=o.height;let r=i;nt.bottom&&(r-=a-t.bottom);const l=r/window.innerHeight*100;return Math.round(l)}!function(e){e.Image="IMAGE",e.Video="VIDEO",e.UNDEFINED="UNDEFINED"}(e||(e={}));class o{getName(){return"FeedScanner"}async execute(o,n){let a=!1;try{let i,r,l,d,s=null,c=e.UNDEFINED,m=!1,g="._aagv",p="._9zm0",h="._9zm2";if(null==s){d=document.getElementsByTagName("article");let e=[];for(let o=0;o :nth-child(2) > :first-child ul > li:nth-child(2) img[crossorigin='anonymous']")||d[o].querySelector(":first-child > :nth-child(2) > :first-child ul > li:nth-child(2) video[crossorigin='anonymous']"):d[o].querySelector(":first-child > :nth-child(2) > [role=button] img[crossorigin='anonymous']")||d[o].querySelector(":first-child > :nth-child(2) video[crossorigin='anonymous']"),null!=n&&null!=typeof n.getBoundingClientRect()){let i=t(n);e.push({i1:o,mediaEl:n,elemVisiblePercentage:i,isCarousel:a})}else e.push({i1:o,mediaEl:n,elemVisiblePercentage:0,isCarousel:a})}let o=e.reduce(((e,t)=>e.elemVisiblePercentage>t.elemVisiblePercentage?e:t));l=d[o.i1],i=e[o.i1]}if(i.isCarousel){let t=Array.from(l.querySelectorAll("div > :first-child > :first-child > :first-child > ul li")).filter((e=>null!=e.firstChild&&e.classList.length>0));if(null!=t&&t.length>0){let n=Array.from(l.querySelectorAll(":first-child > div:nth-child(2) > div > div:nth-child(2) > div")).filter((e=>e.classList.length<=2));for(let e=0;e img[src]`)||null!==l.querySelector(`${g} > img[srcset]`);t?(c=e.Video,s=l.querySelector("video")):o&&(c=e.Image,s=null!==l.querySelector(`${g} > img[srcset]`)?l.querySelector(`${g} > img[srcset]`):l.querySelector(`${g} > img[src]`))}(c==e.Image||c==e.Video&&s)&&(a=!0),n(a,s,c,o)}catch(e){console.error(this.getName()+"()",`[instantgram] ${o.VERSION}`,e),n(!1,null,o)}}}class n{getName(){return"PostScanner"}async execute(t,o,n){let a=!1;try{let i,r,l=o,d=!1,s=null,c=e.UNDEFINED,m=!1,g=document.querySelector("main"),p="._aagv",h="._9zm0",u="._9zm2";if(l?(r=document.querySelectorAll('[role="dialog"]')[1],d=0!==r.querySelectorAll(h).length||0!==r.querySelectorAll(u).length):(g=document.querySelector("section main > div > :first-child"),r=g.querySelector("article"),d=0!==r.querySelectorAll(h).length||0!==r.querySelectorAll(u).length),d){let o=Array.from(r.querySelectorAll("div > :first-child > :first-child > :first-child > ul li")).filter((e=>null!=e.firstChild&&e.classList.length>0));if(null!=o&&o.length>0){let n=Array.from(r.querySelectorAll("article > :first-child > :first-child > :first-child > div:nth-child(2) > div")).filter((e=>e.classList.length<=2));for(let e=0;e img[src]`)||null!==r.querySelector(`${p} > img[srcset]`);t?(c=e.Video,s=r.querySelector("video")):o&&(c=e.Image,s=null!==r.querySelector(`${p} > img[srcset]`)?r.querySelector(`${p} > img[srcset]`):r.querySelector(`${p} > img[src]`))}(c==e.Image||c==e.Video&&s)&&(a=!0),n(a,s,c,t)}catch(e){console.error(this.getName()+"()",`[instantgram] ${t.VERSION}`,e),n(!1,null,t)}}}class a{getName(){return"StoryScanner"}async execute(t,o){let n=!1;try{let a=null,i=e.UNDEFINED,r=document.querySelector("main");r=document.querySelector("body > div:nth-child(2)");let l=r.querySelectorAll("section > div > div > div");for(let t=0;t=1&&l[t].classList.length>1){let o=null!==l[t].querySelector("video"),n=null!==l[t].querySelector("div > div img[src]")||null!==l[t].querySelector("div > div img[srcset]");0,o?(i=e.Video,a=l[t].querySelector("video")):n&&(i=e.Image,null!==l[t].querySelectorAll("img")[0]&&(a=l[t].querySelectorAll("img")[0]));break}}(i==e.Image||i==e.Video&&a)&&(n=!0),o(n,a,i,t)}catch(e){console.error(this.getName()+"()",`[instantgram] ${t.VERSION}`,e),o(!1,null,t)}}}class i{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(){var e;this.modal&&(this.modal.classList.remove("instantgram-modal-show"),await(e=100,new Promise((function(t){setTimeout(t,e)}))),this.modal.classList.remove("instantgram-modal-visible"),this.modal.parentNode.removeChild(this.modal),this.modal=null)}}function r(e,t){return(e.match(/(?:\w+:)?\/\/[^\/]+([^?#]+)/)||[e,t]).pop()+e.match(/(?:\w+:)?\/\/[^\/]+([^?#]+)([^\?]+)(\?.*)?/).pop()}const l=async function(e,t){if(e.src&&!e.src.startsWith("blob:"))return t(e.src),!1;const o=e[Object.keys(e).find((e=>e.includes("Instance")||e.includes("Fiber")))];if(o.return.return.memoizedProps.manifest){var n,a=(new DOMParser).parseFromString(o.return.return.memoizedProps.manifest,"text/xml"),i=Array.from(a.querySelectorAll('Representation[mimeType="video/mp4"][FBQualityClass="hd"]')).map((function(e){var t,o;return{quality:e.getAttribute("FBQualityClass"),bandwidth:parseInt(e.getAttribute("bandwidth")),baseUrl:null===(o=null===(t=e.querySelector("BaseURL"))||void 0===t?void 0:t.textContent)||void 0===o?void 0:o.trim()}})).filter((function(e){return e.baseUrl}));t(i.sort((function(e,t){return"hd"===e.quality&&"hd"!==t.quality?-1:"hd"!==e.quality&&"hd"===t.quality?1:t.bandwidth-e.bandwidth})),null===(n=i[0])||void 0===n?void 0:n.baseUrl)}else{let e,n;if(o.return.return.memoizedProps.hdSrc?(e=o.return.return.memoizedProps.hdSrc,n="hd"):o.return.return.memoizedProps.sdSrc?(e=o.return.return.memoizedProps.sdSrc,n="sd"):o.return.return.memoizedProps.children[0].props.fallbackSrc?(e=o.return.return.memoizedProps.children[0].props.fallbackSrc,n="fallback"):(e=null,n=null),e.length>80)if("fallback"==n){t("https://scontent.cdninstagram.com"+r(o.return.return.memoizedProps.children[0].props.fallbackSrc,"unknown"))}else t(e);else t(null)}return!1};const d=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})),s={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@profilepage_downloader_disabled":"Sorry the ProfilePage downloader is currently disabled because instagram changed their system.\n\nMaybe in the future there will be a solution to fix the problem.","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@profilepage_downloader_disabled":"Lo siento, la descarga de ProfilePage está deshabilitada actualmente porque Instagram cambió su sistema.\n\nTal vez en el futuro haya una solución para solucionar el problema.","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@profilepage_downloader_disabled":"Leider ist der ProfilePage-Downloader derzeit deaktiviert, da Instagram sein System geändert hat.\n\nVielleicht gibt es in Zukunft eine Lösung für dieses Problem.","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@profilepage_downloader_disabled":"Lamentamos que o programa de download ProfilePage esteja atualmente desativado porque o programa mudou seu sistema.\n\nTalvez, no futuro, haja uma solução para resolver o problema.","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 c=navigator.language;-1!==c.indexOf("-")&&(c=c.split("-")[0]),-1!==c.indexOf("_")&&(c=c.split("_")[0]);const m={de:"de-DE",en:"en-US",es:"es-AR",pt:"pt-BR"}[c];function g(e,t=m){try{return s.langs.hasOwnProperty(t)||(t="en-US"),s.langs[t][e]?s.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(g("helpers.localize_defaultlang").replace("${LANG_DEFAULT}",m));const p=g;class h{constructor(){this.modal=new i}getName(){return"MediaScanner"}async execute(t,i){let s=!1;try{let m=!1,g={mediaEl:void 0,mediaType:e.UNDEFINED},h=null;if(t.regexProfilePath.test(t.path))return s=!1,t.foundImage=!1,t.foundVideo=!1,t.foundByModule=void 0,void i(s,null,t);switch(t.regexStoriesURI.test(t.path)&&(new a).execute(t,(function(e,o,n,i){g.mediaEl=o,g.mediaType=n,e&&(t.foundByModule=(new a).getName())})),null==g.mediaEl&&(m=document.querySelectorAll('[role="dialog"]').length>0,t.regexRootPath.test(t.path)&&(new o).execute(t,(function(e,n,a,i){g.mediaEl=n,g.mediaType=a,e&&(t.foundByModule=(new o).getName())})),t.regexPostPath.test(t.path)&&(new n).execute(t,m,(function(e,o,a,i){g.mediaEl=o,g.mediaType=a,e&&(t.foundByModule=(new n).getName())}))),g.mediaType){case e.Image:var c=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 o,n=0,a="";for(let e=0;en&&(n=o,a=t[e][0])}return a.length>0&&a}return!!(e.hasAttribute("src")&&e.getAttribute("src").length>0)&&e.getAttribute("src")}(g.mediaEl);"string"==typeof c&&(h=c),null!=h&&h.length>10?(s=!0,t.foundImage=!0,t.foundVideo=!1,i(s,h,t)):(s=!1,t.foundImage=!1,t.foundVideo=!1,i(s,null,t));break;case e.Video:if(void 0===g.mediaEl.src||0==g.mediaEl.src.length?(g.mediaEl=g.mediaEl.querySelectorAll("source"),h=g.mediaEl[0].src):h=g.mediaEl.src,null!=h&&h.length>10){let e=this;l(g.mediaEl,(function(o){let n;s=!0,t.foundImage=!1,t.foundVideo=!0,n="string"==typeof o||o instanceof String?o:o[0].baseUrl&&o[0].baseUrl.length>80?o[0].baseUrl:null,n="https://scontent.cdninstagram.com"+r(n,"unknown"),n?i(s,n,t):(e.modal.heading=[`
[instantgram] v${t.VERSION}
`],e.modal.content=[p("index#program#blob@alert_cannotDownload")],e.modal.contentStyle="text-align:center",e.modal.buttonList=[{active:!0,text:"Ok"}],e.modal.open(),i(s,null,t))}))}else s=!1,t.foundImage=!1,t.foundVideo=!1,t.foundByModule=void 0,i(s,null,t);break;default:s=!1,t.foundImage=!1,t.foundVideo=!1,t.foundByModule=void 0,i(s,null,t)}}catch(e){console.error(this.getName()+"()",`[instantgram] ${t.VERSION}`,e),i(!1,null,t)}}}const u=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(p("modules.update@consoleWarnOutdatedInfo")),console.warn(p("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})),u(o.onlineVersion,"> "+o.version)&&f(o),Date.now()>o.dateExpiration}return!0})(e)&&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(t){let o=t.data.user.edge_owner_to_timeline_media.edges[0].node.edge_media_to_caption.edges[0].node.text,n=o.match(/(\*|\d+(\.\d+){0,2}(\.\*)?)+/gm)[0],a=new Date;if(a.setTime(a.getTime()+216e5),window.localStorage.setItem("instantgram",JSON.stringify({version:e,onlineVersion:n,lastVerification:Date.now(),dateExpiration:a.valueOf()})),console.info(p("modules.update@determineIfGetUpdateIsNecessary_updated")),u(n,"> "+e)){new i({heading:[`
[instantgram] v${e}
`],content:[`
Es ist ein neues Update verfügbar v${n}
`,"
","
","

Changelog

"+o.split("Changelog ")[1]+"
","
",""+p("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)}))};var b=function(e,t,o){if(o||2===arguments.length)for(var n,a=0,i=t.length;a[instantgram] ProfilePage downloader v${O.VERSION}`],content:[p("index@profilepage_downloader_disabled")],contentStyle:"text-align:center",buttonList:[{active:!0,text:"Ok"}]}).open()),e&&null!==t&&window.open(t),null==O.foundByModule&&0==O.foundVideo&&0==O.foundImage&&new i({heading:[`
[instantgram] v${O.VERSION}
`],content:[p("index#program@alert_dontFound")],contentStyle:"text-align:center",buttonList:[{active:!0,text:"Ok"}]}).open()})),w(O.VERSION)):new i({heading:[`
[instantgram] v${O.VERSION}
`],content:[p("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 f8330ed..dc1abe1 100644 --- a/index.html +++ b/index.html @@ -94,7 +94,7 @@

Instantgram

☁️ A bookmarklet for downloading images from Instagram.

- [instantgram 2022.10.28]
+ [instantgram 2022.12.10]
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 ab5b53a..df1e46f 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 2022.10.28]
+ [instantgram 2022.12.10]
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 f8330ed..dc1abe1 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 2022.10.28]
+ [instantgram 2022.12.10]
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 5a1d1d0..9e6c7c0 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 2022.10.28]
+ [instantgram 2022.12.10]
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 758c509..110afdd 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 2022.10.28]
+ [instantgram 2022.12.10]
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 7468e58..9130453 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "instantgram", - "version": "2022.10.28", + "version": "2022.12.10", "description": "A bookmarklet for download photos in Instagram", "author": "Matheus Falcão and from 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 b37174e..d2c4ba8 100644 --- a/src/_langs/partials/button.html +++ b/src/_langs/partials/button.html @@ -1 +1 @@ -[instantgram 2022.10.28] \ No newline at end of file +[instantgram 2022.12.10] \ No newline at end of file diff --git a/src/helpers/getDataFromIGUrl.ts b/src/helpers/getDataFromIGUrl.ts index 56140e6..c43931e 100644 --- a/src/helpers/getDataFromIGUrl.ts +++ b/src/helpers/getDataFromIGUrl.ts @@ -11,13 +11,10 @@ export default async function getDataFromIGUrl(url: string, query: string, neede let jsonData = JSON.parse(data) posts = posts.concat(jsonData.data) - console.log(data.includes(neededFilename)) - if (jsonData.data.user.edge_owner_to_timeline_media.page_info.has_next_page && !data.includes(neededFilename)) { //let urlQueryObj = getUrlParams(url) let parsedQueryParams = JSON.parse(query) - console.log(parsedQueryParams) parsedQueryParams.after = jsonData.data.user.edge_owner_to_timeline_media.page_info.end_cursor getDataFromIGUrl(url, String(`${JSON.stringify(parsedQueryParams)}`), neededFilename, posts).then(resolve).catch(reject) diff --git a/src/modules/FeedScanner.ts b/src/modules/FeedScanner.ts index 1d6c564..9d8b213 100644 --- a/src/modules/FeedScanner.ts +++ b/src/modules/FeedScanner.ts @@ -349,6 +349,10 @@ export class FeedScanner implements Module { } } + if (mediaType == MediaType.Image || mediaType == MediaType.Video && mediaEl) { + found = true + } + callback(found, mediaEl, mediaType, program) } catch (e) { console.error(this.getName() + "()", `[instantgram] ${program.VERSION}`, e) diff --git a/src/modules/MediaScanner.ts b/src/modules/MediaScanner.ts index e81b404..0e19ffc 100644 --- a/src/modules/MediaScanner.ts +++ b/src/modules/MediaScanner.ts @@ -34,11 +34,6 @@ export class MediaScanner implements Module { } let mediaURL: string = null - let selectedCarouselIndex: number - - // Articles - var $articles: Element | NodeListOf - // Handle specific modules if (program.regexProfilePath.test(program.path)) { found = false @@ -55,6 +50,10 @@ export class MediaScanner implements Module { new StoryScanner().execute(program, function (_scannerFound: boolean, foundMediaElem: any, foundMediaType: MediaType, _scannerProgram: Program) { mediaObj.mediaEl = foundMediaElem mediaObj.mediaType = foundMediaType + + if (_scannerFound) { + program.foundByModule = new StoryScanner().getName() + } }) } @@ -66,6 +65,10 @@ export class MediaScanner implements Module { new FeedScanner().execute(program, function (_scannerFound: boolean, foundMediaElem: any, foundMediaType: MediaType, _scannerProgram: Program) { mediaObj.mediaEl = foundMediaElem mediaObj.mediaType = foundMediaType + + if (_scannerFound) { + program.foundByModule = new FeedScanner().getName() + } }) } @@ -73,6 +76,10 @@ export class MediaScanner implements Module { new PostScanner().execute(program, isModal, function (_scannerFound: boolean, foundMediaElem: any, foundMediaType: MediaType, _scannerProgram: Program) { mediaObj.mediaEl = foundMediaElem mediaObj.mediaType = foundMediaType + + if (_scannerFound) { + program.foundByModule = new PostScanner().getName() + } }) } } @@ -89,14 +96,12 @@ export class MediaScanner implements Module { found = true program.foundImage = true program.foundVideo = false - program.foundByModule = this.getName() callback(found, mediaURL, program) } else { found = false program.foundImage = false program.foundVideo = false - program.foundByModule = undefined callback(found, null, program) } @@ -116,7 +121,6 @@ export class MediaScanner implements Module { found = true program.foundImage = false program.foundVideo = true - program.foundByModule = that.getName() let videoURL if (typeof callbackData === 'string' || callbackData instanceof String) { @@ -125,6 +129,9 @@ export class MediaScanner implements Module { videoURL = callbackData[0].baseUrl && callbackData[0].baseUrl.length > 80 ? callbackData[0].baseUrl : null } + /* Fix error network error since mai 2021 cannot download */ + videoURL = "https://scontent.cdninstagram.com" + getPath(videoURL, "unknown") + if (videoURL) { callback(found, videoURL, program) } else { diff --git a/src/modules/PostScanner.ts b/src/modules/PostScanner.ts index 18ba43e..8552507 100644 --- a/src/modules/PostScanner.ts +++ b/src/modules/PostScanner.ts @@ -476,6 +476,10 @@ export class PostScanner implements Module { } } + if (mediaType == MediaType.Image || mediaType == MediaType.Video && mediaEl) { + found = true + } + callback(found, mediaEl, mediaType, program) } catch (e) { console.error(this.getName() + "()", `[instantgram] ${program.VERSION}`, e) diff --git a/src/modules/StoryScanner.ts b/src/modules/StoryScanner.ts index c26f85c..e3fdbad 100644 --- a/src/modules/StoryScanner.ts +++ b/src/modules/StoryScanner.ts @@ -23,9 +23,10 @@ export class StoryScanner implements Module { let $container = document.querySelector("main") // Scanner begins - $container = document.querySelector("body > div") + $container = document.querySelector("body > div:nth-child(2)") let storys = $container.querySelectorAll("section > div > div > div") + for (let i = 0; i < (storys).length; i++) { let scaleX = Number((Math.round((storys[i].getBoundingClientRect().width / (storys[i]).offsetWidth) * 100) / 100).toFixed(2)) @@ -59,6 +60,10 @@ export class StoryScanner implements Module { } } + if (mediaType == MediaType.Image || mediaType == MediaType.Video && mediaEl) { + found = true + } + callback(found, mediaEl, mediaType, program) } catch (e) { console.error(this.getName() + "()", `[instantgram] ${program.VERSION}`, e)