Skip to content

Commit

Permalink
Merge pull request #88 from Datalux/development
Browse files Browse the repository at this point in the history
Version 1.1
  • Loading branch information
Datalux authored Mar 31, 2021
2 parents 14e668e + 1d88f49 commit 2869d2c
Show file tree
Hide file tree
Showing 6 changed files with 448 additions and 108 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![](https://img.shields.io/badge/version-1.0-green)](https://github.com/Datalux/Osintgram/releases/tag/1.0)
[![](https://img.shields.io/badge/version-1.1-green)](https://github.com/Datalux/Osintgram/releases/tag/1.1)
[![](https://img.shields.io/badge/license-GPLv3-blue)](https://img.shields.io/badge/license-GPLv3-blue)
[![](https://img.shields.io/badge/language-Python3-red)](https://img.shields.io/badge/language-Python3-red)
[![](https://img.shields.io/badge/Telegram-Channel-blue.svg)](https://t.me/osintgram)
Expand All @@ -17,6 +17,8 @@ Osintgram offers an interactive shell to perform analysis on Instagram account o
- followings Get users followed by target
- fwersemail Get email of target followers
- fwingsemail Get email of users followed by target
- fwersnumber Get phone number of target followers
- fwingsnumber Get phone number of users followed by target
- hashtags Get hashtags used by target
- info Get target info
- likes Get total likes of target's posts
Expand All @@ -31,7 +33,7 @@ Osintgram offers an interactive shell to perform analysis on Instagram account o
```
You can find detailed commands usage [here](doc/COMMANDS.md).

[**Latest version**](https://github.com/Datalux/Osintgram/releases/tag/1.0.1) |
[**Latest version**](https://github.com/Datalux/Osintgram/releases/tag/1.1) |
[CHANGELOG](doc/CHANGELOG.md)

## Tools
Expand Down
17 changes: 16 additions & 1 deletion doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## [1.1](https://github.com/Datalux/Osintgram/releases/tag/1.1)
**Enhancements**
- Improved command parser (#86)
- Improved errors handling (8bd1abc)
- Add new line when input command is empty (f5211eb)
- Added new commands to catch phone number of users (#111)
- Added support for Windows (#100)


**Bug fixes**
- Fix commands output limit bug (#87)
- Fix setting target with "." in username (9082990)
- Readline installing error (#94 )


## [1.0.1](https://github.com/Datalux/Osintgram/releases/tag/1.0.1)
**Bug fixes**
- Set itself as target by param
Expand Down Expand Up @@ -86,7 +101,7 @@

**Bug fixes**

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

## [0.3](https://github.com/Datalux/Osintgram/releases/tag/0.3)
Expand Down
6 changes: 6 additions & 0 deletions doc/COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ Return a list of emails of target followers
### fwingsemail
Return a list of emails of user followed by target

### fwersnumber
Return a list of phone number of target followers

### fwingsnumber
Return a list of phone number of user followed by target

### hashtags
Return a list with all hashtag used by target in his photos

Expand Down
115 changes: 63 additions & 52 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from src.Osintgram import Osintgram
import argparse
from src import printcolors as pc
import sys
import signal
import readline

commands = ["quit", "exit", "list", "help", "addrs", "captions", "comments", "followers",
"followings", "fwersemail", "fwingsemail", "hashtags", "info", "likes",
"mediatype", "photodes", "photos", "propic", "stories", "tagged", "target",
"wcommented", "wtagged"]
is_windows = False

try:
import gnureadline
except:
is_windows = True
import pyreadline


def printlogo():
Expand All @@ -22,7 +24,7 @@ def printlogo():
pc.printout("\_______ /____ >__|___| /__| \___ /|__| (____ /__|_| /\n", pc.YELLOW)
pc.printout(" \/ \/ \/ /_____/ \/ \/ \n", pc.YELLOW)
print('\n')
pc.printout("Version 1.0.1 - Developed by Giuseppe Criscione\n\n", pc.YELLOW)
pc.printout("Version 1.1 - Developed by Giuseppe Criscione\n\n", pc.YELLOW)
pc.printout("Type 'list' to show all allowed commands\n")
pc.printout("Type 'FILE=y' to save results to files like '<target username>_<command>.txt (deafult is disabled)'\n")
pc.printout("Type 'FILE=n' to disable saving to files'\n")
Expand Down Expand Up @@ -50,6 +52,10 @@ def cmdlist():
print("Get email of target followers")
pc.printout("fwingsemail\t")
print("Get email of users followed by target")
pc.printout("fwersnumber\t")
print("Get phone number of target followers")
pc.printout("fwingsnumber\t")
print("Get phone number of users followed by target")
pc.printout("hashtags\t")
print("Get hashtags used by target")
pc.printout("info\t\t")
Expand Down Expand Up @@ -88,10 +94,18 @@ def completer(text, state):
else:
return None

def _quit():
pc.printout("Goodbye!\n", pc.RED)
sys.exit(0)


signal.signal(signal.SIGINT, signal_handler)
readline.parse_and_bind("tab: complete")
readline.set_completer(completer)
if is_windows:
pyreadline.Readline().parse_and_bind("tab: complete")
pyreadline.Readline().set_completer(completer)
else:
gnureadline.parse_and_bind("tab: complete")
gnureadline.set_completer(completer)

printlogo()

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

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


commands = {
'list': cmdlist,
'help': cmdlist,
'quit': _quit,
'exit': _quit,
'addrs': api.get_addrs,
'captions': api.get_captions,
'comments': api.get_total_comments,
'followers': api.get_followers,
'followings': api.get_followings,
'fwersemail': api.get_fwersemail,
'fwingsemail': api.get_fwingsemail,
'fwersnumber': api.get_fwersnumber,
'fwingsnumber': api.get_fwingsnumber,
'hashtags': api.get_hashtags,
'info': api.get_user_info,
'likes': api.get_total_likes,
'mediatype': api.get_media_type,
'photodes': api.get_photo_description,
'photos': api.get_user_photo,
'propic': api.get_user_propic,
'stories': api.get_user_stories,
'tagged': api.get_people_tagged_by_user,
'target': api.change_target,
'wcommented': api.get_people_who_commented,
'wtagged': api.get_people_who_tagged
}

signal.signal(signal.SIGINT, signal_handler)
gnureadline.parse_and_bind("tab: complete")
gnureadline.set_completer(completer)

while True:
pc.printout("Run a command: ", pc.YELLOW)
cmd = input()
if cmd == "quit" or cmd == "exit":
pc.printout("Goodbye!\n", pc.RED)
sys.exit(0)
elif cmd == "list" or cmd == "help":
cmdlist()
elif cmd == "addrs":
api.get_addrs()
elif cmd == "captions":
api.get_captions()
elif cmd == "comments":
api.get_total_comments()
elif cmd == "followers":
api.get_followers()
elif cmd == "followings":
api.get_followings()
elif cmd == 'fwersemail':
api.get_fwersemail()
elif cmd == 'fwingsemail':
api.get_fwingsemail()
elif cmd == "hashtags":
api.get_hashtags()
elif cmd == "info":
api.get_user_info()
elif cmd == "likes":
api.get_total_likes()
elif cmd == "mediatype":
api.get_media_type()
elif cmd == "photodes":
api.get_photo_description()
elif cmd == "photos":
api.get_user_photo()
elif cmd == "propic":
api.get_user_propic()
elif cmd == "stories":
api.get_user_stories()
elif cmd == "tagged":
api.get_people_tagged_by_user()
elif cmd == "target":
api.change_target()
elif cmd == "wcommented":
api.get_people_who_commented()
elif cmd == "wtagged":
api.get_people_who_tagged()

_cmd = commands.get(cmd)

if _cmd:
_cmd()
elif cmd == "FILE=y":
api.set_write_file(True)
elif cmd == "FILE=n":
Expand All @@ -160,5 +169,7 @@ def completer(text, state):
api.set_json_dump(True)
elif cmd == "JSON=n":
api.set_json_dump(False)
elif cmd == "":
print("")
else:
pc.printout("Unknown command\n", pc.RED)
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ requests-toolbelt==0.9.1
geopy>=2.0.0
prettytable==0.7.2
instagram-private-api==1.6.0
readline>=6.2.4
gnureadline>=8.0.0; platform_system != "Windows"
pyreadline==2.1; platform_system == "Windows"
Loading

0 comments on commit 2869d2c

Please sign in to comment.