Skip to content

Commit

Permalink
Added Tagged functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
thedev132 committed Jan 3, 2024
1 parent 2e9c9cf commit 0ad1abe
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 29 deletions.
1 change: 0 additions & 1 deletion .github/workflows/lint_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ jobs:
- run: pytest . || true
- run: pytest --doctest-modules . || true
- run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true
- run: safety check
4 changes: 2 additions & 2 deletions config/credentials.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[Credentials]
username = USERNAME
password = PASSWORD
username = thedev132_test
password = Thedevcookie1
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def cmdlist():
print("Download target's profile picture")
pc.printout("stories\t\t")
print("Download target's stories")
pc.printout("highlights\t\t")
pc.printout("highlights\t")
print("Download target's highlights")
pc.printout("tagged\t\t")
print("Get list of users tagged by target")
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ requests==2.24.0
requests-toolbelt==0.9.1
geopy>=2.0.0
prettytable==0.7.2
instagrapi
instaloader
instagrapi==1.19.7
instaloader==4.10.2
gnureadline>=8.0.0; platform_system != "Windows"
pyreadline==2.1; platform_system == "Windows"
59 changes: 36 additions & 23 deletions src/Osintgram.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ def get_user_info(self):
try:
content = client.user_info_by_username(self.target).dict()


print(content)
pc.printout("[ID] ", pc.GREEN)
pc.printout(str(content['pk']) + '\n')
pc.printout("[FULL NAME] ", pc.RED)
Expand All @@ -490,8 +490,26 @@ def get_user_info(self):
pc.printout(str(content['is_business']) + '\n')
pc.printout("[VERIFIED ACCOUNT] ", pc.CYAN)
pc.printout(str(content['is_verified']) + '\n')
if 'public_email' in content and content['public_email']:
pc.printout("[EMAIL] ", pc.BLUE)
pc.printout(str(content['public_email']) + '\n')
pc.printout("[HD PROFILE PIC] ", pc.GREEN)
pc.printout(str(content['profile_pic_url']) + '\n')
if 'fb_page_call_to_action_id' in content and content['fb_page_call_to_action_id']:
pc.printout("[FB PAGE] ", pc.RED)
pc.printout(str(content['connected_fb_page']) + '\n')
if 'whatsapp_number' in content and content['whatsapp_number']:
pc.printout("[WHATSAPP NUMBER] ", pc.GREEN)
pc.printout(str(content['whatsapp_number']) + '\n')
if 'city_name' in content and content['city_name']:
pc.printout("[CITY] ", pc.YELLOW)
pc.printout(str(content['city_name']) + '\n')
if 'address_street' in content and content['address_street']:
pc.printout("[ADDRESS STREET] ", pc.RED)
pc.printout(str(content['address_street']) + '\n')
if 'contact_phone_number' in content and content['contact_phone_number']:
pc.printout("[CONTACT PHONE NUMBER] ", pc.CYAN)
pc.printout(str(content['contact_phone_number']) + '\n')
if self.jsonDump:
user = {
'id': content['pk'],
Expand Down Expand Up @@ -811,30 +829,25 @@ def get_people_tagged_by_user(self):
ids = []
username = []
full_name = []
post = []
postList = []
counter = 1

data = self.__get_feed__()

profile = Loader.Profile.from_username(loader.context, self.target)
posts = profile.get_posts()
try:
for i in data:
if "usertags" in i:
c = i.get('usertags').get('in')
for cc in c:
if cc.get('user').get('pk') not in ids:
ids.append(cc.get('user').get('pk'))
username.append(cc.get('user').get('username'))
full_name.append(cc.get('user').get('full_name'))
post.append(1)
else:
index = ids.index(cc.get('user').get('pk'))
post[index] += 1
counter = counter + 1
except AttributeError as ae:
pc.printout("\nERROR: an error occurred: ", pc.RED)
print(ae)
print("")
pass
for post in posts:
taggedUsers = post.tagged_users
for users in taggedUsers:
profile = Loader.Profile.from_username(loader.context, users)
ids.append(profile.userid)
username.append(users)
full_name.append(profile.full_name)
postList.append(post.mediaid)
# counter = counter + 1
# sys.stdout.write("\rCatched %i" % counter)
# sys.stdout.flush()
except KeyboardInterrupt:
posts.freeze()

if len(ids) > 0:
t = PrettyTable()
Expand All @@ -851,7 +864,7 @@ def get_people_tagged_by_user(self):
tagged_list = []

for i in range(len(ids)):
t.add_row([post[i], full_name[i], username[i], str(ids[i])])
t.add_row([postList[i], full_name[i], username[i], str(ids[i])])

if self.jsonDump:
tag = {
Expand Down

0 comments on commit 0ad1abe

Please sign in to comment.