Skip to content

Commit 2869d2c

Browse files
authored
Merge pull request #88 from Datalux/development
Version 1.1
2 parents 14e668e + 1d88f49 commit 2869d2c

File tree

6 files changed

+448
-108
lines changed

6 files changed

+448
-108
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![](https://img.shields.io/badge/version-1.0-green)](https://github.com/Datalux/Osintgram/releases/tag/1.0)
1+
[![](https://img.shields.io/badge/version-1.1-green)](https://github.com/Datalux/Osintgram/releases/tag/1.1)
22
[![](https://img.shields.io/badge/license-GPLv3-blue)](https://img.shields.io/badge/license-GPLv3-blue)
33
[![](https://img.shields.io/badge/language-Python3-red)](https://img.shields.io/badge/language-Python3-red)
44
[![](https://img.shields.io/badge/Telegram-Channel-blue.svg)](https://t.me/osintgram)
@@ -17,6 +17,8 @@ Osintgram offers an interactive shell to perform analysis on Instagram account o
1717
- followings Get users followed by target
1818
- fwersemail Get email of target followers
1919
- fwingsemail Get email of users followed by target
20+
- fwersnumber Get phone number of target followers
21+
- fwingsnumber Get phone number of users followed by target
2022
- hashtags Get hashtags used by target
2123
- info Get target info
2224
- likes Get total likes of target's posts
@@ -31,7 +33,7 @@ Osintgram offers an interactive shell to perform analysis on Instagram account o
3133
```
3234
You can find detailed commands usage [here](doc/COMMANDS.md).
3335

34-
[**Latest version**](https://github.com/Datalux/Osintgram/releases/tag/1.0.1) |
36+
[**Latest version**](https://github.com/Datalux/Osintgram/releases/tag/1.1) |
3537
[CHANGELOG](doc/CHANGELOG.md)
3638

3739
## Tools

doc/CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## [1.1](https://github.com/Datalux/Osintgram/releases/tag/1.1)
4+
**Enhancements**
5+
- Improved command parser (#86)
6+
- Improved errors handling (8bd1abc)
7+
- Add new line when input command is empty (f5211eb)
8+
- Added new commands to catch phone number of users (#111)
9+
- Added support for Windows (#100)
10+
11+
12+
**Bug fixes**
13+
- Fix commands output limit bug (#87)
14+
- Fix setting target with "." in username (9082990)
15+
- Readline installing error (#94 )
16+
17+
318
## [1.0.1](https://github.com/Datalux/Osintgram/releases/tag/1.0.1)
419
**Bug fixes**
520
- Set itself as target by param
@@ -86,7 +101,7 @@
86101

87102
**Bug fixes**
88103

89-
- added a check if target has a private profile to avoid tool crash (#10)
104+
- added a check if the target has a private profile to avoid tool crash (#10)
90105
- fixed `tagged` bug (#5)
91106

92107
## [0.3](https://github.com/Datalux/Osintgram/releases/tag/0.3)

doc/COMMANDS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ Return a list of emails of target followers
5252
### fwingsemail
5353
Return a list of emails of user followed by target
5454

55+
### fwersnumber
56+
Return a list of phone number of target followers
57+
58+
### fwingsnumber
59+
Return a list of phone number of user followed by target
60+
5561
### hashtags
5662
Return a list with all hashtag used by target in his photos
5763

main.py

Lines changed: 63 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33

44
from src.Osintgram import Osintgram
55
import argparse
66
from src import printcolors as pc
77
import sys
88
import signal
9-
import readline
109

11-
commands = ["quit", "exit", "list", "help", "addrs", "captions", "comments", "followers",
12-
"followings", "fwersemail", "fwingsemail", "hashtags", "info", "likes",
13-
"mediatype", "photodes", "photos", "propic", "stories", "tagged", "target",
14-
"wcommented", "wtagged"]
10+
is_windows = False
11+
12+
try:
13+
import gnureadline
14+
except:
15+
is_windows = True
16+
import pyreadline
1517

1618

1719
def printlogo():
@@ -22,7 +24,7 @@ def printlogo():
2224
pc.printout("\_______ /____ >__|___| /__| \___ /|__| (____ /__|_| /\n", pc.YELLOW)
2325
pc.printout(" \/ \/ \/ /_____/ \/ \/ \n", pc.YELLOW)
2426
print('\n')
25-
pc.printout("Version 1.0.1 - Developed by Giuseppe Criscione\n\n", pc.YELLOW)
27+
pc.printout("Version 1.1 - Developed by Giuseppe Criscione\n\n", pc.YELLOW)
2628
pc.printout("Type 'list' to show all allowed commands\n")
2729
pc.printout("Type 'FILE=y' to save results to files like '<target username>_<command>.txt (deafult is disabled)'\n")
2830
pc.printout("Type 'FILE=n' to disable saving to files'\n")
@@ -50,6 +52,10 @@ def cmdlist():
5052
print("Get email of target followers")
5153
pc.printout("fwingsemail\t")
5254
print("Get email of users followed by target")
55+
pc.printout("fwersnumber\t")
56+
print("Get phone number of target followers")
57+
pc.printout("fwingsnumber\t")
58+
print("Get phone number of users followed by target")
5359
pc.printout("hashtags\t")
5460
print("Get hashtags used by target")
5561
pc.printout("info\t\t")
@@ -88,10 +94,18 @@ def completer(text, state):
8894
else:
8995
return None
9096

97+
def _quit():
98+
pc.printout("Goodbye!\n", pc.RED)
99+
sys.exit(0)
100+
91101

92102
signal.signal(signal.SIGINT, signal_handler)
93-
readline.parse_and_bind("tab: complete")
94-
readline.set_completer(completer)
103+
if is_windows:
104+
pyreadline.Readline().parse_and_bind("tab: complete")
105+
pyreadline.Readline().set_completer(completer)
106+
else:
107+
gnureadline.parse_and_bind("tab: complete")
108+
gnureadline.set_completer(completer)
95109

96110
printlogo()
97111

@@ -106,52 +120,47 @@ def completer(text, state):
106120

107121
api = Osintgram(args.id, args.file, args.json)
108122

123+
124+
commands = {
125+
'list': cmdlist,
126+
'help': cmdlist,
127+
'quit': _quit,
128+
'exit': _quit,
129+
'addrs': api.get_addrs,
130+
'captions': api.get_captions,
131+
'comments': api.get_total_comments,
132+
'followers': api.get_followers,
133+
'followings': api.get_followings,
134+
'fwersemail': api.get_fwersemail,
135+
'fwingsemail': api.get_fwingsemail,
136+
'fwersnumber': api.get_fwersnumber,
137+
'fwingsnumber': api.get_fwingsnumber,
138+
'hashtags': api.get_hashtags,
139+
'info': api.get_user_info,
140+
'likes': api.get_total_likes,
141+
'mediatype': api.get_media_type,
142+
'photodes': api.get_photo_description,
143+
'photos': api.get_user_photo,
144+
'propic': api.get_user_propic,
145+
'stories': api.get_user_stories,
146+
'tagged': api.get_people_tagged_by_user,
147+
'target': api.change_target,
148+
'wcommented': api.get_people_who_commented,
149+
'wtagged': api.get_people_who_tagged
150+
}
151+
152+
signal.signal(signal.SIGINT, signal_handler)
153+
gnureadline.parse_and_bind("tab: complete")
154+
gnureadline.set_completer(completer)
155+
109156
while True:
110157
pc.printout("Run a command: ", pc.YELLOW)
111158
cmd = input()
112-
if cmd == "quit" or cmd == "exit":
113-
pc.printout("Goodbye!\n", pc.RED)
114-
sys.exit(0)
115-
elif cmd == "list" or cmd == "help":
116-
cmdlist()
117-
elif cmd == "addrs":
118-
api.get_addrs()
119-
elif cmd == "captions":
120-
api.get_captions()
121-
elif cmd == "comments":
122-
api.get_total_comments()
123-
elif cmd == "followers":
124-
api.get_followers()
125-
elif cmd == "followings":
126-
api.get_followings()
127-
elif cmd == 'fwersemail':
128-
api.get_fwersemail()
129-
elif cmd == 'fwingsemail':
130-
api.get_fwingsemail()
131-
elif cmd == "hashtags":
132-
api.get_hashtags()
133-
elif cmd == "info":
134-
api.get_user_info()
135-
elif cmd == "likes":
136-
api.get_total_likes()
137-
elif cmd == "mediatype":
138-
api.get_media_type()
139-
elif cmd == "photodes":
140-
api.get_photo_description()
141-
elif cmd == "photos":
142-
api.get_user_photo()
143-
elif cmd == "propic":
144-
api.get_user_propic()
145-
elif cmd == "stories":
146-
api.get_user_stories()
147-
elif cmd == "tagged":
148-
api.get_people_tagged_by_user()
149-
elif cmd == "target":
150-
api.change_target()
151-
elif cmd == "wcommented":
152-
api.get_people_who_commented()
153-
elif cmd == "wtagged":
154-
api.get_people_who_tagged()
159+
160+
_cmd = commands.get(cmd)
161+
162+
if _cmd:
163+
_cmd()
155164
elif cmd == "FILE=y":
156165
api.set_write_file(True)
157166
elif cmd == "FILE=n":
@@ -160,5 +169,7 @@ def completer(text, state):
160169
api.set_json_dump(True)
161170
elif cmd == "JSON=n":
162171
api.set_json_dump(False)
172+
elif cmd == "":
173+
print("")
163174
else:
164175
pc.printout("Unknown command\n", pc.RED)

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ requests-toolbelt==0.9.1
33
geopy>=2.0.0
44
prettytable==0.7.2
55
instagram-private-api==1.6.0
6-
readline>=6.2.4
6+
gnureadline>=8.0.0; platform_system != "Windows"
7+
pyreadline==2.1; platform_system == "Windows"

0 commit comments

Comments
 (0)