Git Product home page Git Product logo

insomniac's Introduction


Insomniac

Insomniac

Simple and friendly automation tool which brings more followers to your Instagram account and engages existing audience. Automatic liking, commenting, following/unfollowing, scraping and sending direct messages. Everything works from your own Android phone/tablet/emulator under your full control. No root required.



IMPORTANT NOTICE:

Insomniac is completely free & opensource as of v3.9.0. "Extra features" that used to be paid are now available in this repo for free. But the project is not being actively supported right now. I cannot guarantee its workability for all Instagram and Android versions, since fresh updates require Insomniac code modifications as well. However, the code is well-structured, which makes the repo a good base for adding your changes to adjust Insomniac for your setup.



Why Automating Instagram Activity (Liking, Following, etc.)?

💸 If you want just to increase your followers count or get more likes, there's a bunch of companies that will give you that immediately for a few $$$. But most likely your audience will be merely bots and mass-followers.

🌱 If you want to get engaged followers, that will be interested in your content and probably will pay you for your services, then automation is the right way.

📈 This Instagram bot provides you methods to target on the audience that is most likely interested in you. Generally these methods are (with growing complexity):

  1. Interact with users who follow specific bloggers or like posts by specific hashtags. Easiest level, just one Insomniac command.
  2. Same, but from those users interact only with your target audience. Meaning that you can pick users by specific parameters: by gender, by language, by posts count, etc. Still one Insomniac command, but you'll have to add a file with "filtering" parameters.
  3. Scrape your target audience from other accounts and use your main account only to interact. This reduces the app time-spent of your main account and makes the main account significantly less suspicious to Instagram. You'll have to learn how to use Insomniac "configs" and combine them into an infinite loop – so that everything would work by itself.

Getting Started

We have an awesome documentation where you will find installation instructions for Windows, macOS, Ubuntu and Raspberry Pi.

Basically all you need is a machine with Python 3 and a connected Android phone. In case you don't have a phone, we have posts explaining how to make it work with a free Android emulator: Windows, macOS, Ubuntu.

Please use a specific Instagram app version which you can find in the header (click on the "IG version" badge). That's because Instagram UI gets changed pretty often, so we guarantee a stable work only on versions up to a specific number.

The simplest Insomniac command to start with would be something like this:

python3 start.py --interact @natgeo-followers

But better check the docs.

Filtering

Eventually you will come to the point where you want to avoid accounts with thousands of followings. Or with zero posts. Or with some other red flags which you will choose for yourself. Here's the full list:

Parameter Value Description
skip_business true/false skip business accounts if true
skip_non_business true/false skip non-business accounts if true
min_followers 100 skip accounts with less followers than given value
max_followers 5000 skip accounts with more followers than given value
min_followings 10 skip accounts with less followings than given value
max_followings 1000 skip accounts with more followings than given value
min_potency_ratio 1 skip accounts with ratio (followers/followings) less than given value (decimal values can be used too)
max_potency_ratio 1 skip accounts with ratio (followers/followings) higher than given value (decimal values can be used too)
privacy_relation ` "only_public" / "only_private" / "private_and_public" choose with accounts of which type you want to interact, "only_public" by default
min_posts 7 minimum posts in profile in order to interact
max_digits_in_profile_name 4 maximum amount of digits in profile name (more than that - won't be interacted)
skip_profiles_without_stories true/false skip accounts that doesnt have updated story (from last 24 hours)
blacklist_words ["word1", "word2", "word3", ...] skip accounts that contains one of the words in the list in the profile biography
mandatory_words ["word1", "word2", "word3", ...] skip accounts that doesn't have one of the words in the list in the profile biography
specific_alphabet ["LATIN", "ARABIC", "GREEK", "HEBREW", ...] skip accounts that contains text in their biography/username which different than the provided alphabet list
skip_already_following_profiles true/false skip accounts that your profile already followed, even if not followed by the bot
only_profiles_with_faces "male"/"female"/"any" analyze profile picture and leave only profiles with male/female/any face on the avatar

You can find how to use them in the documentation. But don't tense up, it's as easy as create a file called "filters.json" and put it into a folder.

Command-Line Arguments vs Configs

At some point we realised that there appeared so many Insomniac command-line arguments that they became difficult to handle.

Tip: by the way, you can see all available commands by running python3 start.py with no arguments.

What we did is we introduced a concept of "configs". So instead of writing a veeeery long command like this:

python3 start.py --interact @natgeo-followers @natgeo-following amazingtrips-top-likers amazingtrips-recent-likers P-antartica-top-likers P-antartica-recent-likers amazingtrips-top-posts amazingtrips-recent-posts P-antartica-top-posts P-antartica-recent-posts --speed 4 --wait-for-device --likes-count "1-2" --likes-percentage "75" --interactions-limit-per-source "12-16" --successful-interactions-limit-per-source "6-8" --total-interactions-limit "100-200" --total-successful-interactions-limit "50-60" --total-likes-limit "50-60" --total-get-profile-limit "300-400" --session-length-in-mins-limit "50-60"

You can just write this:

python3 start.py --config-file interact-likes-only.json

Where interact-likes-only.json is a config file which you will just put in the folder where you run the command from.

The interesting thing about configs is that you can add a field next_config_file in any config. So a config will launch another config. You can also specify a sleeping time between them using the repeat field (in minutes). Using this technique you can create infinite loops of configs, see examples here. Such loops are called flows.

Scraping and Interacting with Targets

Basically to interact with targets you can run

python3 start.py --interact-targets

This means that Insomniac will search for targets either in targets.txt file (if provided) or in the database. The only way for targets to appear in the database is to use scraping. Scraping basically means searching for specific accounts to interact with as the targets for the main account. So when scraping you always have to specify this main account like this: --scrape-for-account username.

See scraping config examples here.

Extra Features

As you can imagine, this project's development and support takes a lot of energy, so in order to continue working we made part of the features paid. These features are called extra features, because they are not necessary to run the project. But most likely you'd like to have them.

You can find the full list of extra features in the documentation.

As a free bonus you'll get a Telegram bot @your_insomniac_bot which can send you current stats. So you'll be able to monitor your setup health from anywhere. Read more in one of our Patreon posts.

Community

We have a Discord server which is the most convenient place to discuss all bugs, new features, Instagram limits, etc. If you're not familiar with Discord, you can also join our Telegram chat. And finally, all useful info is posted on our Patreon page.

Discord Server Telegram Chat Patreon Page

insomniac's People

Contributors

alexal1 avatar alexowson avatar arthurspa avatar dnush avatar fadude avatar felipe4334 avatar foncekar avatar gvmturl avatar henriqueturl avatar simonmannsfeld 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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

insomniac's Issues

Alternative Search

Maybe more a request than a bug/issue.
But when you check followers of someone with lot of followers, if a bug appears or you just don't want the script runs h24..
You get that....

So maybe thinking about to take more randomzed interactions than one by one?

And by the way, 2 likes per profile is really short, in my case i constat that it needs at least 6 to 15 likes on one profile to have interest. (i know we can change that in the scritpt)
Capture

Show likes counter in run script

Guys, how's it going?

I think it is very useful to add a likes counter to the window that is displayed while the script is running, this is very necessary to know how much time is left to
end the execution or also when an internet interruption occurs, know where you left the number and then run it again and add the missing likes.

Any questions, I am available
Regards!

BUG - Connection lost

Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\connectionpool.py", line 421, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\connectionpool.py", line 416, in _make_request
    httplib_response = conn.getresponse()
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\http\client.py", line 1336, in getresponse
    response.begin()
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\http\client.py", line 306, in begin
    version, status, reason = self._read_status()
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\http\client.py", line 267, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\socket.py", line 589, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "insomniac.py", line 221, in <module>
    main()
  File "insomniac.py", line 49, in main
    _job_handle_bloggers(device, args.bloggers, int(args.likes_count), storage, on_interaction)
  File "insomniac.py", line 105, in _job_handle_bloggers
    raise e
  File "insomniac.py", line 89, in _job_handle_bloggers
    handle_blogger(device, blogger, likes_count, storage, _on_like, on_interaction)
  File "C:\Users\User\Downloads\Insomniac2\action_handle_blogger.py", line 18, in handle_blogger
    _iterate_over_followers(device, interaction, storage, on_interaction)
  File "C:\Users\User\Downloads\Insomniac2\action_handle_blogger.py", line 69, in _iterate_over_followers
    interaction_succeed = interaction(device)
  File "C:\Users\User\Downloads\Insomniac2\action_handle_blogger.py", line 109, in _interact_with_user
    if not _open_photo_and_like(device, row, column, on_like):
  File "C:\Users\User\Downloads\Insomniac2\action_handle_blogger.py", line 143, in _open_photo_and_like
    action_bar_bottom = action_bar.bounds['bottom']
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\uiautomator\__init__.py", line 934, in __getattr__
    info = self.info
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\uiautomator\__init__.py", line 945, in info
    return self.jsonrpc.objInfo(self.selector)
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\uiautomator\__init__.py", line 443, in wrapper
    return _JsonRPCMethod(url, method, timeout, False)(*args, **kwargs)
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\uiautomator\__init__.py", line 438, in wrapper
    return _method_obj(*args, **kwargs)
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\uiautomator\__init__.py", line 119, in __call__
    timeout=self.timeout)
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\poolmanager.py", line 330, in urlopen
    response = conn.urlopen(method, u.request_uri, **kw)
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\connectionpool.py", line 720, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\util\retry.py", line 400, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\packages\six.py", line 735, in reraise
    raise value
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\connectionpool.py", line 423, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\connectionpool.py", line 331, in _raise_timeout
    self, url, "Read timed out. (read timeout=%s)" % timeout_value
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='localhost', port=9008): Read timed out. (read timeout=90)

We need something to bypass connection lost message and try again.

Thank you.

BUG when see videos of 0-3 sec on feed

In my country it is common to post short videos in the feed with 0-3 seconds (GIF converted to video). When the code sees this type of post it crashes and fails to like.

Crash-2020-06-29-18-34-23

CDM:

Traceback (most recent call last):
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 426, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 421, in _make_request
httplib_response = conn.getresponse()
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1332, in getresponse
response.begin()
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 303, in begin
version, status, reason = self._read_status()
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 264, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\socket.py", line 669, in readinto
return self._sock.recv_into(b)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "insomniac.py", line 351, in
main()
File "insomniac.py", line 79, in main
_job_handle_bloggers(device,
File "insomniac.py", line 157, in _job_handle_bloggers
raise e
File "insomniac.py", line 137, in _job_handle_bloggers
handle_blogger(device, username, likes_count, follow_percentage, storage, _on_like, on_interaction)
File "C:\Users\xxxx\Desktop\Python\Insomniac-master\action_handle_blogger.py", line 27, in handle_blogger
_iterate_over_followers(device, interaction, storage, on_interaction, is_myself)
File "C:\Users\xxxx\Desktop\Python\Insomniac-master\action_handle_blogger.py", line 127, in _iterate_over_followers
interaction_succeed, followed = interaction(device, username=username, can_follow=can_follow)
File "C:\Users\xxxx\Desktop\Python\Insomniac-master\action_handle_blogger.py", line 185, in interact_with_user
if not open_photo_and_like(device, row, column, on_like):
File "C:\Users\xxxx\Desktop\Python\Insomniac-master\action_handle_blogger.py", line 227, in open_photo_and_like
action_bar_bottom = action_bar.bounds['bottom']
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\site-packages\uiautomator_init
.py", line 934, in getattr
info = self.info
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\site-packages\uiautomator_init
.py", line 945, in info
return self.jsonrpc.objInfo(self.selector)
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\site-packages\uiautomator_init
.py", line 443, in wrapper
return JsonRPCMethod(url, method, timeout, False)(*args, **kwargs)
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\site-packages\uiautomator_init
.py", line 438, in wrapper
return method_obj(*args, **kwargs)
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\site-packages\uiautomator_init
.py", line 115, in call
res = self.pool.urlopen("POST",
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\poolmanager.py", line 336, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 724, in urlopen
retries = retries.increment(
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\util\retry.py", line 403, in increment
raise six.reraise(type(error), error, _stacktrace)
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\packages\six.py", line 735, in reraise
raise value
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 670, in urlopen
httplib_response = self._make_request(
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 428, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File "C:\Users\xxxx\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 335, in _raise_timeout
raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='localhost', port=9008): Read timed out. (read timeout=90)

BUG, does not open the followers list

Traceback (most recent call last):
File "insomniac.py", line 132, in _job_handle_bloggers
handle_blogger(device, username, likes_count, follow_percentage, storage, _on_like, on_interaction)
File "/home/pi/Insomniac/action_handle_blogger.py", line 23, in handle_blogger
if not _open_user_followers(device, username):
File "/home/pi/Insomniac/action_handle_blogger.py", line 64, in _open_user_followers
followers_button.click.wait()
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator/init.py", line 76, in call
return self.func(*args, **kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator/init.py", line 975, in _click
return self.jsonrpc.clickAndWaitForNewWindow(self.selector, timeout)
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator/init.py", line 458, in wrapper
return _method_obj(*args, **kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator/init.py", line 135, in call
"%s: %s" % (jsonresult["error"]["data"]["exceptionTypeName"], jsonresult["error"]["message"])
uiautomator.JsonRPCError: JsonRPC Error code: -32002, Message: android.support.test.uiautomator.UiObjectNotFoundException: UiSelector[CLASS=android.widget.LinearLayout, RESOURCE_ID=com.instagram.android:id/row_profile_header_followers_container]

Device: Nexus 5, initial I had it on a xiaomi, but i had to have the sim inserted to have some debug properties unlocked, so, i changed to the good old nexus 5. Don't know if the fact that i've changed the device somehow messed up

Filter business accounts

Is there a possibility to validate whether an account is a business account before interacting with it?

Can't interact with users

[06/26 23:12:57] Open Instagram app
[06/26 23:12:58] Sleep for 2 seconds
[06/26 23:13:00] Press profile
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator/init.py", line 438, in wrapper
return _method_obj(*args, **kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator/init.py", line 127, in call
result = urllib2.urlopen(req, timeout=self.timeout)
File "/usr/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.7/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/usr/lib/python3.7/urllib/request.py", line 543, in _open
'_open', req)
File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/usr/lib/python3.7/urllib/request.py", line 1345, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/lib/python3.7/urllib/request.py", line 1320, in do_open
r = h.getresponse()
File "/usr/lib/python3.7/http/client.py", line 1336, in getresponse
response.begin()
File "/usr/lib/python3.7/http/client.py", line 306, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.7/http/client.py", line 267, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/lib/python3.7/socket.py", line 589, in readinto
return self._sock.recv_into(b)
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "insomniac.py", line 343, in
main()
File "insomniac.py", line 71, in main
session_state.my_username = get_my_username(device)
File "/home/pi/Insomniac/action_get_my_username.py", line 10, in get_my_username
profile_button.click.wait()
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator/init.py", line 76, in call
return self.func(*args, **kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator/init.py", line 975, in _click
return self.jsonrpc.clickAndWaitForNewWindow(self.selector, timeout)
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator/init.py", line 442, in wrapper
server.start(timeout=30)
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator/init.py", line 498, in start
raise IOError("RPC server not started!")
OSError: RPC server not started!

I can't figure it out what the problem is, did anyone else had the same problem?

Bug with video posts, not only with IGTV

Hello @alexal1 .
I noticed some strange behavior with some video posts.
It opens the video post then sleep for some seconds and before the double tap stack trace below

Sleep for 4 seconds
Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.5/site-packages/uiautomator/__init__.py", line 438, in wrapper
    return _method_obj(*args, **kwargs)
  File "/home/pi/.local/lib/python3.5/site-packages/uiautomator/__init__.py", line 127, in __call__
    result = urllib2.urlopen(req, timeout=self.timeout)
  File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.5/urllib/request.py", line 466, in open
    response = self._open(req, data)
  File "/usr/lib/python3.5/urllib/request.py", line 484, in _open
    '_open', req)
  File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 1282, in http_open
    return self.do_open(http.client.HTTPConnection, req)
  File "/usr/lib/python3.5/urllib/request.py", line 1257, in do_open
    r = h.getresponse()
  File "/usr/lib/python3.5/http/client.py", line 1198, in getresponse
    response.begin()
  File "/usr/lib/python3.5/http/client.py", line 297, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.5/http/client.py", line 258, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.5/socket.py", line 576, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "insomniac.py", line 90, in _job_handle_bloggers
    handle_blogger(device, blogger, likes_count, storage, _on_like, on_interaction)
  File "/home/pi/workspace/insomniac/action_handle_blogger.py", line 18, in handle_blogger
    _iterate_over_followers(device, interaction, storage, on_interaction)
  File "/home/pi/workspace/insomniac/action_handle_blogger.py", line 69, in _iterate_over_followers
    interaction_succeed = interaction(device)
  File "/home/pi/workspace/insomniac/action_handle_blogger.py", line 114, in _interact_with_user
    if not _open_photo_and_like(device, row, column, on_like):
  File "/home/pi/workspace/insomniac/action_handle_blogger.py", line 148, in _open_photo_and_like
    action_bar_bottom = action_bar.bounds['bottom']
  File "/home/pi/.local/lib/python3.5/site-packages/uiautomator/__init__.py", line 934, in __getattr__
    info = self.info
  File "/home/pi/.local/lib/python3.5/site-packages/uiautomator/__init__.py", line 945, in info
    return self.jsonrpc.objInfo(self.selector)
  File "/home/pi/.local/lib/python3.5/site-packages/uiautomator/__init__.py", line 443, in wrapper
    return _JsonRPCMethod(url, method, timeout, False)(*args, **kwargs)
  File "/home/pi/.local/lib/python3.5/site-packages/uiautomator/__init__.py", line 438, in wrapper
    return _method_obj(*args, **kwargs)
  File "/home/pi/.local/lib/python3.5/site-packages/uiautomator/__init__.py", line 127, in __call__
    result = urllib2.urlopen(req, timeout=self.timeout)
  File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.5/urllib/request.py", line 466, in open
    response = self._open(req, data)
  File "/usr/lib/python3.5/urllib/request.py", line 484, in _open
    '_open', req)
  File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 1282, in http_open
    return self.do_open(http.client.HTTPConnection, req)
  File "/usr/lib/python3.5/urllib/request.py", line 1257, in do_open
    r = h.getresponse()
  File "/usr/lib/python3.5/http/client.py", line 1198, in getresponse
    response.begin()
  File "/usr/lib/python3.5/http/client.py", line 297, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.5/http/client.py", line 258, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.5/socket.py", line 576, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out

Script runs but nothing happens

I'm really excited to make this project work. When running the script everything looks smooth. However, nothing happens. Any pointers as to where to start for troubleshooting? Thank you!

_[06/26 14:33:55] Connected devices via adb: 1. That's ok.
usage: insomniac.py [--interact usta [playyourcourt ...]] [--likes-count 2] [--total-likes-limit 1000] [--interactions-count 100] [--repeat 180] [--follow-percentage 50] [--unfollow 100] [--unfollow-non-followers 100]

Instagram bot for automated Instagram interaction using Android device via ADB

optional arguments:
--interact usta [playyourcourt ...]
list of usernames with whose followers you want to interact
--likes-count 2 number of likes for each interacted user, 2 by default
--total-likes-limit 1000
limit on total amount of likes during the session, 1000 by default
--interactions-count 100
number of interactions per each blogger, 100 by default
--repeat 180 repeat the same session again after N minutes after completion, disabled by default
--follow-percentage 50
follow given percentage of interacted users, 0 by default
--unfollow 100 unfollow at most given number of users. Only users followed by this script will be unfollowed. The order is from oldest to newest followings
--unfollow-non-followers 100
unfollow at most given number of users, that don't follow you back. Only users followed by this script will be unfollowed. The order is from oldest to newest followings_

Error During Open Blogger's followers -SOLVED

EDIT: Solved by reinstalling the app

i'm stuck on this fase, all work ok, but during open followers this error appears:

File "/.../python3.8/site-packages/uiautomator/init.py", line 133, in call
raise JsonRPCError(
uiautomator.JsonRPCError: JsonRPC Error code: -32002, Message: android.support.test.uiautomator.UiObjectNotFoundException: UiSelector[CLASS=android.widget.LinearLayout, RESOURCE_ID=com.instagram.android:id/row_profile_header_followers_container]

PS: the program seems AWESOME

IGTV Bypass - Error message

�[91mTraceback (most recent call last):
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\uiautomator\__init__.py", line 438, in wrapper
    return _method_obj(*args, **kwargs)
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\uiautomator\__init__.py", line 135, in __call__
    "%s: %s" % (jsonresult["error"]["data"]["exceptionTypeName"], jsonresult["error"]["message"])
uiautomator.JsonRPCError: JsonRPC Error code: -32002, Message: android.support.test.uiautomator.UiObjectNotFoundException: UiSelector[CLASS=android.widget.FrameLayout, RESOURCE_ID=com.instagram.android:id/action_bar_container]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "insomniac.py", line 89, in _job_handle_bloggers
    handle_blogger(device, blogger, likes_count, storage, _on_like, on_interaction)
  File "C:\Users\User\Downloads\Insomniac2\action_handle_blogger.py", line 18, in handle_blogger
    _iterate_over_followers(device, interaction, storage, on_interaction)
  File "C:\Users\User\Downloads\Insomniac2\action_handle_blogger.py", line 69, in _iterate_over_followers
    interaction_succeed = interaction(device)
  File "C:\Users\User\Downloads\Insomniac2\action_handle_blogger.py", line 109, in _interact_with_user
    if not _open_photo_and_like(device, row, column, on_like):
  File "C:\Users\User\Downloads\Insomniac2\action_handle_blogger.py", line 143, in _open_photo_and_like
    action_bar_bottom = action_bar.bounds['bottom']
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\uiautomator\__init__.py", line 934, in __getattr__
    info = self.info
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\uiautomator\__init__.py", line 945, in info
    return self.jsonrpc.objInfo(self.selector)
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\uiautomator\__init__.py", line 458, in wrapper
    return _method_obj(*args, **kwargs)
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\uiautomator\__init__.py", line 135, in __call__
    "%s: %s" % (jsonresult["error"]["data"]["exceptionTypeName"], jsonresult["error"]["message"])
uiautomator.JsonRPCError: JsonRPC Error code: -32002, Message: android.support.test.uiautomator.UiObjectNotFoundException: UiSelector[CLASS=android.widget.FrameLayout, RESOURCE_ID=com.instagram.android:id/action_bar_container]
�[0m
Try again for @codes.learning from the beginning

Think that you found a way to handle IGTV BUG but i still getting this error message on this solution. Can you also handle this message?

Thank you!

Organizing actions and storage data

Hello brother, I think the action —bloggers should be —likefollowers and these interacted_users.txt should be likedfollowers.txt
this is a better name for what this action really do.
-followedfollowers.txt
-unfollowed.txt
-followed.txt
-followedhashtags.txt

An idea unfollowing / unfollow non followers...
Is there anyway scroll down to get all text value in
com.instagram.android:id/follow_list_username
From followers and following in 2 different followers.txt following.txt
compare both in python backside then create a nonfollowers.txt
Then start to unfollow by a list?

Also cold be added functions as —followlist and —unfollowlist
—skiplist

I m trying to understand how code works to help on improvement, can’t you make a short video explaining how to you are working on for helping us make it grow faster? Think about that

I m not sure how adb works... Do you think that is there anyway to turn all that actions into an Android native app using kivy / buildozer importing adb and uiautomator library on it?

Why aren’t you writing this code using python3? Like code is right now it will also works on python2 as we know the way python2 goes...

I will be attentive on your comments.

FEATURE- Adding PySimpleGUI as interface

interface

import PySimpleGUI as sg

#sg.theme('Dark Brown 1')
sg.SetOptions(element_padding=(0, 0))

devicesLabel = [[sg.Text('Device')] + [sg.Text(size=(14,1))]]
devices = [[sg.Listbox(values=('Device 1', 'Device 2', 'Device 3'), size=(30, 3))]]
bloggersLabel = [[sg.Text('Bloggers')] + [sg.Text(size=(14,1))]]
bloggers = [[sg.MLine(default_text='Loading your bloggers here', size=(30, 3))]]
interactionsLabel = [[sg.Text('Interact user per blogger')] + [sg.Text(size=(14,1))]]
interactions = [[sg.Slider(range=(0,255),default_value=1,orientation='h',size=(30, 20))]]
sleepLabel = [[sg.Text('Sleep after session')] + [sg.Text(size=(14,1))]]
activateSleep = [[sg.Frame('Activate sleep:',[[sg.Radio('Enable', "RADIO1", default=True, size=(7, 1))],
                                [sg.Radio('Disable', "RADIO1")]
                                 + [sg.Text(size=(12,1))]])]]
sleep = [[sg.Slider(range=(0,1000),default_value=180,orientation='h',size=(30, 20))]]
button = [[sg.Button('Start Insomniac')]]
howUse = [[sg.Frame('How use:',[[sg.Text('1 - Select your device.')],
                                [sg.Text('2 - Select your bloggers.(Enter to next)')],
                                [sg.Text('3 - Select interactions per bloggers.')],
                                [sg.Text('4 - Select sleep after session.')],
                                [sg.Text('5 - Start Insomniac.')]
                                 + [sg.Text(size=(12,1))]])]]
about = [[sg.Frame('About:',
                   [[sg.Text('Insomniac 2.0')],
                     [sg.Text('https://github.com/alexal1/Insomniac',)],
                     [sg.Text('Free and Opensource',)]
                    + [sg.Text(size=(12,1))]])]]


layout = devicesLabel + devices + bloggersLabel + bloggers + interactionsLabel + interactions + sleepLabel + sleep + activateSleep + button + howUse + about

window = sg.Window('Insomniac 2.0', layout, font='Courier 12')
event, values = window.read()

while True:
    event, values = window.read()
    if event in (sg.WIN_CLOSED, 'Cancel'):
        break

window.close()

https://pysimplegui.readthedocs.io/en/latest/

Opening it as issue if someone can help on implementing a simply interface to all usage.

Thank you.

"Running Insomniac with two or more actions is not supported yet."

I can't seem to enter the right arguments to make unfollowing work. I keep receiving the error "Running Insomniac with two or more actions is not supported yet." Could you please help?

I have the following arguments and run the following command

Command:
python insomniac.py --unfollow-non-followers 100

Arguments:
parser.add_argument('--interact',
nargs='+',
help='list of usernames with whose followers you want to interact',
metavar=(''),
default=[''])
parser.add_argument('--likes-count',
help='number of likes for each interacted user, 2 by default',
metavar='',
default=0)
parser.add_argument('--total-likes-limit',
help='limit on total amount of likes during the session, 1000 by default',
metavar='',
default=0)
parser.add_argument('--interactions-count',
help='number of interactions per each blogger, 100 by default',
metavar='',
default=0)
parser.add_argument('--repeat',
help='repeat the same session again after N minutes after completion, disabled by default',
metavar='')
parser.add_argument('--follow-percentage',
help='follow given percentage of interacted users, 0 by default',
metavar='',
default=0)
parser.add_argument('--unfollow',
help='unfollow at most given number of users. Only users followed by this script will '
'be unfollowed. The order is from oldest to newest followings',
metavar='',
default='0')
parser.add_argument('--unfollow-non-followers',
help='unfollow at most given number of users, that don't follow you back. Only users followed '
'by this script will be unfollowed. The order is from oldest to newest followings',
metavar='100',
default='100')

Script travelling

Impossible to show the bug, it only appears on the phone screen but not on the cmd.

randomly, it goes on the phone galerie.
(even one time on my own profile, i can suppose that is "normal" to make a more human interaction like said in the notice)
I suppose that it's press the wrong key,
(the "+" instead of "back" or "search" key)
the script continue as nothing happens but the phone is totally elsewhere than it should be...
maybe resolution of the screen is different as it suppose to be in the script?

Open and Close Instagram

I guess you could open and close Instagram with the following code:

import os

# Open Instagram
os.system("adb shell monkey -p com.instagram.android 1 -")

# Close Instagram
os.system("adb shell am force-stop com.instagram.android")

Also, you could add a function that goes through the Recent page of a certain hashtag and starts liking a certain number of pictures.

You could make various functions of possible actions that you can do:

  • liking by hashtags (you could also comment)
  • liking by someone's followers (as you have already) (you could also comment)

I was thinking about how the following part could be implemented. Basically Instagram lets you go to your following page and see your followers ordered from the person you followed the latest. So basically if you follow 5 ppl you could just unfollow the latest 5 people. That's an idea. Otherwise, a slower process would be the one of going to each user's page and click the unfollow button.

Let me know if I could help somehow.

Is it possible to follow a user's followers?

Hello good afternoon.
My name is Jonathan, I am from Argentina, I have used Instapy for a long time, but then, when observing that web bots are very detectable, I gave up on the idea and started doing the same job manually using android simulators. (Currently I work with 10 accounts, 2 accounts for each simulator) Looking at your INSOMNE system, I find it very interesting and I am going to test it. Only one thing that I could not visualize in the code, does it have the functionality to follow followers of predefined users?

Thank you very much for your contribution and apologies for my English: p

Error

 Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.7/site-packages/uiautomator/__init__.py", line 438, in wrapper
    return _method_obj(*args, **kwargs)
  File "/home/pi/.local/lib/python3.7/site-packages/uiautomator/__init__.py", line 135, in __call__
    "%s: %s" % (jsonresult["error"]["data"]["exceptionTypeName"], jsonresult["error"]["message"])
uiautomator.JsonRPCError: JsonRPC Error code: -32002, Message: android.support.test.uiautomator.UiObjectNotFoundException: UiSelector[CLASS=android.widget.LinearLayout, RESOURCE_ID=com.instagram.android:id/row_profile_header_followers_container]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "insomniac.py", line 132, in _job_handle_bloggers
    handle_blogger(device, username, likes_count, follow_percentage, storage, _on_like, on_interaction)
  File "/home/pi/Insomniac/action_handle_blogger.py", line 23, in handle_blogger
    if not _open_user_followers(device, username):
  File "/home/pi/Insomniac/action_handle_blogger.py", line 63, in _open_user_followers
    followers_button.click.wait()
  File "/home/pi/.local/lib/python3.7/site-packages/uiautomator/__init__.py", line 76, in __call__
    return self.func(*args, **kwargs)
  File "/home/pi/.local/lib/python3.7/site-packages/uiautomator/__init__.py", line 975, in _click
    return self.jsonrpc.clickAndWaitForNewWindow(self.selector, timeout)
  File "/home/pi/.local/lib/python3.7/site-packages/uiautomator/__init__.py", line 458, in wrapper
    return _method_obj(*args, **kwargs)
  File "/home/pi/.local/lib/python3.7/site-packages/uiautomator/__init__.py", line 135, in __call__
    "%s: %s" % (jsonresult["error"]["data"]["exceptionTypeName"], jsonresult["error"]["message"])
uiautomator.JsonRPCError: JsonRPC Error code: -32002, Message: android.support.test.uiautomator.UiObjectNotFoundException: UiSelector[CLASS=android.widget.LinearLayout, RESOURCE_ID=com.instagram.android:id/row_profile_header_followers_container]

Crash-2020-06-29-20-31-59

Pullrequests not allowed?

I see a nice pullrequest from 3 days ago for hashtag support!

Thx @dwai03

I tested it and works! Why isn't it been pulled?

Thats how instapy got big, community! I do see updates from today, but pullrequests being ingored?

socket.timeout: timed out

Dear, good afternoon.! My samsung s6 device after an internet outage started to throw the following error after entering the first follower to look at their photos. This is recurring, that is, it reaches the first follower and throws that message. Any ideas?

python insomniac.py --interact comerennuevacordoba --likes-count 3 --total-likes-limit 200

`C:\Users\usuario\Desktop\samsung\Insomniac>python insomniac.py --interact comerennuevacordoba --likes-count 3 --total-likes-limit 200
Insomniac v1.5.1

Action: interact with @comerennuevacordoba

-------- START: 2020-06-28 16:26:17.618545 --------
Open Instagram app
Sleep for 2 seconds
Press profile
Hello, @bokurajeanscba

Handle @comerennuevacordoba
Press search
Open user @comerennuevacordoba
Open @comerennuevacordoba followers
Iterate over visible followers
@eltallerdeltequenio: interact
Sleep for 4 seconds
Scroll down to see more photos.
Screenshot taken and saved as Crash-2020-06-28-16-31-26.png

TOTAL
Completed sessions: 0
Total duration: 0:05:12.256446
Total interactions: 0
Successful interactions: 0
Total likes: 0
Total followed: 0
Total unfollowed: 0
Traceback (most recent call last):
File "C:\Users\usuario\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 426, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "C:\Users\usuario\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 421, in _make_request
httplib_response = conn.getresponse()
File "C:\Users\usuario\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1332, in getresponse
response.begin()
File "C:\Users\usuario\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 303, in begin
version, status, reason = self._read_status()
File "C:\Users\usuario\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 264, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "C:\Users\usuario\AppData\Local\Programs\Python\Python38\lib\socket.py", line 669, in readinto
return self._sock.recv_into(b)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "insomniac.py", line 342, in
main()
File "insomniac.py", line 77, in main
_job_handle_bloggers(device,
File "insomniac.py", line 152, in _job_handle_bloggers
raise e
File "insomniac.py", line 133, in _job_handle_bloggers
handle_blogger(device, username, likes_count, follow_percentage, storage, _on_like, on_interaction)
File "C:\Users\usuario\Desktop\samsung\Insomniac\action_handle_blogger.py", line 26, in handle_blogger
_iterate_over_followers(device, interaction, storage, on_interaction, is_myself)
File "C:\Users\usuario\Desktop\samsung\Insomniac\action_handle_blogger.py", line 120, in _iterate_over_followers
interaction_succeed, followed = interaction(device, username=username, can_follow=can_follow)
File "C:\Users\usuario\Desktop\samsung\Insomniac\action_handle_blogger.py", line 164, in interact_with_user
if not scroll_profile(device):
File "C:\Users\usuario\Desktop\samsung\Insomniac\action_handle_blogger.py", line 256, in scroll_profile
profile_tabs_container_top = profile_tabs_container.bounds['top']
File "C:\Users\usuario\AppData\Local\Programs\Python\Python38\lib\site-packages\uiautomator_init
.py", line 934, in getattr
info = self.info
File "C:\Users\usuario\AppData\Local\Programs\Python\Python38\lib\site-packages\uiautomator_init
.py", line 945, in info
return self.jsonrpc.objInfo(self.selector)
File "C:\Users\usuario\AppData\Local\Programs\Python\Python38\lib\site-packages\uiautomator_init
.py", line 443, in wrapper
return JsonRPCMethod(url, method, timeout, False)(*args, **kwargs)
File "C:\Users\usuario\AppData\Local\Programs\Python\Python38\lib\site-packages\uiautomator_init
.py", line 438, in wrapper
return method_obj(*args, **kwargs)
File "C:\Users\usuario\AppData\Local\Programs\Python\Python38\lib\site-packages\uiautomator_init
.py", line 115, in call
res = self.pool.urlopen("POST",
File "C:\Users\usuario\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\poolmanager.py", line 336, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "C:\Users\usuario\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 724, in urlopen
retries = retries.increment(
File "C:\Users\usuario\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\util\retry.py", line 403, in increment
raise six.reraise(type(error), error, _stacktrace)
File "C:\Users\usuario\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\packages\six.py", line 735, in reraise
raise value
File "C:\Users\usuario\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 670, in urlopen
httplib_response = self._make_request(
File "C:\Users\usuario\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 428, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File "C:\Users\usuario\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 335, in _raise_timeout
raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='localhost', port=9009): Read timed out. (read timeout=90)

C:\Users\usuario\Desktop\samsung\Insomniac>`

I already tried everything, I even did a full reset and everything remains the same, it goes into the first follower and dies there. The strange thing is that the rest of my devices work perfectly.

Suggestions?

No such file or directory

[07/14 19:54:31] Open Instagram app
[07/14 19:54:33] Sleep for 2 seconds
[07/14 19:54:35] Press profile
[07/14 19:54:42] Failed to get username
Traceback (most recent call last):
File "insomniac.py", line 369, in
main()
File "insomniac.py", line 81, in main
storage = Storage(session_state.my_username)
File "/home/pi/Insomniac/src/storage.py", line 17, in init
os.makedirs(my_username)
File "/usr/lib/python3.7/os.py", line 221, in makedirs
mkdir(name, mode)
FileNotFoundError: [Errno 2] No such file or directory: ''

Traceback on boot

Error on launch.
Vanilla script, no changes.
Brand new launch with new installation today.

Capture

FEATURE: Filter users by their amount of followers and following to better target audience

Story

As a user of this app, I want to be able to get analytics of people that I could potentially follow so that the app can filter out whether or not the person is worth following. Specifically the new requested data point is around a bloggers a follower count, following count, and follower/following ratio.

Issue:
Not sure how the app is currently identifing elements from the app. Currently need to understand how the elements are all selected/identified then will be able to implement the code.

custom sleep function ?

first time running and it goes fast sure it wont get blocked? anyway to add a custom sleep function ?

Liking issue

I experienced an issue, my script crash after 'double click' in the comments section instead of the actual photo/video.

My guess is that depending on the device you use, the coordinates of the action taken by the script (e.g. double click) are different. For example, I have a Huawei P30 Pro with a very big screen, the not square sized photos/videos shown a way higher than the center of my screen. Then, during the 'double click' action for liking it seems to click on the comments/description (e.g. on hashtags) when the photo/video is not square sized.

A solution may be to get dynamic coordinates from the photos/videos (or maybe to know what size they are) before 'double clicking' to adjust where the 'double click' happens.

Error with private account

If one follower of the target account is private then the process stop with error
"Probably need to scroll"
I think we need to find a way to avoid private account.

Quickstart

Could you please provide some quickstart example?
Where to put acc and pass?

Installation / usage problems

Hello guys, I tried installing/using on Ubuntu mate and Windows without success.
On Ubuntu getting some key error and on Windows 0 devices connected. Do I have to root the Android device? I m using a LG k10 LTE with Android 6.0
Do I have to do something to make it work? Followed all steps and got no success.

Hope you help me, thank you.

Error when i try to interact and get soft ban

i get this error:

Traceback (most recent call last):
  File "insomniac.py", line 331, in wrapper
    func(*args, **kwargs)
  File "insomniac.py", line 149, in job
    on_interaction)
  File "/home/pi/Insomniac/src/action_handle_blogger.py", line 32, in handle_blogger
    _iterate_over_followers(device, interaction, storage, on_interaction, is_myself)
  File "/home/pi/Insomniac/src/action_handle_blogger.py", line 104, in _iterate_over_followers
    className='android.widget.LinearLayout'):
  File "/usr/local/lib/python3.6/site-packages/uiautomator/__init__.py", line 1222, in next
    return obj[self.index]
  File "/usr/local/lib/python3.6/site-packages/uiautomator/__init__.py", line 1203, in getitem
    raise IndexError()
IndexError

Raspbian support?

Hi, I want to try this script on mi RpiB3+ but I’m unable to find any androidsdk working on armhf.

Anyone have installed the android platform tools on raspberry pi?

Thanks

EDIT: I’ve installed android-tools-adb and android-tools-fastboot, adb server started so I will try to connect a phone asap and see if device will be recognized.

Handle exception when account changed their username or does not exist anymore

Problem:
Sometimes target accounts changing their usernames or not exist anymore so Insomniac can't find them via search and instead, it opens the first hashtag and then crashes, or opens the first username that looks like it and tries to make activity there.

Possible solutions:

  1. Check account username before activity and if it does not exist or not matches exactly specified username => skip
  2. Add this type of accounts to list => brokenusernames.txt
  3. Possibly add function to Insomniac that will exclude brokenusernames.txt from the next activities.

Send Dm/comment

Again, more a request but haven't capacity to program it.

Something like;
if no post, 1/2 post, or if private account > send "private message" (to reach inaccessible account)
randomly send > "private message"
randomly > post "comment"

Block on Press search

tha app open on the phone after it s just show this message on the terminal

if you can help me thank you

home2@home2-VirtualBox:~/Insomniac$ python3 insomniac.py --bloggers marco_verratti92
Insomniac v1.2.4

Connected devices via adb: 1. That's ok.
bloggers = marco_verratti92

-------- START: 2020-06-10 16:39:36.630498 --------
Open Instagram app
Sleep for 4 seconds

Handle @marco_verratti92
Press search
Traceback (most recent call last):
File "/home/home2/.local/lib/python3.8/site-packages/uiautomator/init.py", line 438, in wrapper
return _method_obj(*args, **kwargs)
File "/home/home2/.local/lib/python3.8/site-packages/uiautomator/init.py", line 127, in call
result = urllib2.urlopen(req, timeout=self.timeout)
File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.8/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/usr/lib/python3.8/urllib/request.py", line 1355, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/lib/python3.8/urllib/request.py", line 1330, in do_open
r = h.getresponse()
File "/usr/lib/python3.8/http/client.py", line 1332, in getresponse
response.begin()
File "/usr/lib/python3.8/http/client.py", line 303, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.8/http/client.py", line 272, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "insomniac.py", line 219, in
main()
File "insomniac.py", line 49, in main
_job_handle_bloggers(device, args.bloggers, int(args.likes_count), storage, on_interaction)
File "insomniac.py", line 90, in _job_handle_bloggers
handle_blogger(device, blogger, likes_count, storage, _on_like, on_interaction)
File "/home/home2/Insomniac/action_handle_blogger.py", line 17, in handle_blogger
_open_user_followers(device, username)
File "/home/home2/Insomniac/action_handle_blogger.py", line 25, in _open_user_followers
search_button.click.wait()
File "/home/home2/.local/lib/python3.8/site-packages/uiautomator/init.py", line 76, in call
return self.func(*args, **kwargs)
File "/home/home2/.local/lib/python3.8/site-packages/uiautomator/init.py", line 975, in _click
return self.jsonrpc.clickAndWaitForNewWindow(self.selector, timeout)
File "/home/home2/.local/lib/python3.8/site-packages/uiautomator/init.py", line 442, in wrapper
server.start(timeout=30)
File "/home/home2/.local/lib/python3.8/site-packages/uiautomator/init.py", line 498, in start
raise IOError("RPC server not started!")
OSError: RPC server not started!

Traceback Loop

Me again,
have a traceback that making a loop in the interacted users

The bot just like and re-like the same pics of the same profile after getting the error.
Saw that the "interacted_users.txt" doesn't update anymore when user job is done.
Screen under.

I'll test with a brand new vanilla download of the script tomorrow (UTM+1 for me)
(in the case that differents devices used creates a conflict)

Capture

Interactions count resets after crash

I noticed that when after a crash happens and interaction with current blogger starts from the beginning, the script doesn't count already made interactions. This can lead to a very long interaction.

Infinite loop on IGTV

Cannot catch and replay this bug, maybe you guys have thoughts.

Sometimes IGTV fullscreen is accidentally being opened and then the script goes into infinite loop. It tries to find "search" button but can't. I have two questions:

  1. How is IGTV being opened?
  2. Why it doesn't return back on the main screen on some devices? open_instagram() function is called, it runs adb shell am start -n com.instagram.android/com.instagram.mainactivity.MainActivity command. Could you please check if this command returns you to the main screen while playing IGTV?

@gvmturl @GabrieleAnsaldo @xerZV

TypeError

Traceback (most recent call last):
  File "insomniac.py", line 335, in <module>
    main()
  File "insomniac.py", line 91, in main
    int(args.follow_limit),
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

Error in following an account that you are already following previously

Hello guys !!
The problem occurs when Insomniac wants to track an account that was previously tracked manually or without the script. Clicking the "Next" button opens the options window and interrupts the process.

I think there could be two possible options.
1- Press the Back button when that window opens
2- That insomniac detects that you are already following it and you do not press the "Next" button

Any questions, I am available
Regards!

Issue with jump starting the script

Hello,

I am having issues getting the script to run. I believe I've done all the steps, but when I try to run the Python script it will not produce any outcome.

-Developer enables
-Stay awake enabled
-USB Debugging enabled
-uiautomator/colorama installed
-android platform tools installed and added to PATH

Any pointers will be much appreciated on what I'm omitting/not doing properly (I use Windows and I typically don't use an Android so please bear with me)

3
2

No interaction

The bot works like a charm, in the state of work in progress that's a really good begining.
Maybe a video/notice is needed to really understand how to install and make it works.

In my case, the bot interact with other profiles but don't put any like,
it's just go on the profile, check it, scroll down and come back to followers list
Capture

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.