Giter Club home page Giter Club logo

easyinsta's Introduction

EasyInsta

Languages-Java Version Instagram - x0.rahil Downloads GitHub Repo stars

An library through which you can use instagram programatically. You can say that this is a well optimize, will featured wrapper of instagram4j library. You can send direct messages, add stories, post photos, scrap profiles and can do many more things with this library.

Disclaimer ⚠: This API is private. Means that instagram has not documented or allowed others to use this API. If you are using this API harshly then instagram may ban your account. Developers will not be responsible for anything happend to your account.

Banner

Announcement πŸ”Š

A brand new library is been planed to be created as replacement of instagram4j. The new library will be more easy, optimised, and safe (less challenges) to use. The library will be based on the privaye api of web version of instagram. If you want to contribute on making of that new lib, please ping me at @x0.rahil on instagram. Little help is appreciated πŸ’–

To get started, you need to discover/reverse engineer instagram endpoints and add it to OpenAPI spec.json

Features

  • Lightweight and Easy 2 use
  • No need api token
  • Supports Sending messages
  • Supports Getting/fetching messages
  • Supports Deleting message
  • Supports Spamming DMs
  • Supports Realtime direct messages listener
  • Supports Login using cache/saving sessions
  • Supports Posting
  • Supports Adding stories
  • Supports Following/Unfollowing others
  • Supports Acception/Ignoring follow request
  • Supports Scrapping followings and followers
  • Supports Getting profile data
  • Supports Liking/commenting on post
  • Supports Fetching feeds/timeline post
  • Supports Downloading posts and pfp

Implimentation

In your project build.gradle

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

In your app build.gradle

dependencies {
	        implementation 'com.github.ErrorxCode:EasyInsta:TAG'
		implementation 'com.github.ErrorxCode:AsyncTask:1.0'
	}

Version

Acknowledgements

Its easy :-)

Instagram.login("username","password").actions().doSomething().addOnCompleteListener(task -> {
    if (task.isSuccessful())
        System.out.println("Success");
    else 
        task.getException().printStackTrace();
});

Documentation

Java docs [OUTDATED]

Guide

FAQ

[Q.1] Can we use this library to make bots ?

Answer. Yes. But Instagram don't allow to make bots with their officail graph APIs. Altho This is not the officail api, but you should still follow the usage limits to prevent detection.

[Q.2] Can we download stories or posts using this API ?

Answer. Yes, not stories but you can download pfp and posts.

[Q.3] Does use of this library requires any tokens or other keys ?

Answer. No. You only need to have username and password of the account.

[Q.4] In android, can we use webview to login?

Answer. Yes, check this example on how to use that

Contributing

Contributions are always welcome!

Please refer to Contribution guide. aslo see the code of conduct

Support

For support, follow us on instagram. It would be nice if you give this repo a star.

easyinsta's People

Contributors

errorxcode avatar nshah-capri avatar sergiobarbero avatar ss-brandon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

easyinsta's Issues

Maven Import

Is there any reason for this not to be accessible to download via Maven?

Repro Steps

  • Added the following dependency to my Pom.xml file.
<dependency>
    <groupId>com.github.ErrorxCode</groupId>
    <artifactId>EasyInsta</artifactId>
    <version>2.7.2</version>
</dependency>

Get posts by tag - Endpoint changed?

Hello, I wanted to ask if you know the endpoint of getting the posts by providing a tag. I believe they recently changed it because it used to work with https://i.instagram.com/api/v1/feed/tag/exampletag but now it says "Page not found". Thanks!

please add instagram live requests

Please add the methods related to creating a live stream, starting a live stream, and ending a live stream to the library. Thank you.

Error while sending photos, always get 400 from Insta

Error while sending photos, always get 400 from Insta


File p = new File("temp.png");
            if(p.exists() ) {
                log.info("PICTURE EXIST "  + p.getName()) ;
            }

            AsyncTask<Void> t =  actions.postPhoto(new File("temp.png"), "Another cat stuff ");
            
        Below the response in an ErrorCallBackMethod : 
2022-06-17 14:38:12.582  INFO 23356 --- [stagram.com/...] c.g.instagram4j.instagram4j.IGClient     : Response for https://i.instagram.com/rupload_igphoto/1655473091424_0_5158328113 : 400
2022-06-17 14:38:12.583  INFO 23356 --- [stagram.com/...] c.g.instagram4j.instagram4j.IGClient     : Response for https://i.instagram.com/rupload_igphoto/1655473091424_0_5158328113 with body (truncated) : {"debug_info":{"retriable":false,"type":"ProcessingFailedError","message":"Request processing failed
2022-06-17 14:38:12.585  INFO 23356 --- [onPool-worker-1] c.s.a.s.instacash.service.UserService    : java.util.concurrent.ExecutionException: com.github.instagram4j.instagram4j.exceptions.IGResponseException
java.util.concurrent.CompletionException: java.util.concurrent.ExecutionException: com.github.instagram4j.instagram4j.exceptions.IGResponseException
	at com.xcoder.tasks.AsyncTask.lambda$callAsync$3(AsyncTask.java:42)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.util.concurrent.ExecutionException: com.github.instagram4j.instagram4j.exceptions.IGResponseException
	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2096)
	at com.xcoder.easyinsta.Instagram$Feed.lambda$postPhoto$0(Instagram.java:681)
	at com.xcoder.tasks.AsyncTask.lambda$callAsync$3(AsyncTask.java:40)
	... 7 more
	
Seems like the Insta Client is always returning 400.

Can you please check ? 

[ FEATURE ⚑] Add support to Like/Dislike Posts

Hi! First of all: many thanks for your effort on simplifiying the use of Instagram4J by this amazing library :)

It would be very much appreciated if you can consider to include a way to like and dislike posts.

Thank you very much!

Android SDK Error

When i tried implement that dependency to my project, I am getting an error. The error, appears only when i run the application.

Error;

    class file has wrong version 60.0, should be 55.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.

how to use callable

Hello there.
i really don't know how to put code from my editText to callable for Login2fatctor method.
please help.

thank you

Messages are missing

I am trying to get the messages from a conversation and I have successfully done it with your code. But there is one issue. Some messages are missing, usually the second message counting from the newest. Are you aware of this issue?

`createGroup()` of `Instagram.Direct` is set to private

Discussed in #40

Originally posted by ErrorxCode April 5, 2024
Here, you can talk about anything related to the project. You can ask questions, make announcements, raise queries, highlight problems and talk about the changes in the code or API. If you have any doubt, you can ask it here before creating an issue

How to send image message?

I tried to send an image message using Instagram.Direct.directMessage(String username, File photo).
However, I always got an IGResponseException.
I need your suggestions for sending image messages.
Thanks.

[πŸ“’ Announcement ] The new library (API) is on the way πŸ›£οΈ

We are working on reverse engineering the Instagram API again (but web this time)

A brand new library is been planed to be created as replacement of instagram4j. The new library will be more easy, optimised, and safe (less challenges) to use. The library will be based on the privaye api of web version of instagram. If you want to contribute on making of that new lib, please ping me at @x0.rahil on instagram. Little help is appreciated πŸ’–

To get started, you need to discover/reverse engineer Instagram endpoints and add it to OpenAPI spec.json

Note : Until then, no updates will be pushed to EasyInsta library and all the issue will be taken into account after the first release of that new instagram library

If you want to contribute but don't know what to do, drop "I WANNA HELP" in the reply of this issue and I will what you can do on your behalf.

Thank you,
~ Rahil (Lead developer)

getFollowRequest isn't working more

The method getFollowRequests isn't working. I tried to use it and the return always is 0.
I verified in my personal account by instagram and i have some requests that the users haven't accept yet.

How i can solve it?

Thanks

Insights for own Stories

It would be great have the regular insights for a self story, like the List of people that had seen it, those who give a like, in polls, the ones who votes every option and that

caching session on Android

The session caching mechanism in this library is storing to the filesystem. It would be nice to have a login caching strategy that is secure for android apps.

It would be really nice if the Instagram constructor were public, so it would be easier to write a workaround

Show post

Hi, can we show post of public user name by your library?

Bug, checking image extension when sending image message

Instagram.java

    public AsyncTask<Void> directMessage(@NotNull String username, @NotNull File photo) {
        if (!photo.getName().endsWith(".jpg") || !photo.getName().endsWith(".png") || !photo.getName().endsWith("jpeg"))
            throw new InstagramException("Unsupported file format. Only photos with jpg/png/jpeg extensions are allowed", Reasons.UNSUPPORTED_FILE_FORMAT);

         ....
    }
    
    ==> || to &&
    
     public AsyncTask<Void> directMessage(@NotNull String username, @NotNull File photo) {
        if (!photo.getName().endsWith(".jpg") && !photo.getName().endsWith(".png") && !photo.getName().endsWith("jpeg"))
            throw new InstagramException("Unsupported file format. Only photos with jpg/png/jpeg extensions are allowed", Reasons.UNSUPPORTED_FILE_FORMAT);

         ....
    }       

Cannot access com.xcoder.tasks.AsyncTask

Seems like due to some accessibility issue, AsyncTask class is not available outside of the library. None of the examples provided compile, is there a workaround?

JSONException: A JSONObject text must begin with '{'

When the library could not find profile data using the Public API. Then you will face this kind of exception. Most probably the reason is that the Account has been disabled or API is not working at that instant

The error message will be clearer in the next release.

How to deal with challenge required?

I try to request the followers of a user like this:

    instagram.profile().getFollowers("user1")
            .setOnCompleteCallback(call ->
            {
                if (call.isSuccessful)
                {
                    List<String> followers = call.result;
                    for (String follower : followers)
                    {
                        Print.e(follower);
                    }
                }
            });

But I get the error challenge_required. How to deal with this error?

Is there a way to login with the proxy server?

So in the examples i saw how we can login, but this doesn't work for me.
As for instagram4j implementation we have a method .client inside the builder class. So it can login with proxy.

How can i do the same using you library?

How can I research IG Realtime?

If you guys could provide some sort of guide on how can we research Instagram MQTT traffic. I've succeed in sniffing HTTP traffic and requests to the common endpoints, but still cannot figure out how to intercept MQTToT traffic

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.