diff --git a/README.md b/README.md index 4ff1ef0..878ab8d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# [instantgram] v7.1.0 +# [instantgram] v7.1.1 ![GitHub release](https://img.shields.io/badge/release-v7.0.0-blue) ![badge](https://img.shields.io/badge/for-instagram-yellow.svg?style=flat-square) @@ -37,6 +37,7 @@ With this version we support all modern browsers that have ECMAScript 2015 (es6) Read [CONTRIBUTING.md](CONTRIBUTING.md) for more information. :heart: ## Changelog +- v7.1.1 - [instangram] Fix video download on some situations. - v7.1.0 - [instangram] Re-design update dialog. - v7.0.1 - [instangram] Fix update handler. - v7.0.0 - [instangram] Fix get highest image on every post or story. diff --git a/dist/main.js b/dist/main.js index 25e47b8..22bfc5d 100644 --- a/dist/main.js +++ b/dist/main.js @@ -1 +1 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(8),a=(r=o)&&r.__esModule?r:{default:r};var i=navigator.language;-1!==i.indexOf("-")&&(i=i.split("-")[0]),-1!==i.indexOf("_")&&(i=i.split("_")[0]);var l={de:"de-DE",pt:"pt-BR",en:"en-US"}[i];function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;try{if(a.default.langs.hasOwnProperty(t)||(t="en-US"),a.default.langs[t][e])return a.default.langs[t][e]}catch(n){return console.error("[instantgram]LOC error:",n),"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(d("helpers.localize_defaultlang").replace("${LANG_DEFAULT}",l)),t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function o(e){return"object"===("undefined"==typeof Node?"undefined":r(Node))?e instanceof Node:e&&"object"===(void 0===e?"undefined":r(e))&&"number"==typeof e.nodeType}function a(){var e=[];return{watch:e.push.bind(e),trigger:function(t,n){for(var r=!0,o={detail:n,preventDefault:function(){r=!1}},a=0;a0&&n.right>0&&n.left<(t.innerWidth||t.clientWidth)&&n.top<(t.innerHeight||t.clientHeight)}},function(e,t,n){"use strict";var r,o;Object.defineProperty(t,"__esModule",{value:!0}),t.default=(r=regeneratorRuntime.mark((function e(t){var n,r,o,i,l,d,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.getAttribute("srcset")){e.next=24;break}n=[],t.getAttribute("srcset").split(",").forEach((function(e){n.push(e.trim().split(" "))})),t.hasAttribute("src")&&t.getAttribute("src").length>0&&((r={})[0]=t.getAttribute("src"),r[1]="undefined",n.unshift(r)),o=0,i=void 0,l="",d=0;case 8:if(!(do&&(o=i,l=n[d][0]);case 14:d++,e.next=8;break;case 17:if(!(l.length>0)){e.next=21;break}return e.abrupt("return",l);case 21:return e.abrupt("return",!1);case 22:e.next=29;break;case 24:if(!(t.hasAttribute("src")&&t.getAttribute("src").length>0)){e.next=28;break}return e.abrupt("return",t.getAttribute("src"));case 28:return e.abrupt("return",!1);case 29:case"end":return e.stop()}}),e,this)})),o=function(){var e=r.apply(this,arguments);return new Promise((function(t,n){return function r(o,a){try{var i=e[o](a),l=i.value}catch(e){return void n(e)}if(!i.done)return Promise.resolve(l).then((function(e){r("next",e)}),(function(e){r("throw",e)}));t(l)}("next")}))},function(e){return o.apply(this,arguments)});var a=function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){var e=r.naturalWidth,n=r.naturalHeight;t({width:e,height:n})},r.onerror=function(){n("There was some problem with the image.")},r.src=e}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,o){var a=null!=n,i=null,l=(e.querySelectorAll("header > div > div > div > span > a")[0].text,e.querySelectorAll("header > div > div > div > span > a")[0].href),d=null;if(!a){var s=/poster\=\"([\s\S]*)\" preload/gm.exec(t.outerHTML.replace(/(\r\n|\n|\r)/gm,"")),u=null;if(s){var c=document.createElement("textarea");c.innerHTML=s[1];var f=c.firstChild.nodeValue;u=f}var g=u.split("/").pop().split("#")[0].split("?")[0]}var h=null;if((0,r.default)(l,(function(e){h=e})),h){h=h.replace(/(\r\n|\n|\r)/gm,"");for(var m=void 0,p=/profilePage_([0-9]+)/gm;null!==(m=p.exec(h));)m.index===p.lastIndex&&p.lastIndex++,m.forEach((function(e,t){i=e}))}if(i){var v=null;if((0,r.default)('https://www.instagram.com/graphql/query/?query_hash=003056d32c2554def87228bc3fd9668a&variables={"id":'+i+',"first":100}',(function(e){v=e})),v)for(var y=JSON.parse(v),b=0;b1&&void 0!==arguments[1]?arguments[1]:500;(0,a.default)((function(){4==(e.innerHTML+=".").length&&(e.innerHTML="")}),t)};var r,o=n(15),a=(r=o)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return'Loading'}},function(e,t,n){"use strict";var r=h(n(0)),o=h(n(1)),a=h(n(9)),i=h(n(10)),l=h(n(12)),d=h(n(16)),s=h(n(17)),u=h(n(18)),c=h(n(19)),f=h(n(20)),g=h(n(21));function h(e){return e&&e.__esModule?e:{default:e}}console.clear();var m={VERSION:"7.1.0",context:{hasMsg:!1,msg:""},hostname:window.location.hostname,path:window.location.pathname,videos:document.querySelectorAll("video"),regexHostname:/instagram\.com/,regexRootPath:/^\/+$/,regexPostPath:/^\/p\//,regexStoriesURI:/stories\/(.*)+/,foundByModule:null,foundVideo:!1,foundImage:!1,imageLink:!1,setImageLink:function(e){this.imageLink=e}};m.regexHostname.test(m.hostname)?(m.regexRootPath.test(m.path)&&(0,l.default)(m,(function(e,t){void 0!==t.foundVideo&&void 0!==t.foundByModule&&(m.foundVideo=t.foundVideo,m.foundByModule=t.foundByModule),!1===e&&(0,c.default)(m).then((function(e){return!1===e}))&&(m.context.hasMsg=!1)})),m.regexStoriesURI.test(m.path)&&(0,d.default)(m).then((function(e){return!1===e}))&&(m.context.hasMsg=!1),m.regexPostPath.test(m.path)&&(0,s.default)(m,(function(e,t){void 0!==t.foundVideo&&void 0!==t.foundByModule&&(m.foundVideo=t.foundVideo,m.foundByModule=t.foundByModule),!1===e&&(0,f.default)(m).then((function(e){return!1===e}))&&(0,u.default)(m,(function(e,t){void 0!==t.foundVideo&&void 0!==t.foundByModule&&(m.foundVideo=t.foundVideo,m.foundByModule=t.foundByModule),!1===e&&(0,g.default)(m).then((function(e){return!1===e}))&&(m.context.hasMsg=!1)}))})),m.regexRootPath.test(m.path)||m.regexStoriesURI.test(m.path)||m.regexPostPath.test(m.path)||(0,a.default)(m),m.context.hasMsg&&(0,o.default)({width:400,content:"

[instantgram]v"+m.VERSION+"


"+(0,r.default)(m.context.msg)+"

"}).afterCreate((function(e){e.modalElem().addEventListener("click",(function(t){t.target&&t.target.matches(".ok")&&e.close(!0)}))})).afterClose((function(e,t){e.destroy()})).show()):(0,o.default)({width:400,content:"

[instantgram]v"+m.VERSION+"

"+(0,r.default)("index@alert_onlyWorks")+"

"}).afterCreate((function(e){e.modalElem().addEventListener("click",(function(t){t.target&&t.target.matches(".ok")&&e.close(!0)}))})).afterClose((function(e,t){e.destroy()})).show(),(0,i.default)(m.VERSION)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={langs:{"en-US":{"helpers.localize_defaultlang":"[instantgram] set language: ${LANG_DEFAULT} \n For more information about available languages please check http://thinkbig-company.github.io/instantgram","index@alert_onlyWorks":"Works only on instagram.com","index#program#post@alert_imageDontFound":"We couldn't find any image :-(","index#program#post@alert_videoDontFound":"We couldn't find any video :-(","index#program#modalPost@alert_imageDontFound":"We didn't find any image in this Instagram post.","index#program#modalPost@alert_videoDontFound":"We didn't find any video in this Instagram post.","index#program@alert_dontFound":'Did you open any Instagram post? Like for example
https://www.instagram.com/p/CIGrv1VMBkS/
',"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"},"de-DE":{"helpers.localize_defaultlang":"Ausgewählte Sprache: ${LANG_DEFAULT} \n Weitere Informationen zu den unterstützten Sprachen findest du auf http://thinkbig-company.github.io/instantgram","index@alert_onlyWorks":"Funktioniert nur auf instagram.com","index#program#post@alert_imageDontFound":"Wir konnten leider kein Bild finden :-(","index#program#post@alert_videoDontFound":"Wir konnten leider kein Video finden :-(","index#program#modalPost@alert_imageDontFound":"Wir konnten kein Bild in diesem Post finden.","index#program#modalPost@alert_videoDontFound":"Wir konnten kein Video in diesem Post finden.","index#program@alert_dontFound":'Hast du einen Instagram Post geöffnet? Zum Beispiel
https://www.instagram.com/p/CIGrv1VMBkS/
',"modules.modal@isLoading":"Wird versucht zu laden","modules.update@consoleWarnOutdatedInfo":"[instantgram] ist veraltet. Bitte besuche die Seite http://thinkbig-company.github.io/instantgram für ein Update.","modules.update@consoleWarnOutdatedInfoVersions":"[instantgram] Installierte Version ${data.version} | Neue Version: ${data.onlineVersion}","modules.update@determineIfGetUpdateIsNecessary_contacting":"[instantgram] sucht nach neuen verfügbaren Updates...","modules.update@determineIfGetUpdateIsNecessary_updated":"[instantgram] wurde aktualisiert.","modules.update@determineIfGetUpdateIsNecessary_@update_available":"Es ist ein neues Update verfügbar","modules.update@determineIfGetUpdateIsNecessary_@load_update":"Update laden"},"pt-BR":{"helpers.localize_defaultlang":"[instantgram] idioma configurado: ${LANG_DEFAULT} \npara mais informações sobre os idiomas suportados, acesse http://thinkbig-company.github.io/instantgram","index@alert_onlyWorks":"[instantgram] somente funciona no instagram.com","index#program#post@alert_imageDontFound":"Infelizmente não conseguimos encontrar uma foto :-(","index#program#post@alert_videoDontFound":"Infelizmente não conseguimos encontrar um vídeo :-(","index#program#modalPost@alert_imageDontFound":"Não foi possível encontrar uma foto neste post.","index#program#modalPost@alert_videoDontFound":"Não foi possível encontrar um vídeo neste post.","index#program@alert_dontFound":'ops, você está em algum post do instagram? ex:
https://www.instagram.com/p/CIGrv1VMBkS/
',"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"}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,o.default)({width:400,content:"

[instantgram]v"+e.VERSION+"


"+(0,r.default)("index#program@alert_dontFound")+"

"}).afterCreate((function(e){e.modalElem().addEventListener("click",(function(t){t.target&&t.target.matches(".ok")&&e.close(!0)}))})).afterClose((function(e,t){e.destroy()})).show()};var r=a(n(0)),o=a(n(1));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(0)),o=i(n(11)),a=i(n(1));function i(e){return e&&e.__esModule?e:{default:e}}function l(e){console.warn((0,r.default)("modules.update@consoleWarnOutdatedInfo")),console.warn((0,r.default)("modules.update@consoleWarnOutdatedInfoVersions").replace("${data.version}",e.version).replace("${data.onlineVersion}",e.onlineVersion))}t.default=function(e){(function(e){var t=window.localStorage.getItem("instantgram");return!t||(t=JSON.parse(t),(0,o.default)(e,"> "+t.version)&&window.localStorage.setItem("instantgram",JSON.stringify({version:e,onlineVersion:t.onlineVersion,lastVerification:t.lastVerification,dateExpiration:t.dateExpiration})),(0,o.default)(t.onlineVersion,"> "+t.version)&&l(t),Date.now()>t.dateExpiration)})(e)&&(console.info((0,r.default)("modules.update@determineIfGetUpdateIsNecessary_contacting")),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){var n=t.data.user.edge_owner_to_timeline_media.edges[0].node.edge_media_to_caption.edges[0].node.text,i=n.match(/(\*|\d+(\.\d+){0,2}(\.\*)?)+/gm)[0],d=new Date;(d.setDate(d.getDate()+2),window.localStorage.setItem("instantgram",JSON.stringify({version:e,onlineVersion:i,lastVerification:Date.now(),dateExpiration:d.valueOf()})),console.info((0,r.default)("modules.update@determineIfGetUpdateIsNecessary_updated")),console.log(t),(0,o.default)(i,"> "+e))?((0,a.default)({width:400,content:"

[instantgram]v"+e+"


"+(0,r.default)("modules.update@determineIfGetUpdateIsNecessary_@update_available")+"


Changelog

"+n.split("Changelog ")[1]+"

"+(0,r.default)("modules.update@determineIfGetUpdateIsNecessary_@load_update")+"
"}).afterCreate((function(e){e.modalElem().addEventListener("click",(function(t){t.target&&t.target.matches(".ok")&&e.close(!0)}))})).afterClose((function(e,t){e.destroy()})).show(),l(JSON.parse(window.localStorage.getItem("instantgram")))):console.info(window.localStorage.getItem("instantgram"))})).catch((function(e){console.error("Error:",e)})))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){var e=/^(<|>|[=!<>]=)?\s*(\d+(?:\.\d+){0,2})([a-z][a-z0-9\-]*)?$/i;function t(t,n){var r=(t+"").match(e);return r?(n?r[1]||"==":"")+'"'+(r[2]+".0.0").match(/\d+(?:\.\d+){0,2}/)[0].replace(/(?:^|\.)(\d+)/g,(function(e,t){return Array(9-t.length).join(0)+t}))+(r[3]||"~")+'"':n?"==0":1}return function(e){e=t(e);for(var n,r=1;n=arguments[r++];)if(!new Function("return "+e+t(n,1))())return!1;return!0}}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=!1;if(e.regexRootPath.test(e.path))try{e:if(null==document.querySelectorAll("main > section")||1!==document.querySelectorAll("main > section").length)n=!1,e.foundVideo=!1,t(n,e);else{for(var s=document.querySelector("main > section").querySelectorAll("div > div > div > article"),c=void 0,f=void 0,g=0;g div > div > div > video");if(null!=h){c=h,f=h.src;break}}var m=null;if(null!=g&&null!=s&&null!=s[g]){var p=[].concat(u(s[g].querySelectorAll("div > div > div > div > div > div > div > ul:first-child > li"))).filter((function(e){return null!=e.firstChild&&e.classList.length>0}));if(null!=p&&p.length>0){c=null,f=null;for(var v=!1,y=[].concat(u(s[g].children[2].querySelector("div > div").children[1].children)),b=0;b1&&(m=b),m==y.length-1){v=!0;break}for(var x=0;x6&&4==m?p[1]:y.length>6&&5==m||y.length>6&&6==m?p[2]:y.length>6&&7==m?p[1]:y.length>6&&8==m?p[2]:p[m-1]),null!=c&&null!=c.querySelector("video")){f=c.querySelector("video").src;break}}}if(f){if(-1!==f.indexOf("blob:")){(0,d.default)({width:400,content:"

[instantgram]v"+e.VERSION+"


"+(0,i.default)()+"


"+(0,r.default)("modules.modal@isLoading")+"

",closeButton:!1,overlayClose:!1}).afterCreate((function(e){(0,a.default)(e.modalElem().querySelector("#loading_dot"))})).afterShow((function(r){setTimeout((function(){(0,o.default)(s[g],c,m,(function(o){o?(r.close(),n=!0,e.foundVideo=!0,e.foundByModule="searchVideoInFeed",window.open(o),t(n,e)):(r.close(),n=!1,e.foundVideo=!1,e.foundByModule="searchVideoInFeed",t(n,e))}))}),500)})).afterClose((function(e,t){e.destroy()})).show();break e}n=!0,e.foundVideo=!0,e.foundByModule="searchVideoInFeed",window.open(f),t(n,e)}else n=!1,e.foundVideo=!1,t(n,e)}}catch(t){console.error("searchVideoInFeed()","[instantgram] "+e.VERSION,t)}};var r=s(n(0)),o=s(n(4)),a=s(n(5)),i=s(n(6)),l=s(n(2)),d=s(n(1));function s(e){return e&&e.__esModule?e:{default:e}}function u(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0){setTimeout(r,o);try{e.call(null)}catch(e){throw a=0,e.toString()}}});var o,a;setTimeout(r,t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o,a,i=n(3),l=(r=i)&&r.__esModule?r:{default:r};t.default=(o=regeneratorRuntime.mark((function e(t){var n,r,o,a,i,d,s,u,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!1,!t.regexStoriesURI.test(t.path)){e.next=43;break}if(e.prev=2,r=document.getElementById("react-root"),o=r.querySelectorAll("video > source"),a=r.querySelectorAll("img[srcset]"),d=null,!(o.length>0)){e.next=16;break}n=!0,t.foundVideo=!0,t.foundByModule="searchImageVideoInStories",i=o[0].src.replace("amp;","&"),window.open(i),e.next=37;break;case 16:s=void 0,u=0;case 18:if(!(u0)){e.next=22;break}return s=a[u],e.abrupt("break",25);case 22:u++,e.next=18;break;case 25:return e.next=27,(0,l.default)(s);case 27:if(!(d=e.sent)){e.next=35;break}n=!0,t.foundImage=!0,t.foundByModule="searchImageVideoInStories",d=d.replace("amp;","&"),window.open(d),e.next=37;break;case 35:n=!1,t.foundImage=!1;case 37:!1===n&&t.videos.length>0&&(!(c=t.videos[0].src)&&t.videos[0].children&&(c=t.videos[0].children[0].src),c&&(window.open(c),n=!0,t.foundVideo=!0,t.foundByModule="searchImageVideoInStories")),e.next=43;break;case 40:e.prev=40,e.t0=e.catch(2),console.error("searchImageVideoInStories()","[instantgram] "+t.VERSION,e.t0);case 43:return e.abrupt("return",n);case 44:case"end":return e.stop()}}),e,this,[[2,40]])})),a=function(){var e=o.apply(this,arguments);return new Promise((function(t,n){return function r(o,a){try{var i=e[o](a),l=i.value}catch(e){return void n(e)}if(!i.done)return Promise.resolve(l).then((function(e){r("next",e)}),(function(e){r("throw",e)}));t(l)}("next")}))},function(e){return a.apply(this,arguments)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=!1;if(e.regexPostPath.test(e.path))try{e:if(null==document.getElementsByTagName("article")||1!==document.getElementsByTagName("article").length)n=!1,e.foundVideo=!1,t(n,e);else{for(var s=document.querySelector("main").querySelectorAll("div > div > article"),c=void 0,f=void 0,g=0;g div > div > div > video");if(null!=h){c=h,f=h.src;break}}var m=null;if(null!=g&&null!=s&&null!=s[g]){var p=[].concat(u(s[g].querySelectorAll("div > div > div > div > div > div > div > ul:first-child > li"))).filter((function(e){return null!=e.firstChild&&e.classList.length>0}));if(null!=p&&p.length>0){c=null,f=null;for(var v=!1,y=[].concat(u(s[0].children[2].querySelector("div > div").children[1].children)),b=0;b1&&(m=b),m==y.length-1){v=!0;break}for(var x=0;x6&&4==m?p[1]:y.length>6&&5==m||y.length>6&&6==m?p[2]:y.length>6&&7==m?p[1]:y.length>6&&8==m?p[2]:p[m-1]),null!=c&&null!=c.querySelector("video")){f=c.querySelector("video").src;break}}}if(f){if(-1!==f.indexOf("blob:")){(0,d.default)({width:400,content:"

[instantgram]v"+e.VERSION+"


"+(0,i.default)()+"


"+(0,r.default)("modules.modal@isLoading")+"

",closeButton:!1,overlayClose:!1}).afterCreate((function(e){(0,a.default)(e.modalElem().querySelector("#loading_dot"))})).afterShow((function(r){setTimeout((function(){(0,o.default)(s[g],c,m,(function(o){o?(r.close(),n=!0,e.foundVideo=!0,e.foundByModule="searchVideoInPost",window.open(o),t(n,e)):(r.close(),n=!1,e.foundVideo=!1,e.foundByModule="searchVideoInPost",t(n,e))}))}),500)})).afterClose((function(e,t){e.destroy()})).show();break e}n=!0,e.foundVideo=!0,e.foundByModule="searchVideoInPost",window.open(f),t(n,e)}else n=!1,e.foundVideo=!1,t(n,e)}}catch(t){console.error("searchVideoInPost()","[instantgram] "+e.VERSION,t)}};var r=s(n(0)),o=s(n(4)),a=s(n(5)),i=s(n(6)),l=s(n(2)),d=s(n(1));function s(e){return e&&e.__esModule?e:{default:e}}function u(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=4);c++);if(null==document.getElementsByTagName("article")||null==document.getElementsByTagName("article")[c].getAttribute("role"))n=!1,e.foundVideo=!1,t(n,e);else{var f=document.getElementsByTagName("article")[c],g=void 0,h=void 0;if((0,l.default)(f)){var m=f.querySelector("div > div > div > div > video");null!=m&&(g=m,h=m.src)}var p=null;if(null!=f){var v=[].concat(u(f.querySelectorAll("div > div > div > div > div > div > div > ul:first-child > li"))).filter((function(e){return null!=e.firstChild&&e.classList.length>0}));if(null!=v&&v.length>0){g=null,h=null;for(var y=!1,b=[].concat(u(f.children[2].querySelector("div > div").children[1].children)),x=0;x1&&(p=x),p==b.length-1){y=!0;break}for(var w=0;w6&&4==p?v[1]:b.length>6&&5==p||b.length>6&&6==p?v[2]:b.length>6&&7==p?v[1]:b.length>6&&8==p?v[2]:v[p-1]),null!=g&&null!=g.querySelector("video")){h=g.querySelector("video").src;break}}}if(h){if(-1!==h.indexOf("blob:")){var _=(0,d.default)({width:400,content:"

[instantgram]v"+e.VERSION+"


"+(0,i.default)()+"


"+(0,r.default)("modules.modal@isLoading")+"

",closeButton:!1,overlayClose:!1}).afterCreate((function(e){(0,a.default)(e.modalElem().querySelector("#loading_dot"))})).afterShow((function(r){setTimeout((function(){(0,o.default)(f,g,p,(function(r){r?(_.close(),n=!0,e.foundVideo=!0,e.foundByModule="searchVideoInModalPost",window.open(r),t(n,e)):(_.close(),n=!1,e.foundVideo=!1,e.foundByModule="searchVideoInModalPost",t(n,e))}))}),500)})).afterClose((function(e,t){e.destroy()})).show();break e}n=!0,e.foundVideo=!0,e.foundByModule="searchVideoInModalPost",window.open(h),t(n,e)}else n=!1,e.foundVideo=!1,t(n,e)}}}catch(t){console.error("searchVideoInModalPost()","[instantgram] "+e.VERSION,t)}};var r=s(n(0)),o=s(n(4)),a=s(n(5)),i=s(n(6)),l=s(n(2)),d=s(n(1));function s(e){return e&&e.__esModule?e:{default:e}}function u(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t section")||1!==document.querySelectorAll("main > section").length){e.next=58;break}r=document.querySelector("main > section"),o=r.querySelectorAll("div > div > div > article"),l=null,s=null,u=0;case 9:if(!(u div > div > div > img"))){e.next=19;break}return l=c,e.next=16,(0,a.default)(c);case 16:return(f=e.sent).length>0&&(s=f),e.abrupt("break",22);case 19:u++,e.next=9;break;case 22:if(null==u||null==o||null==o[u]){e.next=55;break}if(!(null!=(g=[].concat(d(o[u].querySelectorAll("div > div > div > div > div > div > div > ul:first-child > li"))).filter((function(e){return null!=e.firstChild&&e.classList.length>0})))&&g.length>1)){e.next=55;break}l=null,s=null,h=void 0,m=!1,p=[].concat(d(o[u].children[2].querySelector("div > div").children[1].children)),v=0;case 31:if(!(v1&&(h=v),h!=p.length-1){e.next=36;break}return m=!0,e.abrupt("break",39);case 36:v++,e.next=31;break;case 39:y=0;case 40:if(!(y6&&4==h?g[1]:p.length>6&&5==h||p.length>6&&6==h?g[2]:p.length>6&&7==h?g[1]:p.length>6&&8==h?g[2]:g[h-1]),null==l||null==l.querySelector("img[srcset]")){e.next=50;break}return e.next=45,(0,a.default)(l.querySelector("img[srcset]"));case 45:return(b=e.sent).length>0&&(s=b),e.abrupt("break",55);case 50:return null!=l.querySelector("img[src]")&&(s=l.querySelector("img[src]").src),e.abrupt("break",55);case 52:y++,e.next=40;break;case 55:return t.setImageLink(s),t.imageLink?(n=!0,t.foundImage=!0,t.foundByModule="searchImageInFeed",window.open(t.imageLink)):(n=!1,t.foundImage=!1),e.abrupt("break",58);case 58:e.next=63;break;case 60:e.prev=60,e.t0=e.catch(2),console.error("searchImageInFeed()","[instantgram] "+t.VERSION,e.t0);case 63:return e.abrupt("return",n);case 64:case"end":return e.stop()}}),e,this,[[2,60]])})),o=function(){var e=r.apply(this,arguments);return new Promise((function(t,n){return function r(o,a){try{var i=e[o](a),l=i.value}catch(e){return void n(e)}if(!i.done)return Promise.resolve(l).then((function(e){r("next",e)}),(function(e){r("throw",e)}));t(l)}("next")}))},function(e){return o.apply(this,arguments)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o,a=l(n(3)),i=l(n(2));function l(e){return e&&e.__esModule?e:{default:e}}function d(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t div > article"),l=null,s=null,u=0;case 9:if(!(u div > div > div > img"))){e.next=19;break}return l=c,e.next=16,(0,a.default)(c);case 16:return(f=e.sent).length>0&&(s=f),e.abrupt("break",22);case 19:u++,e.next=9;break;case 22:if(null==u||null==o||null==o[u]){e.next=55;break}if(!(null!=(g=[].concat(d(o[u].querySelectorAll("div > div > div > div > div > div > div > ul:first-child > li"))).filter((function(e){return null!=e.firstChild&&e.classList.length>0})))&&g.length>0)){e.next=55;break}l=null,s=null,h=void 0,m=!1,p=[].concat(d(o[u].children[2].querySelector("div > div").children[1].children)),v=0;case 31:if(!(v1&&(h=v),h!=p.length-1){e.next=36;break}return m=!0,e.abrupt("break",39);case 36:v++,e.next=31;break;case 39:y=0;case 40:if(!(y6&&4==h?g[1]:p.length>6&&5==h||p.length>6&&6==h?g[2]:p.length>6&&7==h?g[1]:p.length>6&&8==h?g[2]:g[h-1]),null==l||null==l.querySelector("img[srcset]")){e.next=50;break}return e.next=45,(0,a.default)(l.querySelector("img[srcset]"));case 45:return(b=e.sent).length>0&&(s=b),e.abrupt("break",55);case 50:return null!=l.querySelector("img[src]")&&(s=l.querySelector("img[src]").src),e.abrupt("break",55);case 52:y++,e.next=40;break;case 55:return t.setImageLink(s),t.imageLink?(n=!0,t.foundImage=!0,t.foundByModule="searchImageInPost",window.open(t.imageLink)):(n=!1,t.foundImage=!1),e.abrupt("break",58);case 58:e.next=63;break;case 60:e.prev=60,e.t0=e.catch(2),console.error("searchImageInPost()","[instantgram] "+t.VERSION,e.t0);case 63:return e.abrupt("return",n);case 64:case"end":return e.stop()}}),e,this,[[2,60]])})),o=function(){var e=r.apply(this,arguments);return new Promise((function(t,n){return function r(o,a){try{var i=e[o](a),l=i.value}catch(e){return void n(e)}if(!i.done)return Promise.resolve(l).then((function(e){r("next",e)}),(function(e){r("throw",e)}));t(l)}("next")}))},function(e){return o.apply(this,arguments)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o,a=l(n(3)),i=l(n(2));function l(e){return e&&e.__esModule?e:{default:e}}function d(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=4)){e.next=10;break}return e.abrupt("break",13);case 10:o++,e.next=7;break;case 13:if(null==document.getElementsByTagName("article")||null==document.getElementsByTagName("article")[o].getAttribute("role")){e.next=61;break}if(l=document.getElementsByTagName("article")[o],s=null,u=null,!(0,i.default)(l)){e.next=25;break}if(null==(c=l.querySelector("img[srcset]"))){e.next=25;break}return s=c,e.next=23,(0,a.default)(c);case 23:(f=e.sent).length>0&&(u=f);case 25:if(null==l){e.next=58;break}if(!(null!=(g=[].concat(d(l.querySelectorAll("div > div > div > div > div > div > div > ul:first-child > li"))).filter((function(e){return null!=e.firstChild&&e.classList.length>0})))&&g.length>0)){e.next=58;break}s=null,u=null,h=void 0,m=!1,p=[].concat(d(l.children[2].querySelector("div > div").children[1].children)),v=0;case 34:if(!(v1&&(h=v),h!=p.length-1){e.next=39;break}return m=!0,e.abrupt("break",42);case 39:v++,e.next=34;break;case 42:y=0;case 43:if(!(y6&&4==h?g[1]:p.length>6&&5==h||p.length>6&&6==h?g[2]:p.length>6&&7==h?g[1]:p.length>6&&8==h?g[2]:g[h-1]),null==s||null==s.querySelector("img[srcset]")){e.next=53;break}return e.next=48,(0,a.default)(s.querySelector("img[srcset]"));case 48:return(b=e.sent).length>0&&(u=b),e.abrupt("break",58);case 53:return null!=s.querySelector("img[src]")&&(u=s.querySelector("img[src]").src),e.abrupt("break",58);case 55:y++,e.next=43;break;case 58:return t.setImageLink(u),t.imageLink?(n=!0,t.foundImage=!0,t.foundByModule="searchImageInModalPost",window.open(t.imageLink)):(n=!1,t.foundImage=!1),e.abrupt("break",61);case 61:e.next=66;break;case 63:e.prev=63,e.t0=e.catch(2),console.error("searchImageInModalPost()","[instantgram] "+t.VERSION,e.t0);case 66:return e.abrupt("return",n);case 67:case"end":return e.stop()}}),e,this,[[2,63]])})),o=function(){var e=r.apply(this,arguments);return new Promise((function(t,n){return function r(o,a){try{var i=e[o](a),l=i.value}catch(e){return void n(e)}if(!i.done)return Promise.resolve(l).then((function(e){r("next",e)}),(function(e){r("throw",e)}));t(l)}("next")}))},function(e){return o.apply(this,arguments)})}]); \ No newline at end of file +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(8),a=(r=o)&&r.__esModule?r:{default:r};var i=navigator.language;-1!==i.indexOf("-")&&(i=i.split("-")[0]),-1!==i.indexOf("_")&&(i=i.split("_")[0]);var l={de:"de-DE",pt:"pt-BR",en:"en-US"}[i];function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;try{if(a.default.langs.hasOwnProperty(t)||(t="en-US"),a.default.langs[t][e])return a.default.langs[t][e]}catch(n){return console.error("[instantgram]LOC error:",n),"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(u("helpers.localize_defaultlang").replace("${LANG_DEFAULT}",l)),t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function o(e){return"object"===("undefined"==typeof Node?"undefined":r(Node))?e instanceof Node:e&&"object"===(void 0===e?"undefined":r(e))&&"number"==typeof e.nodeType}function a(){var e=[];return{watch:e.push.bind(e),trigger:function(t,n){for(var r=!0,o={detail:n,preventDefault:function(){r=!1}},a=0;a0&&n.right>0&&n.left<(t.innerWidth||t.clientWidth)&&n.top<(t.innerHeight||t.clientHeight)}},function(e,t,n){"use strict";var r,o;Object.defineProperty(t,"__esModule",{value:!0}),t.default=(r=regeneratorRuntime.mark((function e(t){var n,r,o,i,l,u,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.getAttribute("srcset")){e.next=24;break}n=[],t.getAttribute("srcset").split(",").forEach((function(e){n.push(e.trim().split(" "))})),t.hasAttribute("src")&&t.getAttribute("src").length>0&&((r={})[0]=t.getAttribute("src"),r[1]="undefined",n.unshift(r)),o=0,i=void 0,l="",u=0;case 8:if(!(uo&&(o=i,l=n[u][0]);case 14:u++,e.next=8;break;case 17:if(!(l.length>0)){e.next=21;break}return e.abrupt("return",l);case 21:return e.abrupt("return",!1);case 22:e.next=29;break;case 24:if(!(t.hasAttribute("src")&&t.getAttribute("src").length>0)){e.next=28;break}return e.abrupt("return",t.getAttribute("src"));case 28:return e.abrupt("return",!1);case 29:case"end":return e.stop()}}),e,this)})),o=function(){var e=r.apply(this,arguments);return new Promise((function(t,n){return function r(o,a){try{var i=e[o](a),l=i.value}catch(e){return void n(e)}if(!i.done)return Promise.resolve(l).then((function(e){r("next",e)}),(function(e){r("throw",e)}));t(l)}("next")}))},function(e){return o.apply(this,arguments)});var a=function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){var e=r.naturalWidth,n=r.naturalHeight;t({width:e,height:n})},r.onerror=function(){n("There was some problem with the image.")},r.src=e}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=Object.keys(e).find((function(e){return e.includes("Instance")})),r=e[n].return.memoizedProps.fallbackSrc;t(r.length>0&&r)};r(n(13)),r(n(14));function r(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500;(0,a.default)((function(){4==(e.innerHTML+=".").length&&(e.innerHTML="")}),t)};var r,o=n(15),a=(r=o)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return'Loading'}},function(e,t,n){"use strict";var r=h(n(0)),o=h(n(1)),a=h(n(9)),i=h(n(10)),l=h(n(12)),u=h(n(16)),s=h(n(17)),d=h(n(18)),c=h(n(19)),f=h(n(20)),g=h(n(21));function h(e){return e&&e.__esModule?e:{default:e}}console.clear();var m={VERSION:"7.1.1",context:{hasMsg:!1,msg:""},hostname:window.location.hostname,path:window.location.pathname,videos:document.querySelectorAll("video"),regexHostname:/instagram\.com/,regexRootPath:/^\/+$/,regexPostPath:/^\/p\//,regexStoriesURI:/stories\/(.*)+/,foundByModule:null,foundVideo:!1,foundImage:!1,imageLink:!1,setImageLink:function(e){this.imageLink=e}};m.regexHostname.test(m.hostname)?(m.regexRootPath.test(m.path)&&(0,l.default)(m,(function(e,t){void 0!==t.foundVideo&&void 0!==t.foundByModule&&(m.foundVideo=t.foundVideo,m.foundByModule=t.foundByModule),!1===e&&(0,c.default)(m).then((function(e){return!1===e}))&&(m.context.hasMsg=!1)})),m.regexStoriesURI.test(m.path)&&(0,u.default)(m).then((function(e){return!1===e}))&&(m.context.hasMsg=!1),m.regexPostPath.test(m.path)&&(0,s.default)(m,(function(e,t){void 0!==t.foundVideo&&void 0!==t.foundByModule&&(m.foundVideo=t.foundVideo,m.foundByModule=t.foundByModule),!1===e&&(0,f.default)(m).then((function(e){return!1===e}))&&(0,d.default)(m,(function(e,t){void 0!==t.foundVideo&&void 0!==t.foundByModule&&(m.foundVideo=t.foundVideo,m.foundByModule=t.foundByModule),!1===e&&(0,g.default)(m).then((function(e){return!1===e}))&&(m.context.hasMsg=!1)}))})),m.regexRootPath.test(m.path)||m.regexStoriesURI.test(m.path)||m.regexPostPath.test(m.path)||(0,a.default)(m),m.context.hasMsg&&(0,o.default)({width:400,content:"

[instantgram]v"+m.VERSION+"


"+(0,r.default)(m.context.msg)+"

"}).afterCreate((function(e){e.modalElem().addEventListener("click",(function(t){t.target&&t.target.matches(".ok")&&e.close(!0)}))})).afterClose((function(e,t){e.destroy()})).show()):(0,o.default)({width:400,content:"

[instantgram]v"+m.VERSION+"

"+(0,r.default)("index@alert_onlyWorks")+"

"}).afterCreate((function(e){e.modalElem().addEventListener("click",(function(t){t.target&&t.target.matches(".ok")&&e.close(!0)}))})).afterClose((function(e,t){e.destroy()})).show(),(0,i.default)(m.VERSION)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={langs:{"en-US":{"helpers.localize_defaultlang":"[instantgram] set language: ${LANG_DEFAULT} \n For more information about available languages please check http://thinkbig-company.github.io/instantgram","index@alert_onlyWorks":"Works only on instagram.com","index#program#post@alert_imageDontFound":"We couldn't find any image :-(","index#program#post@alert_videoDontFound":"We couldn't find any video :-(","index#program#modalPost@alert_imageDontFound":"We didn't find any image in this Instagram post.","index#program#modalPost@alert_videoDontFound":"We didn't find any video in this Instagram post.","index#program@alert_dontFound":'Did you open any Instagram post? Like for example
',"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"},"de-DE":{"helpers.localize_defaultlang":"Ausgewählte Sprache: ${LANG_DEFAULT} \n Weitere Informationen zu den unterstützten Sprachen findest du auf http://thinkbig-company.github.io/instantgram","index@alert_onlyWorks":"Funktioniert nur auf instagram.com","index#program#post@alert_imageDontFound":"Wir konnten leider kein Bild finden :-(","index#program#post@alert_videoDontFound":"Wir konnten leider kein Video finden :-(","index#program#modalPost@alert_imageDontFound":"Wir konnten kein Bild in diesem Post finden.","index#program#modalPost@alert_videoDontFound":"Wir konnten kein Video in diesem Post finden.","index#program@alert_dontFound":'Hast du einen Instagram Post geöffnet? Zum Beispiel
',"modules.modal@isLoading":"Wird versucht zu laden","modules.update@consoleWarnOutdatedInfo":"[instantgram] ist veraltet. Bitte besuche die Seite http://thinkbig-company.github.io/instantgram für ein Update.","modules.update@consoleWarnOutdatedInfoVersions":"[instantgram] Installierte Version ${data.version} | Neue Version: ${data.onlineVersion}","modules.update@determineIfGetUpdateIsNecessary_contacting":"[instantgram] sucht nach neuen verfügbaren Updates...","modules.update@determineIfGetUpdateIsNecessary_updated":"[instantgram] wurde aktualisiert.","modules.update@determineIfGetUpdateIsNecessary_@update_available":"Es ist ein neues Update verfügbar","modules.update@determineIfGetUpdateIsNecessary_@load_update":"Update laden"},"pt-BR":{"helpers.localize_defaultlang":"[instantgram] idioma configurado: ${LANG_DEFAULT} \npara mais informações sobre os idiomas suportados, acesse http://thinkbig-company.github.io/instantgram","index@alert_onlyWorks":"[instantgram] somente funciona no instagram.com","index#program#post@alert_imageDontFound":"Infelizmente não conseguimos encontrar uma foto :-(","index#program#post@alert_videoDontFound":"Infelizmente não conseguimos encontrar um vídeo :-(","index#program#modalPost@alert_imageDontFound":"Não foi possível encontrar uma foto neste post.","index#program#modalPost@alert_videoDontFound":"Não foi possível encontrar um vídeo neste post.","index#program@alert_dontFound":'ops, você está em algum post do instagram? ex:
',"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"}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,o.default)({width:400,content:"

[instantgram]v"+e.VERSION+"


"+(0,r.default)("index#program@alert_dontFound")+"

"}).afterCreate((function(e){e.modalElem().addEventListener("click",(function(t){t.target&&t.target.matches(".ok")&&e.close(!0)}))})).afterClose((function(e,t){e.destroy()})).show()};var r=a(n(0)),o=a(n(1));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(0)),o=i(n(11)),a=i(n(1));function i(e){return e&&e.__esModule?e:{default:e}}function l(e){console.warn((0,r.default)("modules.update@consoleWarnOutdatedInfo")),console.warn((0,r.default)("modules.update@consoleWarnOutdatedInfoVersions").replace("${data.version}",e.version).replace("${data.onlineVersion}",e.onlineVersion))}t.default=function(e){(function(e){var t=window.localStorage.getItem("instantgram");return!t||(t=JSON.parse(t),(0,o.default)(e,"> "+t.version)&&window.localStorage.setItem("instantgram",JSON.stringify({version:e,onlineVersion:t.onlineVersion,lastVerification:t.lastVerification,dateExpiration:t.dateExpiration})),(0,o.default)(t.onlineVersion,"> "+t.version)&&l(t),Date.now()>t.dateExpiration)})(e)&&(console.info((0,r.default)("modules.update@determineIfGetUpdateIsNecessary_contacting")),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){var n=t.data.user.edge_owner_to_timeline_media.edges[0].node.edge_media_to_caption.edges[0].node.text,i=n.match(/(\*|\d+(\.\d+){0,2}(\.\*)?)+/gm)[0],u=new Date;(u.setDate(u.getDate()+2),window.localStorage.setItem("instantgram",JSON.stringify({version:e,onlineVersion:i,lastVerification:Date.now(),dateExpiration:u.valueOf()})),console.info((0,r.default)("modules.update@determineIfGetUpdateIsNecessary_updated")),console.log(t),(0,o.default)(i,"> "+e))?((0,a.default)({width:400,content:"

[instantgram]v"+e+"


"+(0,r.default)("modules.update@determineIfGetUpdateIsNecessary_@update_available")+"


Changelog

"+n.split("Changelog ")[1]+"

"+(0,r.default)("modules.update@determineIfGetUpdateIsNecessary_@load_update")+"
"}).afterCreate((function(e){e.modalElem().addEventListener("click",(function(t){t.target&&t.target.matches(".ok")&&e.close(!0)}))})).afterClose((function(e,t){e.destroy()})).show(),l(JSON.parse(window.localStorage.getItem("instantgram")))):console.info(window.localStorage.getItem("instantgram"))})).catch((function(e){console.error("Error:",e)})))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){var e=/^(<|>|[=!<>]=)?\s*(\d+(?:\.\d+){0,2})([a-z][a-z0-9\-]*)?$/i;function t(t,n){var r=(t+"").match(e);return r?(n?r[1]||"==":"")+'"'+(r[2]+".0.0").match(/\d+(?:\.\d+){0,2}/)[0].replace(/(?:^|\.)(\d+)/g,(function(e,t){return Array(9-t.length).join(0)+t}))+(r[3]||"~")+'"':n?"==0":1}return function(e){e=t(e);for(var n,r=1;n=arguments[r++];)if(!new Function("return "+e+t(n,1))())return!1;return!0}}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=!1;if(e.regexRootPath.test(e.path))try{e:if(null==document.querySelectorAll("main > section")||1!==document.querySelectorAll("main > section").length)n=!1,e.foundVideo=!1,t(n,e);else{for(var s=document.querySelector("main > section").querySelectorAll("div > div > div > article"),c=void 0,f=void 0,g=0;g div > div > div > video");if(null!=h){c=h,f=h.src;break}}var m=null;if(null!=g&&null!=s&&null!=s[g]){var p=[].concat(d(s[g].querySelectorAll("div > div > div > div > div > div > div > ul:first-child > li"))).filter((function(e){return null!=e.firstChild&&e.classList.length>0}));if(null!=p&&p.length>0){c=null,f=null;for(var v=!1,y=[].concat(d(s[g].children[2].querySelector("div > div").children[1].children)),b=0;b1&&(m=b),m==y.length-1){v=!0;break}for(var x=0;x6&&4==m?p[1]:y.length>6&&5==m||y.length>6&&6==m?p[2]:y.length>6&&7==m?p[1]:y.length>6&&8==m?p[2]:p[m-1]),null!=c&&null!=c.querySelector("video")){f=c.querySelector("video").src;break}}}if(f){if(-1!==f.indexOf("blob:")){(0,u.default)({width:400,content:"

[instantgram]v"+e.VERSION+"


"+(0,i.default)()+"


"+(0,r.default)("modules.modal@isLoading")+"

",closeButton:!1,overlayClose:!1}).afterCreate((function(e){(0,a.default)(e.modalElem().querySelector("#loading_dot"))})).afterShow((function(r){setTimeout((function(){(0,o.default)(c,(function(o){r.close(),o?(n=!0,e.foundVideo=!0,e.foundByModule="searchVideoInFeed",window.open(o),t(n,e)):(n=!1,e.foundVideo=!1,e.foundByModule="searchVideoInFeed",t(n,e))}))}),500)})).afterClose((function(e,t){e.destroy()})).show();break e}n=!0,e.foundVideo=!0,e.foundByModule="searchVideoInFeed",window.open(f),t(n,e)}else n=!1,e.foundVideo=!1,t(n,e)}}catch(t){console.error("searchVideoInFeed()","[instantgram] "+e.VERSION,t)}};var r=s(n(0)),o=s(n(4)),a=s(n(5)),i=s(n(6)),l=s(n(2)),u=s(n(1));function s(e){return e&&e.__esModule?e:{default:e}}function d(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0){setTimeout(r,o);try{e.call(null)}catch(e){throw a=0,e.toString()}}});var o,a;setTimeout(r,t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o,a,i=n(3),l=(r=i)&&r.__esModule?r:{default:r};t.default=(o=regeneratorRuntime.mark((function e(t){var n,r,o,a,i,u,s,d,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!1,!t.regexStoriesURI.test(t.path)){e.next=43;break}if(e.prev=2,r=document.getElementById("react-root"),o=r.querySelectorAll("video > source"),a=r.querySelectorAll("img[srcset]"),u=null,!(o.length>0)){e.next=16;break}n=!0,t.foundVideo=!0,t.foundByModule="searchImageVideoInStories",i=o[0].src.replace("amp;","&"),window.open(i),e.next=37;break;case 16:s=void 0,d=0;case 18:if(!(d0)){e.next=22;break}return s=a[d],e.abrupt("break",25);case 22:d++,e.next=18;break;case 25:return e.next=27,(0,l.default)(s);case 27:if(!(u=e.sent)){e.next=35;break}n=!0,t.foundImage=!0,t.foundByModule="searchImageVideoInStories",u=u.replace("amp;","&"),window.open(u),e.next=37;break;case 35:n=!1,t.foundImage=!1;case 37:!1===n&&t.videos.length>0&&(!(c=t.videos[0].src)&&t.videos[0].children&&(c=t.videos[0].children[0].src),c&&(window.open(c),n=!0,t.foundVideo=!0,t.foundByModule="searchImageVideoInStories")),e.next=43;break;case 40:e.prev=40,e.t0=e.catch(2),console.error("searchImageVideoInStories()","[instantgram] "+t.VERSION,e.t0);case 43:return e.abrupt("return",n);case 44:case"end":return e.stop()}}),e,this,[[2,40]])})),a=function(){var e=o.apply(this,arguments);return new Promise((function(t,n){return function r(o,a){try{var i=e[o](a),l=i.value}catch(e){return void n(e)}if(!i.done)return Promise.resolve(l).then((function(e){r("next",e)}),(function(e){r("throw",e)}));t(l)}("next")}))},function(e){return a.apply(this,arguments)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=!1;if(e.regexPostPath.test(e.path))try{e:if(null==document.getElementsByTagName("article")||1!==document.getElementsByTagName("article").length)n=!1,e.foundVideo=!1,t(n,e);else{for(var s=document.querySelector("main").querySelectorAll("div > div > article"),c=void 0,f=void 0,g=0;g div > div > div > video");if(null!=h){c=h,f=h.src;break}}var m=null;if(null!=g&&null!=s&&null!=s[g]){var p=[].concat(d(s[g].querySelectorAll("div > div > div > div > div > div > div > ul:first-child > li"))).filter((function(e){return null!=e.firstChild&&e.classList.length>0}));if(null!=p&&p.length>0){c=null,f=null;for(var v=!1,y=[].concat(d(s[0].children[2].querySelector("div > div").children[1].children)),b=0;b1&&(m=b),m==y.length-1){v=!0;break}for(var x=0;x6&&4==m?p[1]:y.length>6&&5==m||y.length>6&&6==m?p[2]:y.length>6&&7==m?p[1]:y.length>6&&8==m?p[2]:p[m-1]),null!=c&&null!=c.querySelector("video")){f=c.querySelector("video").src;break}}}if(f){if(-1!==f.indexOf("blob:")){(0,u.default)({width:400,content:"

[instantgram]v"+e.VERSION+"


"+(0,i.default)()+"


"+(0,r.default)("modules.modal@isLoading")+"

",closeButton:!1,overlayClose:!1}).afterCreate((function(e){(0,a.default)(e.modalElem().querySelector("#loading_dot"))})).afterShow((function(r){setTimeout((function(){(0,o.default)(c,(function(o){r.close(),o?(n=!0,e.foundVideo=!0,e.foundByModule="searchVideoInPost",window.open(o),t(n,e)):(n=!1,e.foundVideo=!1,e.foundByModule="searchVideoInPost",t(n,e))}))}),500)})).afterClose((function(e,t){e.destroy()})).show();break e}n=!0,e.foundVideo=!0,e.foundByModule="searchVideoInPost",window.open(f),t(n,e)}else n=!1,e.foundVideo=!1,t(n,e)}}catch(t){console.error("searchVideoInPost()","[instantgram] "+e.VERSION,t)}};var r=s(n(0)),o=s(n(4)),a=s(n(5)),i=s(n(6)),l=s(n(2)),u=s(n(1));function s(e){return e&&e.__esModule?e:{default:e}}function d(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=4);c++);if(null==document.getElementsByTagName("article")||null==document.getElementsByTagName("article")[c].getAttribute("role"))n=!1,e.foundVideo=!1,t(n,e);else{var f=document.getElementsByTagName("article")[c],g=void 0,h=void 0;if((0,l.default)(f)){var m=f.querySelector("div > div > div > div > video");null!=m&&(g=m,h=m.src)}var p=null;if(null!=f){var v=[].concat(d(f.querySelectorAll("div > div > div > div > div > div > div > ul:first-child > li"))).filter((function(e){return null!=e.firstChild&&e.classList.length>0}));if(null!=v&&v.length>0){g=null,h=null;for(var y=!1,b=[].concat(d(f.children[2].querySelector("div > div").children[1].children)),x=0;x1&&(p=x),p==b.length-1){y=!0;break}for(var k=0;k6&&4==p?v[1]:b.length>6&&5==p||b.length>6&&6==p?v[2]:b.length>6&&7==p?v[1]:b.length>6&&8==p?v[2]:v[p-1]),null!=g&&null!=g.querySelector("video")){h=g.querySelector("video").src;break}}}if(h){if(-1!==h.indexOf("blob:")){(0,u.default)({width:400,content:"

[instantgram]v"+e.VERSION+"


"+(0,i.default)()+"


"+(0,r.default)("modules.modal@isLoading")+"

",closeButton:!1,overlayClose:!1}).afterCreate((function(e){(0,a.default)(e.modalElem().querySelector("#loading_dot"))})).afterShow((function(r){setTimeout((function(){(0,o.default)(g,(function(o){r.close(),o?(n=!0,e.foundVideo=!0,e.foundByModule="searchVideoInModalPost",window.open(o),t(n,e)):(n=!1,e.foundVideo=!1,e.foundByModule="searchVideoInModalPost",t(n,e))}))}),500)})).afterClose((function(e,t){e.destroy()})).show();break e}n=!0,e.foundVideo=!0,e.foundByModule="searchVideoInModalPost",window.open(h),t(n,e)}else n=!1,e.foundVideo=!1,t(n,e)}}}catch(t){console.error("searchVideoInModalPost()","[instantgram] "+e.VERSION,t)}};var r=s(n(0)),o=s(n(4)),a=s(n(5)),i=s(n(6)),l=s(n(2)),u=s(n(1));function s(e){return e&&e.__esModule?e:{default:e}}function d(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t section")||1!==document.querySelectorAll("main > section").length){e.next=58;break}r=document.querySelector("main > section"),o=r.querySelectorAll("div > div > div > article"),l=null,s=null,d=0;case 9:if(!(d div > div > div > img"))){e.next=19;break}return l=c,e.next=16,(0,a.default)(c);case 16:return(f=e.sent).length>0&&(s=f),e.abrupt("break",22);case 19:d++,e.next=9;break;case 22:if(null==d||null==o||null==o[d]){e.next=55;break}if(!(null!=(g=[].concat(u(o[d].querySelectorAll("div > div > div > div > div > div > div > ul:first-child > li"))).filter((function(e){return null!=e.firstChild&&e.classList.length>0})))&&g.length>1)){e.next=55;break}l=null,s=null,h=void 0,m=!1,p=[].concat(u(o[d].children[2].querySelector("div > div").children[1].children)),v=0;case 31:if(!(v1&&(h=v),h!=p.length-1){e.next=36;break}return m=!0,e.abrupt("break",39);case 36:v++,e.next=31;break;case 39:y=0;case 40:if(!(y6&&4==h?g[1]:p.length>6&&5==h||p.length>6&&6==h?g[2]:p.length>6&&7==h?g[1]:p.length>6&&8==h?g[2]:g[h-1]),null==l||null==l.querySelector("img[srcset]")){e.next=50;break}return e.next=45,(0,a.default)(l.querySelector("img[srcset]"));case 45:return(b=e.sent).length>0&&(s=b),e.abrupt("break",55);case 50:return null!=l.querySelector("img[src]")&&(s=l.querySelector("img[src]").src),e.abrupt("break",55);case 52:y++,e.next=40;break;case 55:return t.setImageLink(s),t.imageLink?(n=!0,t.foundImage=!0,t.foundByModule="searchImageInFeed",window.open(t.imageLink)):(n=!1,t.foundImage=!1),e.abrupt("break",58);case 58:e.next=63;break;case 60:e.prev=60,e.t0=e.catch(2),console.error("searchImageInFeed()","[instantgram] "+t.VERSION,e.t0);case 63:return e.abrupt("return",n);case 64:case"end":return e.stop()}}),e,this,[[2,60]])})),o=function(){var e=r.apply(this,arguments);return new Promise((function(t,n){return function r(o,a){try{var i=e[o](a),l=i.value}catch(e){return void n(e)}if(!i.done)return Promise.resolve(l).then((function(e){r("next",e)}),(function(e){r("throw",e)}));t(l)}("next")}))},function(e){return o.apply(this,arguments)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o,a=l(n(3)),i=l(n(2));function l(e){return e&&e.__esModule?e:{default:e}}function u(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t div > article"),l=null,s=null,d=0;case 9:if(!(d div > div > div > img"))){e.next=19;break}return l=c,e.next=16,(0,a.default)(c);case 16:return(f=e.sent).length>0&&(s=f),e.abrupt("break",22);case 19:d++,e.next=9;break;case 22:if(null==d||null==o||null==o[d]){e.next=55;break}if(!(null!=(g=[].concat(u(o[d].querySelectorAll("div > div > div > div > div > div > div > ul:first-child > li"))).filter((function(e){return null!=e.firstChild&&e.classList.length>0})))&&g.length>0)){e.next=55;break}l=null,s=null,h=void 0,m=!1,p=[].concat(u(o[d].children[2].querySelector("div > div").children[1].children)),v=0;case 31:if(!(v1&&(h=v),h!=p.length-1){e.next=36;break}return m=!0,e.abrupt("break",39);case 36:v++,e.next=31;break;case 39:y=0;case 40:if(!(y6&&4==h?g[1]:p.length>6&&5==h||p.length>6&&6==h?g[2]:p.length>6&&7==h?g[1]:p.length>6&&8==h?g[2]:g[h-1]),null==l||null==l.querySelector("img[srcset]")){e.next=50;break}return e.next=45,(0,a.default)(l.querySelector("img[srcset]"));case 45:return(b=e.sent).length>0&&(s=b),e.abrupt("break",55);case 50:return null!=l.querySelector("img[src]")&&(s=l.querySelector("img[src]").src),e.abrupt("break",55);case 52:y++,e.next=40;break;case 55:return t.setImageLink(s),t.imageLink?(n=!0,t.foundImage=!0,t.foundByModule="searchImageInPost",window.open(t.imageLink)):(n=!1,t.foundImage=!1),e.abrupt("break",58);case 58:e.next=63;break;case 60:e.prev=60,e.t0=e.catch(2),console.error("searchImageInPost()","[instantgram] "+t.VERSION,e.t0);case 63:return e.abrupt("return",n);case 64:case"end":return e.stop()}}),e,this,[[2,60]])})),o=function(){var e=r.apply(this,arguments);return new Promise((function(t,n){return function r(o,a){try{var i=e[o](a),l=i.value}catch(e){return void n(e)}if(!i.done)return Promise.resolve(l).then((function(e){r("next",e)}),(function(e){r("throw",e)}));t(l)}("next")}))},function(e){return o.apply(this,arguments)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o,a=l(n(3)),i=l(n(2));function l(e){return e&&e.__esModule?e:{default:e}}function u(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=4)){e.next=10;break}return e.abrupt("break",13);case 10:o++,e.next=7;break;case 13:if(null==document.getElementsByTagName("article")||null==document.getElementsByTagName("article")[o].getAttribute("role")){e.next=61;break}if(l=document.getElementsByTagName("article")[o],s=null,d=null,!(0,i.default)(l)){e.next=25;break}if(null==(c=l.querySelector("img[srcset]"))){e.next=25;break}return s=c,e.next=23,(0,a.default)(c);case 23:(f=e.sent).length>0&&(d=f);case 25:if(null==l){e.next=58;break}if(!(null!=(g=[].concat(u(l.querySelectorAll("div > div > div > div > div > div > div > ul:first-child > li"))).filter((function(e){return null!=e.firstChild&&e.classList.length>0})))&&g.length>0)){e.next=58;break}s=null,d=null,h=void 0,m=!1,p=[].concat(u(l.children[2].querySelector("div > div").children[1].children)),v=0;case 34:if(!(v1&&(h=v),h!=p.length-1){e.next=39;break}return m=!0,e.abrupt("break",42);case 39:v++,e.next=34;break;case 42:y=0;case 43:if(!(y6&&4==h?g[1]:p.length>6&&5==h||p.length>6&&6==h?g[2]:p.length>6&&7==h?g[1]:p.length>6&&8==h?g[2]:g[h-1]),null==s||null==s.querySelector("img[srcset]")){e.next=53;break}return e.next=48,(0,a.default)(s.querySelector("img[srcset]"));case 48:return(b=e.sent).length>0&&(d=b),e.abrupt("break",58);case 53:return null!=s.querySelector("img[src]")&&(d=s.querySelector("img[src]").src),e.abrupt("break",58);case 55:y++,e.next=43;break;case 58:return t.setImageLink(d),t.imageLink?(n=!0,t.foundImage=!0,t.foundByModule="searchImageInModalPost",window.open(t.imageLink)):(n=!1,t.foundImage=!1),e.abrupt("break",61);case 61:e.next=66;break;case 63:e.prev=63,e.t0=e.catch(2),console.error("searchImageInModalPost()","[instantgram] "+t.VERSION,e.t0);case 66:return e.abrupt("return",n);case 67:case"end":return e.stop()}}),e,this,[[2,63]])})),o=function(){var e=r.apply(this,arguments);return new Promise((function(t,n){return function r(o,a){try{var i=e[o](a),l=i.value}catch(e){return void n(e)}if(!i.done)return Promise.resolve(l).then((function(e){r("next",e)}),(function(e){r("throw",e)}));t(l)}("next")}))},function(e){return o.apply(this,arguments)})}]); \ No newline at end of file diff --git a/index.html b/index.html index ccf9ed7..e5807a8 100644 --- a/index.html +++ b/index.html @@ -50,7 +50,7 @@

Instantgram

☁️ A bookmarklet for downloading images from Instagram.

- [instantgram 7.1.0]
+ [instantgram 7.1.1]
drag this button to the bookmark bar of your browser. @@ -58,7 +58,7 @@

☁️ A bookmarklet for downloading images from Ins

[instantgram]

-

version +

version badge

[instantgram] is a bookmarklet for downloading single images from Instagram. Tiny, simple, without any further extensions or downloads. Just drag the [instantgram] button to the bookmark bar of your browser, open any Instagram post and click on the bookmarklet. Just works :-)

diff --git a/lang/de-de/index.html b/lang/de-de/index.html index 3f26c0d..9ef4d1f 100644 --- a/lang/de-de/index.html +++ b/lang/de-de/index.html @@ -50,7 +50,7 @@

Instantgram

☁️ Ein Bookmarklet, um Bilder auf Instagram herunterzuladen

- [instantgram 7.1.0]
+ [instantgram 7.1.1]
Ziehe diesen Button in die Favoritenleiste deines Browsers. @@ -58,7 +58,7 @@

☁️ Ein Bookmarklet, um Bilder auf Instagram heru

[instantgram]

-

version +

version badge

[instantgram] ist ein Bookmarklet, um einzelne Instagram Bilder herunterzuladen. Klein, simpel, ohne Abhängigkeiten zu anderen Erweiterungen oder Downloads. Ziehe einfach den [instantgram] button in die Favoritenleiste deines Browsers, öffne einen einzelnen Instagram Post und klicke auf das Bookmarklet. So einfach :-)

diff --git a/lang/en-us/index.html b/lang/en-us/index.html index ccf9ed7..e5807a8 100644 --- a/lang/en-us/index.html +++ b/lang/en-us/index.html @@ -50,7 +50,7 @@

Instantgram

☁️ A bookmarklet for downloading images from Instagram.

- [instantgram 7.1.0]
+ [instantgram 7.1.1]
drag this button to the bookmark bar of your browser. @@ -58,7 +58,7 @@

☁️ A bookmarklet for downloading images from Ins

[instantgram]

-

version +

version badge

[instantgram] is a bookmarklet for downloading single images from Instagram. Tiny, simple, without any further extensions or downloads. Just drag the [instantgram] button to the bookmark bar of your browser, open any Instagram post and click on the bookmarklet. Just works :-)

diff --git a/lang/pt-br/index.html b/lang/pt-br/index.html index b3fb1a7..18c726f 100644 --- a/lang/pt-br/index.html +++ b/lang/pt-br/index.html @@ -50,7 +50,7 @@

Instantgram

☁️ Um bookmarklet para download de fotos do Instagram

- [instantgram 7.1.0]
+ [instantgram 7.1.1]
arraste o botão acima para a barra de favoritos do navegador @@ -58,7 +58,7 @@

☁️ Um bookmarklet para download de fotos do Inst

[instantgram]

-

version +

version badge

[instantgram] é um bookmarklet com a função de baixar imagens do Instagram. Pequeno, simples, sem necessidade de extensões ou downloads. Só é necessário arrastar o link do [instantgram] para a barra de favoritos do seu navegador, ir até o instagram.com (versão web), abrir um post e clicar no bookmarklet. Simples e funcional.

diff --git a/package.json b/package.json index 8731d94..c40cb7c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "instantgram", - "version": "7.1.0", + "version": "7.1.1", "description": "A bookmarklet for download photos in Instagram", "main": "src/index.js", "scripts": { diff --git a/src/_langs/partials/button.html b/src/_langs/partials/button.html index f5a93ed..ab21cec 100644 --- a/src/_langs/partials/button.html +++ b/src/_langs/partials/button.html @@ -1 +1 @@ -[instantgram 7.1.0] \ No newline at end of file +[instantgram 7.1.1] \ No newline at end of file diff --git a/src/helpers/getBlobVideoUrl.js b/src/helpers/getBlobVideoUrl.js index ffa9c6d..615a7d1 100644 --- a/src/helpers/getBlobVideoUrl.js +++ b/src/helpers/getBlobVideoUrl.js @@ -1,97 +1,11 @@ import forEach from '../helpers/forEach.js' import getDataFromUrl from '../helpers/getDataFromUrl.js' -export default function getBlobVideoUrl(article, el, pos, callback) { +export default function getBlobVideoUrl(videoEl, callback) { - // Define some things - let isMultiVideo = (pos != null) ? true : false - let userId = null - let userName = article.querySelectorAll('header > div > div > div > span > a')[0].text - let userProfileUrl = article.querySelectorAll('header > div > div > div > span > a')[0].href - let videoUrl = null + const instanceKey = Object.keys(videoEl).find(key => key.includes('Instance')) + const reactVideoEl = videoEl[instanceKey] + const videoUrl = reactVideoEl.return.memoizedProps.fallbackSrc - // Will be used only for single video posts - if (!isMultiVideo) { - var posterRegex = /poster\=\"([\s\S]*)\" preload/gm - var posterRegexMatch = posterRegex.exec(el.outerHTML.replace(/(\r\n|\n|\r)/gm, '')) - var videoPosterUrl = null - if (posterRegexMatch) { - // HACK - let div = document.createElement('textarea') - div.innerHTML = posterRegexMatch[1] - let decoded = div.firstChild.nodeValue - //div.parentNode.removeChild(div) - - videoPosterUrl = decoded - } - var videoPosterFilename = videoPosterUrl.split('/').pop().split('#')[0].split('?')[0] - } - // - - // Stage 1 - // Fetch user id from element - let userProfileUrlResponseData = null - getDataFromUrl(userProfileUrl, function(data) { - userProfileUrlResponseData = data - }) - - if (userProfileUrlResponseData) { - userProfileUrlResponseData = userProfileUrlResponseData.replace(/(\r\n|\n|\r)/gm, '') - - let m - let entries - 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, groupIndex) => { - userId = match - }) - } - } - - // Stage 2 - // Fetch the user data until the file name is found - if (userId) { - let userMediaFeedResponseData = null - getDataFromUrl('https://www.instagram.com/graphql/query/?query_hash=003056d32c2554def87228bc3fd9668a&variables={"id":' + userId + ',"first":100}', function(data) { - userMediaFeedResponseData = data - }) - - if (userMediaFeedResponseData) { - let json = JSON.parse(userMediaFeedResponseData) - - for (let _fI = 0; _fI < json.data.user.edge_owner_to_timeline_media.edges.length; _fI++) { - // Handle different instagram post types - // Single Video - if (!isMultiVideo) { - if (json.data.user.edge_owner_to_timeline_media.edges[_fI].node.__typename == 'GraphVideo') { - let GraphVideoNode = json.data.user.edge_owner_to_timeline_media.edges[_fI].node - if (videoPosterFilename == GraphVideoNode.display_url.split('/').pop().split('#')[0].split('?')[0]) { - videoUrl = GraphVideoNode.video_url - - // There exists only one node so break it no need to further analyze - break - } - } - // Multi Post which can have a video - } else { - if (json.data.user.edge_owner_to_timeline_media.edges[_fI].node.__typename == 'GraphSidecar') { - if (json.data.user.edge_owner_to_timeline_media.edges[_fI].node.hasOwnProperty('edge_sidecar_to_children')) { - let GraphSidecarNode = json.data.user.edge_owner_to_timeline_media.edges[_fI].node.edge_sidecar_to_children.edges[pos].node - videoUrl = GraphSidecarNode.video_url - - break - } - } - } - } - } - } - - callback(videoUrl ? videoUrl : false) + callback(videoUrl.length > 0 ? videoUrl : false) } \ No newline at end of file diff --git a/src/modules/searchVideoInFeed.js b/src/modules/searchVideoInFeed.js index 9a536e1..71ea876 100644 --- a/src/modules/searchVideoInFeed.js +++ b/src/modules/searchVideoInFeed.js @@ -120,10 +120,10 @@ export default function searchVideoInFeed(program, callback) { getLoadingDots(modal.modalElem().querySelector('#loading_dot')) }).afterShow(modal => { setTimeout(function() { - getBlobVideoUrl($article[i], mediaEl, _currentSelectedControlIndex, function(scrapedBlobVideoUrl) { - if (scrapedBlobVideoUrl) { - modal.close() + getBlobVideoUrl(mediaEl, function(scrapedBlobVideoUrl) { + modal.close() + if (scrapedBlobVideoUrl) { found = true program.foundVideo = true program.foundByModule = 'searchVideoInFeed' @@ -132,7 +132,6 @@ export default function searchVideoInFeed(program, callback) { callback(found, program) } else { - modal.close() found = false program.foundVideo = false diff --git a/src/modules/searchVideoInModalPost.js b/src/modules/searchVideoInModalPost.js index 0974816..3b32142 100644 --- a/src/modules/searchVideoInModalPost.js +++ b/src/modules/searchVideoInModalPost.js @@ -115,7 +115,7 @@ export default function searchVideoInModalPost(program, callback) { if (videoLink) { if (videoLink.indexOf('blob:') !== -1) { - let blobLoaderModal = picoModal({ + picoModal({ width: 400, content: "

[instantgram]v" + program.VERSION + "


" + "

" + getPreLoader() + "

" + @@ -128,10 +128,10 @@ export default function searchVideoInModalPost(program, callback) { getLoadingDots(modal.modalElem().querySelector('#loading_dot')) }).afterShow(modal => { setTimeout(function() { - getBlobVideoUrl($article, mediaEl, _currentSelectedControlIndex, function(scrapedBlobVideoUrl) { - if (scrapedBlobVideoUrl) { - blobLoaderModal.close() + getBlobVideoUrl(mediaEl, function(scrapedBlobVideoUrl) { + modal.close() + if (scrapedBlobVideoUrl) { found = true program.foundVideo = true program.foundByModule = 'searchVideoInModalPost' @@ -140,8 +140,6 @@ export default function searchVideoInModalPost(program, callback) { callback(found, program) } else { - blobLoaderModal.close() - found = false program.foundVideo = false program.foundByModule = 'searchVideoInModalPost' diff --git a/src/modules/searchVideoInPost.js b/src/modules/searchVideoInPost.js index f05baa3..4ff1eda 100644 --- a/src/modules/searchVideoInPost.js +++ b/src/modules/searchVideoInPost.js @@ -120,10 +120,10 @@ export default function searchVideoInPost(program, callback) { getLoadingDots(modal.modalElem().querySelector('#loading_dot')) }).afterShow(modal => { setTimeout(function() { - getBlobVideoUrl($article[i], mediaEl, _currentSelectedControlIndex, function(scrapedBlobVideoUrl) { - if (scrapedBlobVideoUrl) { - modal.close() + getBlobVideoUrl(mediaEl, function(scrapedBlobVideoUrl) { + modal.close() + if (scrapedBlobVideoUrl) { found = true program.foundVideo = true program.foundByModule = 'searchVideoInPost' @@ -132,8 +132,6 @@ export default function searchVideoInPost(program, callback) { callback(found, program) } else { - modal.close() - found = false program.foundVideo = false program.foundByModule = 'searchVideoInPost'