InstaAddict 1.0.3__tar.gz → 1.0.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/__init__.py +10 -10
  2. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/__main__.py +161 -161
  3. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/core/bot_flow.py +454 -447
  4. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/core/config.py +219 -219
  5. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/core/decorators.py +144 -144
  6. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/core/device_facade.py +1076 -764
  7. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/core/download_from_github.py +263 -263
  8. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/core/filter.py +759 -759
  9. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/core/handle_sources.py +973 -973
  10. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/core/interaction.py +1128 -1088
  11. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/core/log.py +153 -152
  12. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/core/navigation.py +129 -123
  13. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/core/persistent_list.py +56 -56
  14. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/core/plugin_loader.py +46 -46
  15. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/core/report.py +206 -206
  16. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/core/resources.py +271 -255
  17. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/core/scroll_end_detector.py +77 -77
  18. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/core/session_state.py +323 -323
  19. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/core/storage.py +254 -254
  20. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/core/utils.py +837 -815
  21. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/core/views.py +3712 -2683
  22. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/plugins/action_unfollow_followers.py +616 -618
  23. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/plugins/cloned_app.py +25 -25
  24. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/plugins/core_arguments.py +418 -411
  25. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/plugins/data_analytics.py +40 -40
  26. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/plugins/interact_blogger.py +266 -258
  27. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/plugins/interact_blogger_followers.py +196 -196
  28. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/plugins/interact_blogger_post_likers.py +184 -184
  29. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/plugins/interact_feed.py +147 -147
  30. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/plugins/interact_hashtag_likers.py +199 -199
  31. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/plugins/interact_hashtag_posts.py +192 -192
  32. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/plugins/interact_place_likers.py +194 -194
  33. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/plugins/interact_place_posts.py +185 -185
  34. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/plugins/like_from_urls.py +137 -137
  35. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/plugins/plugin.example +38 -38
  36. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/plugins/remove_followers.py +122 -122
  37. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/plugins/telegram.py +264 -263
  38. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/version.py +2 -2
  39. {instaaddict-1.0.3 → instaaddict-1.0.5}/LICENSE +23 -23
  40. {instaaddict-1.0.3 → instaaddict-1.0.5}/PKG-INFO +76 -77
  41. {instaaddict-1.0.3 → instaaddict-1.0.5}/README.md +444 -444
  42. {instaaddict-1.0.3 → instaaddict-1.0.5}/pyproject.toml +46 -42
  43. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/core/__init__.py +0 -0
  44. {instaaddict-1.0.3 → instaaddict-1.0.5}/InstaAddict/plugins/__init__.py +0 -0
@@ -1,10 +1,10 @@
1
- """InstaAddict - Human-like Instagram bot powered by UIAutomator2"""
2
-
3
- __version__ = "1.0.3"
4
- __tested_ig_version__ = "447.0.0.55.81"
5
-
6
- from InstaAddict.core.bot_flow import start_bot
7
-
8
-
9
- def run(**kwargs):
10
- start_bot(**kwargs)
1
+ """InstaAddict - Human-like Instagram bot powered by UIAutomator2"""
2
+
3
+ __version__ = "1.0.5"
4
+ __tested_ig_version__ = "457.0.0.55.73"
5
+
6
+ from InstaAddict.core.bot_flow import start_bot
7
+
8
+
9
+ def run(**kwargs):
10
+ start_bot(**kwargs)
@@ -1,161 +1,161 @@
1
- import argparse
2
- from os import getcwd, path
3
-
4
- from InstaAddict import __version__
5
- from InstaAddict.core.bot_flow import start_bot
6
- from InstaAddict.core.download_from_github import download_from_github
7
-
8
-
9
- def cmd_init(args):
10
- if args.account_name is not None:
11
- print(f"Script launched in {getcwd()}, files will be available there.")
12
- for username in args.account_name:
13
- if not path.exists("./run.py"):
14
- print("Creating run.py ...")
15
- download_from_github(
16
- "https://github.com/joeahkim/InstaAddict/blob/master/run.py"
17
- )
18
- if not path.exists(f"./accounts/{username}"):
19
- print(
20
- f"Creating 'accounts/{username}' folder with a config starting point inside. You have to edit these files according with https://docs.gramaddict.org/#/configuration"
21
- )
22
- download_from_github(
23
- "https://github.com/joeahkim/InstaAddict/tree/master/config-examples",
24
- output_dir=f"accounts/{username}",
25
- flatten=True,
26
- )
27
- else:
28
- print(f"'accounts/{username}' folder already exists, skip.")
29
- continue
30
- with open(f"./accounts/{username}/config.yml", "r+", encoding="utf-8") as f:
31
- config = f.read()
32
- f.seek(0)
33
- config_fixed = config.replace("myusername", username)
34
- f.write(config_fixed)
35
- else:
36
- print("You have to provide at last one account name..")
37
-
38
-
39
- def cmd_run(args):
40
- start_bot()
41
-
42
-
43
- def cmd_dump(args):
44
- import os
45
- import shutil
46
- import time
47
-
48
- import uiautomator2 as u2
49
- from colorama import Fore, Style
50
-
51
- if not args.no_kill:
52
- os.popen("adb shell pkill atx-agent").close()
53
- try:
54
- d = u2.connect(args.device)
55
- except RuntimeError as err:
56
- raise SystemExit(err)
57
-
58
- def dump_hierarchy(device, path):
59
- xml_dump = device.dump_hierarchy()
60
- with open(path, "w", encoding="utf-8") as outfile:
61
- outfile.write(xml_dump)
62
-
63
- def make_archive(name):
64
- os.chdir("dump")
65
- shutil.make_archive(base_name=f"screen_{name}", format="zip", root_dir="cur")
66
- shutil.rmtree("cur")
67
-
68
- os.makedirs("dump/cur", exist_ok=True)
69
- d.screenshot("dump/cur/screenshot.png")
70
- dump_hierarchy(d, "dump/cur/hierarchy.xml")
71
- archive_name = int(time.time())
72
- make_archive(archive_name)
73
- print(
74
- Fore.GREEN
75
- + Style.BRIGHT
76
- + "\nCurrent screen dump generated successfully! Please, send me this file:"
77
- )
78
- print(Fore.BLUE + Style.BRIGHT + f"{os.getcwd()}\\screen_{archive_name}.zip")
79
-
80
-
81
- _commands = [
82
- dict(
83
- action=cmd_init,
84
- command="init",
85
- help="creates your account folder under accounts with files for configuration",
86
- flags=[
87
- dict(
88
- args=["account_name"],
89
- nargs="+",
90
- help="instagram account name to initialize",
91
- ),
92
- ],
93
- ),
94
- dict(
95
- action=cmd_run,
96
- command="run",
97
- help="start the bot!",
98
- flags=[
99
- dict(args=["--config"], nargs="?", help="provide the config.yml path"),
100
- ],
101
- ),
102
- dict(
103
- action=cmd_dump,
104
- command="dump",
105
- help="dump current screen",
106
- flags=[
107
- dict(
108
- args=["--device"],
109
- nargs=None,
110
- default=None,
111
- help="provide the device name if more then one connected",
112
- ),
113
- dict(
114
- args=["--no-kill"],
115
- action="store_true",
116
- help="don't kill the uia2 demon",
117
- ),
118
- ],
119
- ),
120
- ]
121
-
122
-
123
- def main() -> None:
124
- parser = argparse.ArgumentParser(
125
- prog="InstaAddict",
126
- description="free human-like Instagram bot",
127
- )
128
- parser.add_argument(
129
- "-v", "--version", action="version", version=f"{parser.prog} {__version__}"
130
- )
131
- subparser = parser.add_subparsers(dest="subparser")
132
- actions = {}
133
- for c in _commands:
134
- cmd_name = c["command"]
135
- actions[cmd_name] = c["action"]
136
- sp = subparser.add_parser(
137
- cmd_name,
138
- help=c.get("help"),
139
- formatter_class=argparse.ArgumentDefaultsHelpFormatter,
140
- )
141
- for f in c.get("flags", []):
142
- args = f.get("args")
143
- if not args:
144
- args = ["-" * min(2, len(n)) + n for n in f["name"]]
145
- kwargs = f.copy()
146
- kwargs.pop("name", None)
147
- kwargs.pop("args", None)
148
- kwargs.pop("run", None)
149
- sp.add_argument(*args, **kwargs)
150
-
151
- args = parser.parse_args()
152
-
153
- if args.subparser:
154
- actions[args.subparser](args)
155
- return
156
-
157
- parser.print_help()
158
-
159
-
160
- if __name__ == "__main__":
161
- main()
1
+ import argparse
2
+ from os import getcwd, path
3
+
4
+ from InstaAddict import __version__
5
+ from InstaAddict.core.bot_flow import start_bot
6
+ from InstaAddict.core.download_from_github import download_from_github
7
+
8
+
9
+ def cmd_init(args):
10
+ if args.account_name is not None:
11
+ print(f"Script launched in {getcwd()}, files will be available there.")
12
+ for username in args.account_name:
13
+ if not path.exists("./run.py"):
14
+ print("Creating run.py ...")
15
+ download_from_github(
16
+ "https://github.com/joeahkim/InstaAddict/blob/master/run.py"
17
+ )
18
+ if not path.exists(f"./accounts/{username}"):
19
+ print(
20
+ f"Creating 'accounts/{username}' folder with a config starting point inside. You have to edit these files according with https://docs.gramaddict.org/#/configuration"
21
+ )
22
+ download_from_github(
23
+ "https://github.com/joeahkim/InstaAddict/tree/master/config-examples",
24
+ output_dir=f"accounts/{username}",
25
+ flatten=True,
26
+ )
27
+ else:
28
+ print(f"'accounts/{username}' folder already exists, skip.")
29
+ continue
30
+ with open(f"./accounts/{username}/config.yml", "r+", encoding="utf-8") as f:
31
+ config = f.read()
32
+ f.seek(0)
33
+ config_fixed = config.replace("myusername", username)
34
+ f.write(config_fixed)
35
+ else:
36
+ print("You have to provide at last one account name..")
37
+
38
+
39
+ def cmd_run(args):
40
+ start_bot()
41
+
42
+
43
+ def cmd_dump(args):
44
+ import os
45
+ import shutil
46
+ import time
47
+
48
+ import uiautomator2 as u2
49
+ from colorama import Fore, Style
50
+
51
+ if not args.no_kill:
52
+ os.popen("adb shell pkill atx-agent").close()
53
+ try:
54
+ d = u2.connect(args.device)
55
+ except RuntimeError as err:
56
+ raise SystemExit(err)
57
+
58
+ def dump_hierarchy(device, path):
59
+ xml_dump = device.dump_hierarchy()
60
+ with open(path, "w", encoding="utf-8") as outfile:
61
+ outfile.write(xml_dump)
62
+
63
+ def make_archive(name):
64
+ os.chdir("dump")
65
+ shutil.make_archive(base_name=f"screen_{name}", format="zip", root_dir="cur")
66
+ shutil.rmtree("cur")
67
+
68
+ os.makedirs("dump/cur", exist_ok=True)
69
+ d.screenshot("dump/cur/screenshot.png")
70
+ dump_hierarchy(d, "dump/cur/hierarchy.xml")
71
+ archive_name = int(time.time())
72
+ make_archive(archive_name)
73
+ print(
74
+ Fore.GREEN
75
+ + Style.BRIGHT
76
+ + "\nCurrent screen dump generated successfully! Please, send me this file:"
77
+ )
78
+ print(Fore.BLUE + Style.BRIGHT + f"{os.getcwd()}\\screen_{archive_name}.zip")
79
+
80
+
81
+ _commands = [
82
+ dict(
83
+ action=cmd_init,
84
+ command="init",
85
+ help="creates your account folder under accounts with files for configuration",
86
+ flags=[
87
+ dict(
88
+ args=["account_name"],
89
+ nargs="+",
90
+ help="instagram account name to initialize",
91
+ ),
92
+ ],
93
+ ),
94
+ dict(
95
+ action=cmd_run,
96
+ command="run",
97
+ help="start the bot!",
98
+ flags=[
99
+ dict(args=["--config"], nargs="?", help="provide the config.yml path"),
100
+ ],
101
+ ),
102
+ dict(
103
+ action=cmd_dump,
104
+ command="dump",
105
+ help="dump current screen",
106
+ flags=[
107
+ dict(
108
+ args=["--device"],
109
+ nargs=None,
110
+ default=None,
111
+ help="provide the device name if more then one connected",
112
+ ),
113
+ dict(
114
+ args=["--no-kill"],
115
+ action="store_true",
116
+ help="don't kill the uia2 demon",
117
+ ),
118
+ ],
119
+ ),
120
+ ]
121
+
122
+
123
+ def main() -> None:
124
+ parser = argparse.ArgumentParser(
125
+ prog="InstaAddict",
126
+ description="free human-like Instagram bot",
127
+ )
128
+ parser.add_argument(
129
+ "-v", "--version", action="version", version=f"{parser.prog} {__version__}"
130
+ )
131
+ subparser = parser.add_subparsers(dest="subparser")
132
+ actions = {}
133
+ for c in _commands:
134
+ cmd_name = c["command"]
135
+ actions[cmd_name] = c["action"]
136
+ sp = subparser.add_parser(
137
+ cmd_name,
138
+ help=c.get("help"),
139
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter,
140
+ )
141
+ for f in c.get("flags", []):
142
+ args = f.get("args")
143
+ if not args:
144
+ args = ["-" * min(2, len(n)) + n for n in f["name"]]
145
+ kwargs = f.copy()
146
+ kwargs.pop("name", None)
147
+ kwargs.pop("args", None)
148
+ kwargs.pop("run", None)
149
+ sp.add_argument(*args, **kwargs)
150
+
151
+ args = parser.parse_args()
152
+
153
+ if args.subparser:
154
+ actions[args.subparser](args)
155
+ return
156
+
157
+ parser.print_help()
158
+
159
+
160
+ if __name__ == "__main__":
161
+ main()