Skip to content
This repository has been archived by the owner on Oct 27, 2023. It is now read-only.

SanjayDevTech/instautils

Repository files navigation

Insta Utils

Archived

Please check Issue #7

Insta Utils is a Insta post downloader for Android applications written in Java.

Build Status Download

New Features!

Check CHANGELOG for new features and updates

Credits

Insta Utils uses a number of open source libraries to work properly:

  • JSoup - To parse HTML
  • Glide - Url to ImageView

Implementation

Project level

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}

App level

implementation 'com.github.SanjayDevTech:instautils:<latest_version>'

Check Releases for Latest version

Usage

Initialize InstaDownloader

InstaDownloader downloader = new InstaDownloader(this, new InstaResponse() {
    @Override
    public void onResponse(@NotNull InstaTask instaTask) {
        // Retrieve post instance from InstaTask
        InstaPost instaPost = instaTask.getInstaPost();

        if (instaPost != null) {
            // InstaPost has something in it

            // Log the direct url
            Log.d(TAG, instaPost.getUrl());

            // set the post object to ImageView
            downloader.setImage(instaPost, displayImageView);

            // Log the type (0 => Image, 1 => Video or 2 => Profile)
            Log.d(TAG, "Type: " + instaPost.getType());
        } else {
            // Log the error
            instaTask.getException().printStackTrace();
        }
    }
});

Instagram profile

String instaProfileUrl = "https://instagram.com/SanjayDevTech";
downloader.getDP(instaProfileUrl);

Instagram Image/Video

String instaPostUrl = "https://www.instagram.com/p/post_id/";
downloader.get(instaPostUrl);

Any Issues?

  • Create a new issue on github
  • Pull requests are welcomed 😀

License


MIT