View Single Post
Old 05.01.2020, 14:28
zmv zmv is offline
Modem User
Join Date: Jan 2020
Posts: 1
Red face

The thing is Instagram generates different html depending on whether you are logged in or not. If you are not then the links to media files can be found in json node entry_data/PostPage where the decrypter will find them. However if you log in this node will be empty, the decrypter will find nothing. The media links will be instead in a separate json in another <script> tag.
You can easily fix this issue by checking if the user is logged in and if he is parsing the content of this tag.

if (parameter.matches(TYPE_GALLERY)) {
            /* Crawl single images & galleries */
            if (logged_in) {
                String graphql = br.getRegex(">window\\.__additionalDataLoaded\\('/p/[^/]+/'\\s*?,\\s*?(\\{.*?)\\);</script>").getMatch(0);
                entries = (LinkedHashMap<String, Object>) JavaScriptEngineFactory.jsonToJavaObject(graphql);
                resource_data_list = new ArrayList<>();
                resource_data_list.add(JavaScriptEngineFactory.walkJson(entries, "/"));
            } else {
                resource_data_list = (ArrayList) JavaScriptEngineFactory.walkJson(entries, "entry_data/PostPage");
            for (final Object galleryo : resource_data_list) {
Reply With Quote