forked from Datalux/Osintgram
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
113 lines (96 loc) · 3.59 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from Osintgram import Osintgram
import argparse
import printcolors as pc
import sys
def printlogo():
pc.printout("________ .__ __ \n", pc.YELLOW)
pc.printout("\_____ \ _____|__| _____/ |_ ________________ _____ \n", pc.YELLOW)
pc.printout(" / | \ / ___/ |/ \ __\/ ___\_ __ \__ \ / \ \n", pc.YELLOW)
pc.printout("/ | \\\___ \| | | \ | / /_/ > | \// __ \| Y Y \\\n", pc.YELLOW)
pc.printout("\_______ /____ >__|___| /__| \___ /|__| (____ /__|_| /\n", pc.YELLOW)
pc.printout(" \/ \/ \/ /_____/ \/ \/ \n", pc.YELLOW)
print('\n')
pc.printout("Version 0.3 - Developed by Giuseppe Criscione - 2019\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")
def cmdlist():
#print("set <username>\t Set user to analize")
#print("clear\t\t Remove the user setted")
pc.printout("FILE=y/n\t")
print("Enable/disable output in a '<target username>_<command>.txt' file'")
pc.printout("info\t\t")
print("Get target info")
pc.printout("addrs\t\t")
print("Get all registered addressed by target photos")
pc.printout("followers\t")
print("Get target followers")
pc.printout("followings\t")
print("Get users followed by target")
pc.printout("hashtags\t")
print("Get hashtags used by target")
pc.printout("likes\t\t")
print("Get total likes of target's posts")
pc.printout("comments\t")
print("Get total comments of target's posts")
pc.printout("tagged\t\t")
print("Get list of users tagged by target")
pc.printout("photodes\t")
print("Get description of target's photos")
pc.printout("photos\t\t")
print("Download target's photos in output folder")
pc.printout("captions\t")
print("Get target's photos captions")
pc.printout("mediatype\t")
print("Get target's posts type (photo or video)")
pc.printout("propic\t\t")
print("Download target's profile picture")
printlogo()
parser = argparse.ArgumentParser()
parser.add_argument('id', type=str, # var = id
help='username')
args = parser.parse_args()
api = Osintgram(args.id)
id = api.getUserID(args.id)
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.getAddrs(id)
elif cmd == "followers":
api.getFollowers(id)
elif cmd == "followings":
api.getFollowings(id)
elif cmd == "hashtags":
api.getHashtags(id)
elif cmd == "likes":
api.getTotalLikes(id)
elif cmd == "comments":
api.getTotalComments(id)
elif cmd == "info":
api.getUserInfo()
elif cmd == "tagged":
api.getPeopleTaggedByUser(id)
elif cmd == "photodes":
api.getPhotoDescription()
elif cmd == "FILE=y":
api.setWriteFile(True)
elif cmd == "FILE=n":
api.setWriteFile(False)
elif cmd == "photos":
api.getUserPhoto(id)
elif cmd == "captions":
api.getCaptions(id)
elif cmd == "mediatype":
api.getMediaType(id)
elif cmd == "propic":
api.getUserPropic()
else:
pc.printout("Unknown command\n", pc.RED)