diff --git a/README.md b/README.md index d8e1261..de61e01 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# [instantgram] v12.1.0 :rocket: Launch to the moon -![GitHub release](https://img.shields.io/badge/release-v12.1.0-green) +# [instantgram] v2022.10.28 :rocket: Launch into the sun +![GitHub release](https://img.shields.io/badge/release-v2022.10.28-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,10 @@ With this version we support all modern browsers that have ECMAScript 2015 (es6) Read [CONTRIBUTING.md](CONTRIBUTING.md) for more information. :heart: ## Changelog +- v2022.10.28 - [instangram] Support for the latest backend version of instagram. \ +New versioning. +Fixed stories video detection. #23 +Fixed wrong order capturing. #24 - v12.1.0 - [instangram] Support for the latest backend version of instagram. - v12.0.0 - [instangram] Rewrite of instantgram to support last backend of insta. \ Profile page bulk downloader dropped because insta deleted all api around them. diff --git a/dist/main.js b/dist/main.js index ab88a6d..4a0c48e 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 l=i;at.bottom&&(l-=n-t.bottom);const r=l/window.innerHeight*100;return Math.round(r)}!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,l,r,d=null,s=e.UNDEFINED,c=!1,m="._aagv",g="._9zm0",p="._9zm2";if(null==d){r=document.getElementsByTagName("article");let e=[];for(let o=0;o :nth-child(2) > :first-child ul > li:nth-child(2) img[crossorigin='anonymous']")||r[o].querySelector(":first-child > :nth-child(2) > :first-child ul > li:nth-child(2) video[crossorigin='anonymous']"):r[o].querySelector(":first-child > :nth-child(2) > [role=button] img[crossorigin='anonymous']")||r[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));l=r[o.i1],n=e[o.i1]}if(n.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 a=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(`${m} > img[srcset]`);t?(s=e.Video,d=l.querySelector("video")):o&&(s=e.Image,d=null!==l.querySelector(`${m} > img[srcset]`)?l.querySelector(`${m} > img[srcset]`):l.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,l=o,r=!1,d=null,s=e.UNDEFINED,c=!1,m=document.querySelector("main"),g="._aagv",p="._9zm0",h="._9zm2";if(l?(i=document.querySelectorAll('[role="dialog"]')[1],r=0!==i.querySelectorAll(p).length||0!==i.querySelectorAll(h).length):(m=document.querySelector("section main > div > :first-child"),i=m.querySelector("article"),r=0!==i.querySelectorAll(p).length||0!==i.querySelectorAll(h).length),r){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 l=i.querySelectorAll("section > div > div > div");for(let t=0;t=1&&l[t].classList.length>1){let o=null!==l[t].querySelector("video"),i=null!==l[t].querySelector("div > div img[src]")||null!==l[t].querySelector("div > div img[srcset]");0,o&&i?(n=e.Video,a=l[t].querySelector("video")):i&&(n=e.Image,null!==l[t].querySelectorAll("img")[0]&&(a=l[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)}}async function l(e,t,o,a=[]){return new Promise(((n,i)=>fetch(e+t).then((r=>{if(200!==r.status)throw`${r.status}: ${r.statusText}`;r.text().then((r=>{let d=JSON.parse(r);if(a=a.concat(d.data),console.log(r.includes(o)),d.data.user.edge_owner_to_timeline_media.page_info.has_next_page&&!r.includes(o)){let r=JSON.parse(t);console.log(r),r.after=d.data.user.edge_owner_to_timeline_media.page_info.end_cursor,l(e,String(`${JSON.stringify(r)}`),o,a).then(n).catch(i)}else n(a)})).catch(i)})).catch(i)))}function r(e){if("string"!=typeof e)throw new Error("url must be a string");return e.replace(/\?.*$/,"").split("/").pop().replace(/\.[^.]+$/,"")}const d=async function(e,t,o,a){const n=e[Object.keys(e).find((e=>e.includes("Instance")||e.includes("Fiber")))].return.memoizedProps.fallbackSrc;if(n)return a(n),!0;{let n=null!=o,i=r(e.poster);if(null!==t){let e=null,o="";if(void 0!==t&&t.length>0){let e=[];for(let o=0;o div > div > div > div > span > a")[0].href}else o=t.querySelectorAll("header > div > div > div > div > span > a")[0].href;0;let d=await async function(e){let t=await fetch(e);if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.text()}(o);if(d){let t;d=d.replace(/(\r\n|\n|\r)/gm,"");let o=/profilePage_([0-9]+)/gm;for(;null!==(t=o.exec(d));)t.index===o.lastIndex&&o.lastIndex++,t.forEach((t=>{e=t}))}0;let s=null;if(e){const t=`{"id":${e},"first":100}`;let o=await l("https://www.instagram.com/graphql/query/?query_hash=003056d32c2554def87228bc3fd9668a&variables=",t,i);if(o){let e=o[o.length-1];for(let t=0;tnew 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}));function c(e,t){return(e.match(/(?:\w+:)?\/\/[^\/]+([^?#]+)/)||[e,t]).pop()+e.match(/(?:\w+:)?\/\/[^\/]+([^?#]+)([^\?]+)(\?.*)?/).pop()}const m={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 g=navigator.language;-1!==g.indexOf("-")&&(g=g.split("-")[0]),-1!==g.indexOf("_")&&(g=g.split("_")[0]);const p={de:"de-DE",en:"en-US",es:"es-AR",pt:"pt-BR"}[g];function h(e,t=p){try{return m.langs.hasOwnProperty(t)||(t="en-US"),m.langs[t][e]?m.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(h("helpers.localize_defaultlang").replace("${LANG_DEFAULT}",p));const u=h;class f{constructor(){this.modal=new i}getName(){return"MediaScanner"}async execute(t,i){let l=!1;try{let m,g=!1,p={mediaEl:void 0,mediaType:e.UNDEFINED},h=null;if(t.regexProfilePath.test(t.path))return l=!1,t.foundImage=!1,t.foundVideo=!1,t.foundByModule=void 0,void i(l,null,t);switch(t.regexStoriesURI.test(t.path)&&(new n).execute(t,(function(e,t,o,a){p.mediaEl=t,p.mediaType=o})),null==p.mediaEl&&(g=document.querySelectorAll('[role="dialog"]').length>0,t.regexRootPath.test(t.path)&&(new o).execute(t,(function(e,t,o,a){p.mediaEl=t,p.mediaType=o})),t.regexPostPath.test(t.path)&&(new a).execute(t,g,(function(e,t,o,a){p.mediaEl=t,p.mediaType=o}))),p.mediaType){case e.Image:var 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 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")}(p.mediaEl);"string"==typeof r&&(h=r),null!=h&&h.length>10?(l=!0,t.foundImage=!0,t.foundVideo=!1,t.foundByModule=this.getName(),i(l,h,t)):(l=!1,t.foundImage=!1,t.foundVideo=!1,t.foundByModule=void 0,i(l,null,t));break;case e.Video:if(void 0===p.mediaEl.src||0==p.mediaEl.src.length?(p.mediaEl=p.mediaEl.querySelectorAll("source"),h=p.mediaEl[0].src):h=p.mediaEl.src,null!=h&&h.length>10)if(-1!==h.indexOf("blob:")){const e=this;l=!0,t.foundImage=!1,t.foundVideo=!0,t.foundByModule=e.getName(),this.modal.heading=[`
[instantgram] v${t.VERSION}
`],this.modal.content=["

Loading

","

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

"],this.modal.open(),setTimeout((function(){d(p.mediaEl,undefined,m,(function(o){if(o){e.modal.close();let a="https://scontent.cdninstagram.com"+c(o,"unknown");i(l,a,t)}else e.modal.heading=[`
[instantgram] v${t.VERSION}
`],e.modal.content=[u("index#program#blob@alert_cannotDownload")],e.modal.contentStyle="text-align:center",e.modal.buttonList=[{active:!0,text:"Ok"}],e.modal.open(),i(l,null,t)}))}),500)}else{h=h.replace("amp","&"),l=!0,t.foundImage=!1,t.foundVideo=!0,t.foundByModule=this.getName();let e="https://scontent.cdninstagram.com"+c(h,"unknown");i(l,e,t)}else l=!1,t.foundImage=!1,t.foundVideo=!1,t.foundByModule=void 0,i(l,null,t);break;default:l=!1,t.foundImage=!1,t.foundVideo=!1,t.foundByModule=void 0,i(l,null,t)}}catch(e){console.error(this.getName()+"()",`[instantgram] ${t.VERSION}`,e),i(!1,null,t)}}}const _=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 w(e){console.warn(u("modules.update@consoleWarnOutdatedInfo")),console.warn(u("modules.update@consoleWarnOutdatedInfoVersions").replace("${data.version}",e.version).replace("${data.onlineVersion}",e.onlineVersion))}const b=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})),_(o.onlineVersion,"> "+o.version)&&w(o),Date.now()>o.dateExpiration}return!0})(e)&&(console.info(u("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(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.setDate(n.getDate()+2),window.localStorage.setItem("instantgram",JSON.stringify({version:e,onlineVersion:a,lastVerification:Date.now(),dateExpiration:n.valueOf()})),console.info(u("modules.update@determineIfGetUpdateIsNecessary_updated")),_(a,"> "+e)){new i({heading:[`
[instantgram] v${e}
`],content:[`
Es ist ein neues Update verfügbar v${a}
`,"
","
","

Changelog

"+o.split("Changelog ")[1]+"
","
",""+u("modules.update@determineIfGetUpdateIsNecessary_@load_update")+"",""],buttonList:[{active:!0,text:"Ok"}]}).open(),w(JSON.parse(window.localStorage.getItem("instantgram")))}else console.info(window.localStorage.getItem("instantgram"))})).catch((e=>{console.error("Error:",e)})))};var y=function(e,t,o){if(o||2===arguments.length)for(var a,n=0,i=t.length;n[instantgram] ProfilePage downloader v${A.VERSION}`],content:[u("index@profilepage_downloader_disabled")],contentStyle:"text-align:center",buttonList:[{active:!0,text:"Ok"}]}).open()),e&&null!==t&&window.open(t),null==A.foundByModule&&0==A.foundVideo&&0==A.foundImage&&new i({heading:[`
[instantgram] v${A.VERSION}
`],content:[u("index#program@alert_dontFound")],contentStyle:"text-align:center",buttonList:[{active:!0,text:"Ok"}]}).open()})),b(A.VERSION)):new i({heading:[`
[instantgram] v${A.VERSION}
`],content:[u("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(),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 diff --git a/index.html b/index.html index f30254e..f8330ed 100644 --- a/index.html +++ b/index.html @@ -94,7 +94,7 @@

Instantgram

☁️ A bookmarklet for downloading images from Instagram.

- [instantgram 12.1.0]
+ [instantgram 2022.10.28]
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 6b340c9..ab5b53a 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 12.1.0]
+ [instantgram 2022.10.28]
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 f30254e..f8330ed 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 12.1.0]
+ [instantgram 2022.10.28]
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 f2c9939..5a1d1d0 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 12.1.0]
+ [instantgram 2022.10.28]
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 3122bba..758c509 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 12.1.0]
+ [instantgram 2022.10.28]
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 d4f914d..7468e58 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "instantgram", - "version": "12.1.0", + "version": "2022.10.28", "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 5b4474f..b37174e 100644 --- a/src/_langs/partials/button.html +++ b/src/_langs/partials/button.html @@ -1 +1 @@ -[instantgram 12.1.0] \ No newline at end of file +[instantgram 2022.10.28] \ No newline at end of file diff --git a/src/helpers/getBlobVideoUrl.ts b/src/helpers/getBlobVideoUrl.ts deleted file mode 100644 index aee1112..0000000 --- a/src/helpers/getBlobVideoUrl.ts +++ /dev/null @@ -1,129 +0,0 @@ -import getDataFromUrl from "./getDataFromUrl" -import getDataFromIGUrl from "./getDataFromIGUrl" -import getFileNameWithoutExtension from "../helpers/getFileNameWithoutExtension" - -async function getBlobVideoUrl(el: HTMLVideoElement, article: any, selectedControlIndex: number, callback: any) { - // First try fastest method - const instanceKey = Object.keys(el).find(key => key.includes('Instance') || key.includes('Fiber')) - const $react = el[instanceKey] - const videoLink = $react.return.memoizedProps.fallbackSrc - - if (videoLink) { - callback(videoLink) - return true - // If first method didnt work try second approach runs very slow - } else { - let isVideoFromSeries = (selectedControlIndex != null) ? true : false - let videoPosterFilename = getFileNameWithoutExtension(el.poster) - - if (process.env.DEV) { - console.log(['getBlobVideoUrl(): el', el]) - console.log(['getBlobVideoUrl(): el src', el.poster]) - console.log(['getBlobVideoUrl(): hasArticle', article !== null]) - console.log(['getBlobVideoUrl(): article', article]) - console.log(['getBlobVideoUrl(): isVideoFromSeries', isVideoFromSeries]) - console.log(['getBlobVideoUrl(): selectedControlIndex', selectedControlIndex]) - console.log(['getBlobVideoUrl(): videoPosterFilename', videoPosterFilename]) - } - - if (article !== null) { - /* Step 1 */ - /* Fetch user id from element */ - let userId = null - let userProfileUrl = '' - if (article !== undefined && article.length > 0) { - let articleClassListLengths = [] - for (let i = 0; i < article.length; i++) { - articleClassListLengths[i] = article[i].classList.length - } - let newArticleIndex = articleClassListLengths.indexOf(Math.max(...articleClassListLengths)) - userProfileUrl = (article[newArticleIndex].querySelectorAll('header > div > div > div > div > span > a')[0] as HTMLLinkElement).href - } else { - userProfileUrl = (article.querySelectorAll('header > div > div > div > div > span > a')[0] as HTMLLinkElement).href - } - - if (process.env.DEV) { - console.log(['getBlobVideoUrl(): userProfileUrl', userProfileUrl]) - } - - let userProfileUrlResponseData = await getDataFromUrl(userProfileUrl) - if (userProfileUrlResponseData) { - userProfileUrlResponseData = userProfileUrlResponseData.replace(/(\r\n|\n|\r)/gm, '') - - let m - let regex = /profilePage_([0-9]+)/gm - while ((m = regex.exec(userProfileUrlResponseData)) !== null) { - /* This is necessary to avoid infinite loops with zero-width matches */ - if (m.index === regex.lastIndex) { - regex.lastIndex++ - } - - /* The result can be accessed through the `m`-variable. */ - m.forEach((match) => { - userId = match - }) - } - } - - if (process.env.DEV) { - console.log(['getBlobVideoUrl(): userId', userId]) - } - - /* Step 2 */ - /* Fetch the user data until the file name is found */ - let videoUrl = null - if (userId) { - const query = `{"id":${userId},"first":100}` - let userMediaFeedPosts = await getDataFromIGUrl('https://www.instagram.com/graphql/query/?query_hash=003056d32c2554def87228bc3fd9668a&variables=', query, videoPosterFilename) - if (process.env.DEV) { - console.log(['getBlobVideoUrl(): userMediaFeedPosts', userMediaFeedPosts]) - } - - if (userMediaFeedPosts) { - let magicArr = userMediaFeedPosts[userMediaFeedPosts.length - 1] - - for (let _fI = 0; _fI < magicArr.user.edge_owner_to_timeline_media.edges.length; _fI++) { - let GraphEdgeNode = magicArr.user.edge_owner_to_timeline_media.edges[_fI].node - - /* Multi Post which can have a video */ - if (isVideoFromSeries) { - if (GraphEdgeNode.__typename == 'GraphSidecar') { - if (GraphEdgeNode.hasOwnProperty('edge_sidecar_to_children')) { - for (let edge in GraphEdgeNode.edge_sidecar_to_children.edges) { - - if (GraphEdgeNode.edge_sidecar_to_children.edges[edge].node.__typename == 'GraphVideo') { - let GraphVideoNode = GraphEdgeNode.edge_sidecar_to_children.edges[edge].node - - if (videoPosterFilename == getFileNameWithoutExtension(GraphVideoNode.display_url)) { - videoUrl = GraphVideoNode.video_url - - /* There exists only one node so break it no need to further analyze */ - break - } - } - } - } - } - } else { - if (GraphEdgeNode.__typename == 'GraphVideo') { - if (videoPosterFilename == getFileNameWithoutExtension(GraphEdgeNode.display_url)) { - videoUrl = GraphEdgeNode.video_url - - /* There exists only one node so break it no need to further analyze */ - break - } - } - } - } - } - } - - callback(videoUrl ? videoUrl : null) - } else { - callback(null) - } - - return true - } -} -export default getBlobVideoUrl \ No newline at end of file diff --git a/src/helpers/getVideoUrl.ts b/src/helpers/getVideoUrl.ts new file mode 100644 index 0000000..6666b82 --- /dev/null +++ b/src/helpers/getVideoUrl.ts @@ -0,0 +1,65 @@ +import getPath from "../helpers/getPath" + +async function getVideoUrl(el: HTMLVideoElement, callback: any) { + // No blob video but src return it + if (el.src && !el.src.startsWith("blob:")) { + callback(el.src) + + return false + } + + const instanceKey = Object.keys(el).find(key => key.includes('Instance') || key.includes('Fiber')) + const $react = el[instanceKey] + + // Found mpd manifest, so extract our magic + if ($react.return.return.memoizedProps.manifest) { + var domManifestParser = new DOMParser().parseFromString($react.return.return.memoizedProps.manifest, "text/xml") + var s = Array.from(domManifestParser.querySelectorAll('Representation[mimeType="video/mp4"][FBQualityClass="hd"]')).map(function l(_e) { + var z, nope + return { + quality: _e.getAttribute("FBQualityClass"), + bandwidth: parseInt(_e.getAttribute("bandwidth")), + baseUrl: null === (nope = null === (z = _e.querySelector("BaseURL")) || void 0 === z ? void 0 : z.textContent) || void 0 === nope ? void 0 : nope.trim() + } + }).filter(function (e) { + return e.baseUrl + }) + + var lol + callback(s.sort(function compare(x, y) { + return "hd" === x.quality && "hd" !== y.quality ? -1 : "hd" !== x.quality && "hd" === y.quality ? 1 : y.bandwidth - x.bandwidth + }), null === (lol = s[0]) || void 0 === lol ? void 0 : lol.baseUrl) + } else { + let $videoURL: string | any[] + let $videoType: string + + if ($react.return.return.memoizedProps.hdSrc) { + $videoURL = $react.return.return.memoizedProps.hdSrc + $videoType = 'hd' + } else if ($react.return.return.memoizedProps.sdSrc) { + $videoURL = $react.return.return.memoizedProps.sdSrc + $videoType = 'sd' + } else if ($react.return.return.memoizedProps.children[0].props.fallbackSrc) { + $videoURL = $react.return.return.memoizedProps.children[0].props.fallbackSrc + $videoType = 'fallback' + } else { + $videoURL = null + $videoType = null + } + + if ($videoURL.length > 80) { + if ($videoType == 'fallback') { + /* Fix error network error since mai 2021 cannot download */ + let fixedUrl = "https://scontent.cdninstagram.com" + getPath($react.return.return.memoizedProps.children[0].props.fallbackSrc, "unknown") + callback(fixedUrl) + } else { + callback($videoURL) + } + } else { + callback(null) + } + } + + return false +} +export default getVideoUrl \ No newline at end of file diff --git a/src/modules/MediaScanner.ts b/src/modules/MediaScanner.ts index e859e77..e81b404 100644 --- a/src/modules/MediaScanner.ts +++ b/src/modules/MediaScanner.ts @@ -5,7 +5,7 @@ import { PostScanner } from "./PostScanner" import { StoryScanner } from "./StoryScanner" import { Modal } from "../components/Modal" import { MediaType } from "../model/mediaType" -import getBlobVideoUrl from "../helpers/getBlobVideoUrl" +import getVideoUrl from "../helpers/getVideoUrl" import getHighestResImg from "../helpers/getHighestResImg" import getPath from "../helpers/getPath" import localize from "../helpers/localize" @@ -70,7 +70,7 @@ export class MediaScanner implements Module { } if (program.regexPostPath.test(program.path)) { - new PostScanner().execute(program, isModal, function (_scannerFound: boolean, foundMediaElem: any, foundMediaType: MediaType, _scannerProgram: Program) { + new PostScanner().execute(program, isModal, function (_scannerFound: boolean, foundMediaElem: any, foundMediaType: MediaType, _scannerProgram: Program) { mediaObj.mediaEl = foundMediaElem mediaObj.mediaType = foundMediaType }) @@ -110,76 +110,42 @@ export class MediaScanner implements Module { } if (mediaURL != null && mediaURL.length > 10) { - if (mediaURL.indexOf("blob:") !== -1) { - const that = this + let that = this + getVideoUrl(mediaObj.mediaEl, function (callbackData: any) { found = true program.foundImage = false program.foundVideo = true program.foundByModule = that.getName() - this.modal.heading = [ - `
[instantgram] v${program.VERSION}
`, - ] - this.modal.content = [ - "

" + - "Loading" + - "

", - "

" + - localize("modules.modal@isLoading") + - "

", - ] - this.modal.open() - - setTimeout(function () { - //that.modal.close() - - getBlobVideoUrl(mediaObj.mediaEl, $articles, selectedCarouselIndex, - function (scrapedBlobVideoUrl: string) { - //clearInterval(loadingDots) - - if (scrapedBlobVideoUrl) { - that.modal.close() - - /* Fix error network error since mai 2021 cannot download */ - let _newVideoUrl = "https://scontent.cdninstagram.com" + getPath(scrapedBlobVideoUrl, "unknown") - - callback(found, _newVideoUrl, program) - } else { - that.modal.heading = [ - `
[instantgram] v${program.VERSION}
`, - ] - that.modal.content = [ - localize("index#program#blob@alert_cannotDownload"), - ] - that.modal.contentStyle = "text-align:center" - that.modal.buttonList = [ - { - active: true, - text: "Ok", - }, - ] - that.modal.open() - - callback(found, null, program) - } - } - ) - }, 500) - } else { - // Fix url timestamp error or signature mismatch - mediaURL = mediaURL.replace("amp", "&") - - found = true - program.foundImage = false - program.foundVideo = true - program.foundByModule = this.getName() - - /* Fix error network error since mai 2021 cannot download */ - let _newVideoUrl = "https://scontent.cdninstagram.com" + getPath(mediaURL, "unknown") - - callback(found, _newVideoUrl, program) - } + let videoURL + if (typeof callbackData === 'string' || callbackData instanceof String) { + videoURL = callbackData + } else { + videoURL = callbackData[0].baseUrl && callbackData[0].baseUrl.length > 80 ? callbackData[0].baseUrl : null + } + + if (videoURL) { + callback(found, videoURL, program) + } else { + that.modal.heading = [ + `
[instantgram] v${program.VERSION}
`, + ] + that.modal.content = [ + localize("index#program#blob@alert_cannotDownload"), + ] + that.modal.contentStyle = "text-align:center" + that.modal.buttonList = [ + { + active: true, + text: "Ok", + }, + ] + that.modal.open() + + callback(found, null, program) + } + }) } else { found = false program.foundImage = false diff --git a/src/modules/PostScanner.ts b/src/modules/PostScanner.ts index 1086723..18ba43e 100644 --- a/src/modules/PostScanner.ts +++ b/src/modules/PostScanner.ts @@ -80,6 +80,7 @@ export class PostScanner implements Module { selectedCarouselMediaSlideIndex++ if (process.env.DEV) { + console.log(["isCarousel", isCarousel]) console.log(["carouselControlsArray", carouselControlsArray]) console.log(["carouselControlsArray.length", carouselControlsArray.length]) console.log(["selectedCarouselMediaSlideIndex", selectedCarouselMediaSlideIndex]) @@ -105,7 +106,7 @@ export class PostScanner implements Module { if (isLastMedia) { mediaEl = M[2] } else { - // Dont mess with me Instagram!!! + // Dont mess with me Instagram!!! if (isModal && Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0) < 445) { switch (carouselControlsArray.length) { case 4: @@ -262,7 +263,7 @@ export class PostScanner implements Module { if (S == 4) { mediaEl = M[Math.ceil(M.length / 2)] } else if (S == 3) { - mediaEl = M[Math.ceil(M.length / 2)] + mediaEl = M[Math.ceil(M.length / 2) - 1] } else { mediaEl = M[Math.ceil(M.length / 2) - 1] } @@ -271,7 +272,7 @@ export class PostScanner implements Module { case 6: if (program.browser.name == "firefox") { if (S == 4) { - mediaEl = M[Math.ceil(M.length / 2) - 1] + mediaEl = M[Math.ceil(M.length / 2)] } else if (S == 3) { mediaEl = M[Math.ceil(M.length / 2) - 1] } else if (S == 2) { @@ -300,7 +301,7 @@ export class PostScanner implements Module { } else if (S == 4) { mediaEl = M[Math.ceil(M.length / 2)] } else if (S == 3) { - mediaEl = M[Math.ceil(M.length / 2)] + mediaEl = M[Math.ceil(M.length / 2) - 1] } else { mediaEl = M[Math.ceil(M.length / 2) - 1] } @@ -321,13 +322,13 @@ export class PostScanner implements Module { if (S == 7) { mediaEl = M[Math.ceil(M.length / 2)] } else if (S == 6) { - mediaEl = M[Math.ceil(M.length / 2)] + mediaEl = M[Math.ceil(M.length / 2) - 1] } else if (S == 5) { - mediaEl = M[Math.ceil(M.length / 2)] - } else if (S == 4) { mediaEl = M[Math.ceil(M.length / 2) - 1] - } else if (S == 3) { + } else if (S == 4) { mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2) - 1] } else { mediaEl = M[Math.ceil(M.length / 2) - 1] } @@ -345,16 +346,30 @@ export class PostScanner implements Module { } } break - case 10: + case 9: if (program.browser.name == "firefox") { if (S == 9) { mediaEl = M[Math.ceil(M.length / 2)] } else if (S == 8) { mediaEl = M[Math.ceil(M.length / 2)] } else if (S == 7) { - mediaEl = M[Math.ceil(M.length / 2) - 1] + mediaEl = M[Math.ceil(M.length / 2)] } else if (S == 6) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 4) { mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } + } else { + if (S == 8) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 7) { + mediaEl = M[Math.ceil(M.length / 2) - 1] } else if (S == 5) { mediaEl = M[Math.ceil(M.length / 2)] } else if (S == 4) { @@ -364,15 +379,40 @@ export class PostScanner implements Module { } else { mediaEl = M[Math.ceil(M.length / 2) - 1] } + } + break + case 10: + if (program.browser.name == "firefox") { + if (S == 9) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 8) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 7) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 6) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } else { - if (S == 8) { + if (S == 9) { mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 8) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 7) { + mediaEl = M[Math.ceil(M.length / 2) - 1] } else if (S == 5) { mediaEl = M[Math.ceil(M.length / 2)] } else if (S == 4) { - mediaEl = M[Math.ceil(M.length / 2) - 1] - } else if (S == 3) { mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2) - 1] } else { mediaEl = M[Math.ceil(M.length / 2) - 1] } diff --git a/src/modules/StoryScanner.ts b/src/modules/StoryScanner.ts index 325d8ae..c26f85c 100644 --- a/src/modules/StoryScanner.ts +++ b/src/modules/StoryScanner.ts @@ -39,7 +39,7 @@ export class StoryScanner implements Module { console.log(["isStoryVideo", isVideo]) } - if (isVideo && isImage) { + if (isVideo) { // Set media type mediaType = MediaType.Video diff --git a/src/modules/Update.ts b/src/modules/Update.ts index 14b4f6c..73a56a4 100644 --- a/src/modules/Update.ts +++ b/src/modules/Update.ts @@ -39,15 +39,16 @@ function determineIfGetUpdateIsNecessary(localVersion: string) { async function update(localVersion: string) { if (determineIfGetUpdateIsNecessary(localVersion)) { - console.info(localize('modules.update@determineIfGetUpdateIsNecessary_contacting')) await fetch('https://www.instagram.com/graphql/query/?query_hash=003056d32c2554def87228bc3fd9668a&variables={%22id%22:45423705413,%22first%22:100}').then(function (response) { return response.json() }).then(function (data) { let changelog = data.data.user.edge_owner_to_timeline_media.edges[0].node.edge_media_to_caption.edges[0].node.text let onlineVersion = changelog.match(/(\*|\d+(\.\d+){0,2}(\.\*)?)+/gm)[0] - let limitDate = new Date() + // verify update each 2 days - limitDate.setDate(limitDate.getDate() + 2) + let limitDate = new Date() + //limitDate.setDate(limitDate.getDate() + 2) + limitDate.setTime(limitDate.getTime() + 6 * 60 * 60 * 1000) window.localStorage.setItem('instantgram', JSON.stringify({ version: localVersion,