Skip to content

Abhay-cloud/Instagram-Video-Downloader-Library

Repository files navigation

Instagram-Video-Downloader-Library

An easy to use library for directly download videos from ig reels, igtv.

JitPack

Implementation

Step 1. Add the JitPack repository to your build file.

Add it in your root build.gradle at the end of repositories:

 allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Step 2. Add the dependency

dependencies {
	        implementation 'com.github.Abhay-cloud:Instagram-Video-Downloader-Library:0.2.3'
	}

Step 3. Add the following permissions in the Manifest file.

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

Step 4. Don't forget to ask storage permissions. Add the following code in your MainActivity.

if (Build.VERSION.SDK_INT >= 23) {
            if (checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE)
                    == PackageManager.PERMISSION_GRANTED) {
            } else {
                ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1);
            }
        }
        else { //you dont need to worry about these stuff below api level 23

        }

Usage

InstaVideo.downloadVideo(Context, Reels/IGTV video url);

If you want to make your directory then use:

InstaVideo.downloadVideo(Context, Reels/IGTV video url, your directory name); // it'll create new folder in gallery with provided directory name.

You are free to contribute here. I'll add more awesome updates in near future.

Connect with me

If you have any difficulty then just message me on Instagram or Telegram.

LICENSE

Project is published under the Apache 2.0 license. Feel free to clone and modify repository as you want, but don't forget to add reference to authors.

Made with ❤️ by Abhay