antony-jr / ama

:heart: :coffee: :dog: Ask Me Anything. Literally Anything! :paintbrush: :sunglasses:
MIT License
2 stars 1 forks source link

Don't really know how to use as API #13

Closed toraonion closed 6 years ago

toraonion commented 6 years ago

Hi,

I am learning python, I create my own simple script for example like this:

from mypy import myPy
from InstagramPy.InstagramPyCLI import InstagramPyCLI
from InstagramPy.InstagramPySession import InstagramPySession , DEFAULT_PATH
from InstagramPy.InstagramPyInstance import InstagramPyInstance
from datetime import datetime

insta_user = ''
insta_pw = ''

session = myPy(username=insta_user, password=insta_pw)
session.login()

session.set_do_sometasks
session.set_sometasks

session.end()

Is it enough to run my own script? I don't want to hack stuffs. I just don't want to Insta to block when do things.

Do I need to put the whole section as in your API instruction below?

appInfo = {
   "version"     : "0.0.1",
   "name"        : "Instagram-Py Clone",
   "description" : "Some Module to crack instagram!",
   "author"      : "YourName",
   "company"     : "YourCompany",
   "year"        : "2017",
   "example"     : ""
}

cli = InstagramPyCLI(appinfo = appInfo , started = datetime.now() , verbose_level = 3)

'''
cli.PrintHeader()
cli.PrintDatetime()
'''
session = InstagramPySession(username , password , DEFAULT_PATH , DEFAULT_PATH , cli)
session.ReadSaveFile(True) # True to countinue attack if found save file.
'''
cli.PrintMagicCookie(session.magic_cookie)
'''

'''
 Defining @param cli = None will make Instagram-Py run silently so you
 can you use your own interface if you like.
 or if you want to use the official interface then declare like this

 instagrampy = InstagramPyInstance(cli = cli , session = session)

'''

instagrampy = InstagramPyInstance(cli = None ,session = session)
while not instagrampy.PasswordFound():
       print('Trying... '+session.CurrentPassword())
       instagrampy.TryPassword()

if instagrampy.PasswordFound():
       print('Password Found: '+session.CurrentPassword())
antony-jr commented 6 years ago

Hey @toraonion , The API is only for hacking stuff (Like test if the password is correct with instagram blocking you for many tries) , If you need a complete API for doing Instagram stuff without the official API use this project -> https://github.com/LevPasha/Instagram-API-python

toraonion commented 6 years ago

@antony-jr Thanks for answer, I know that API, but I would like to use your API to bypass the blocking when trying to do many tasks in short time.

Is there any way to implement?

antony-jr commented 6 years ago

@toraonion Thats not possible until the other API is re-implemented with instagram-py's algorithm. That is to hop to different ip's (Using Tor ) when a request is blocked ( And to distinguish between blocked request and wrong request is hard but the algorithm will take care of that ). Maybe we could fork the project and patch it ? ( Thats the only way to implement what you want , To the best of my knowledge )

toraonion commented 6 years ago

@antony-jr I think forking that API to apply instagram-py's algorithm is the way. However, what I concern is:

Research to not be block requests based on IPs could be easy. But bypass block requests based on usernames and/or IPs seem like a dead end for me :) I could be wrong for my assumption. How is your thoughts?

antony-jr commented 6 years ago

Research to not be block requests based on IPs could be easy. But bypass block requests based on usernames and/or IPs seem like a dead end for me :)

@toraonion You are correct , How about this project InstaPy , Its a bot which uses selenium and so it will not limit us from doing stuff(I think) , Maybe instead of doing it all-over we need to experiment with InstaPy first.

toraonion commented 6 years ago

@antony-jr I already researched that project too. However, the same with most insta APIs, users need to specify the sleep time, task duration, and/or sessions, etc. to randomize the request time to bypass insta block.

When I discover your concept, I find it's very new, fresh and cool approach. Because with your concept, there won't be any sleep time (or maybe just 1-2 seconds pausing max), then tasks still can be done indefinitely without pausing or blocking request :D So I decided to dig deeper into your solution :D I think if we can somewhat extend your approach into this, it would be very notorious :)

As far as I learned the APIs and your scripts, my feeling is that there should be some ways. My thought is that it's not all about ips using not only tor. What would you think?

antony-jr commented 6 years ago

@toraonion I need to do some research on this first.

toraonion commented 6 years ago

@antony-jr Yep, will let you know if I can find something.

antony-jr commented 6 years ago

@toraonion Sorry for the delay , Did you try this -> https://github.com/althonos/InstaLooter

It has a feature called Batch Mode , which does what you want.