|
| 1 | +import os |
| 2 | +import instaloader |
| 3 | +import re |
| 4 | +import pandas as pd |
| 5 | +import colorama |
| 6 | +from colorama import Fore |
| 7 | +import sys |
| 8 | +sys.path.append('/home/ian/.local/lib/python3.10/site-packages') |
| 9 | +#---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 10 | +bot = instaloader.Instaloader() |
| 11 | +#---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 12 | +def Profile(): |
| 13 | + os.system('clear') |
| 14 | + print(Fore.MAGENTA+"Profile:") |
| 15 | + username = input(Fore.WHITE+"What is the exact username of the instagram account? >>> ") |
| 16 | + profile = instaloader.Profile.from_username(bot.context, username) |
| 17 | + print("Username: ", profile.username) |
| 18 | + print("User ID: ", profile.userid) |
| 19 | + print("Number of Posts: ", profile.mediacount) |
| 20 | + print("Followers Count: ", profile.followers) |
| 21 | + print("Following Count: ", profile.followees) |
| 22 | + print("Bio: ", profile.biography) |
| 23 | + print("External URL: ", profile.external_url) |
| 24 | + input(Fore.RED+"Press Enter to continue...") |
| 25 | + Start() |
| 26 | +#---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 27 | +def Email(): |
| 28 | + os.system('clear') |
| 29 | + print(Fore.MAGENTA+"Email:") |
| 30 | + username = input(Fore.WHITE+"What is the exact username of the instagram account? >>> ") |
| 31 | + profile = instaloader.Profile.from_username(bot.context, username) |
| 32 | + print("Username: ", profile.username) |
| 33 | + print("Bio: ", profile.biography) |
| 34 | + emails = re.findall(r"\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b", profile.biography) |
| 35 | + print("Emails extracted from the bio:") |
| 36 | + print(emails) |
| 37 | + input(Fore.RED+"Press Enter to continue...") |
| 38 | + Start() |
| 39 | +#---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 40 | +def TopSearch(): |
| 41 | + os.system('clear') |
| 42 | + print(Fore.MAGENTA+"Top Search:") |
| 43 | + text = input(Fore.WHITE+'Type the word that you want the top search resulst for >>> ') |
| 44 | + search_results = instaloader.TopSearchResults(bot.context, text) |
| 45 | + print('') |
| 46 | + print('Loading...') |
| 47 | + print('') |
| 48 | + for username in search_results.get_profiles(): |
| 49 | + print(username) |
| 50 | + |
| 51 | + for hashtag in search_results.get_hashtags(): |
| 52 | + print(hashtag) |
| 53 | + print('') |
| 54 | + input(Fore.RED+"Press Enter to continue...") |
| 55 | + Start() |
| 56 | +#---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 57 | +def PostDownload(): |
| 58 | + os.system('clear') |
| 59 | + print(Fore.MAGENTA+"Post Download:") |
| 60 | + print('Careful when useing account, chance of disabling, use account that you are willing to risk a disable on') |
| 61 | + print('') |
| 62 | + username = input(Fore.WHITE+'Type in the username of the account to download data with >>> ') |
| 63 | + print('') |
| 64 | + password = input('Type in the password for that account >>> ') |
| 65 | + print('') |
| 66 | + UsernameTarget = input('Type in the username that you want to download the posts from >>> ') |
| 67 | + os.system('clear') |
| 68 | + print('') |
| 69 | + print('Loading...') |
| 70 | + print('') |
| 71 | + bot.login(user=username,passwd=password) |
| 72 | + |
| 73 | + profile = instaloader.Profile.from_username(bot.context, UsernameTarget) |
| 74 | + |
| 75 | + posts = profile.get_posts() |
| 76 | + |
| 77 | + for index, post in enumerate(posts, 1): |
| 78 | + bot.download_post(post, target=f"{profile.username}_{index}") |
| 79 | + print('') |
| 80 | + |
| 81 | + input(Fore.RED+"Press Enter to continue...") |
| 82 | + Start() |
| 83 | +#---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 84 | +def FFExtracter(): |
| 85 | + os.system('clear') |
| 86 | + print(Fore.MAGENTA+"Follower and Following Extractor:") |
| 87 | + print('Careful when useing account, chance of disabling, use account that you are willing to risk a disable on') |
| 88 | + print('') |
| 89 | + username = input(Fore.WHITE+'Type in the username of the account to download data with >>> ') |
| 90 | + print('') |
| 91 | + password = input('Type in the password for that account >>> ') |
| 92 | + print('') |
| 93 | + |
| 94 | + bot.login(user=username,passwd=password) |
| 95 | + UsernameTarget = input('Type in the username that you want to get the follwers and folling data from >>> ') |
| 96 | + os.system('clear') |
| 97 | + print('') |
| 98 | + print('Loading...') |
| 99 | + print('') |
| 100 | + profile = instaloader.Profile.from_username(bot.context, UsernameTarget) |
| 101 | + followers = [follower.username for follower in profile.get_followers()] |
| 102 | + followers_df = pd.DataFrame(followers) |
| 103 | + followers_df.to_csv('followers.csv', index=False) |
| 104 | + followings = [followee.username for followee in profile.get_followees()] |
| 105 | + followings_df = pd.DataFrame(followings) |
| 106 | + followings_df.to_csv('followings.csv', index=False) |
| 107 | + print('Done') |
| 108 | + print('') |
| 109 | + input(Fore.RED+"Press Enter to continue...") |
| 110 | + Start() |
| 111 | +#---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 112 | +def Start(): |
| 113 | + os.system('clear') |
| 114 | + print(Fore.MAGENTA+'█████████████████████████████████████████████████████████████████████████████████████████████████████████████████') |
| 115 | + print('░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░░░███░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░░░███') |
| 116 | + print('░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀▄▀░░███░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀▄▀░░███') |
| 117 | + print('░░▄▀░░░░░░░░░░█░░▄▀░░░░░░░░░░█░░▄▀░░░░░░░░▄▀░░███░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀░░░░░░░░▄▀░░███') |
| 118 | + print('░░▄▀░░█████████░░▄▀░░█████████░░▄▀░░████░░▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░█████████░░▄▀░░████░░▄▀░░███') |
| 119 | + print('░░▄▀░░░░░░░░░░█░░▄▀░░█████████░░▄▀░░░░░░░░▄▀░░███░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀░░░░░░░░▄▀░░███') |
| 120 | + print('░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░█████████░░▄▀▄▀▄▀▄▀▄▀▄▀░░███░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀▄▀░░███') |
| 121 | + print('░░░░░░░░░░▄▀░░█░░▄▀░░█████████░░▄▀░░░░░░▄▀░░░░███░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀░░░░░░░░░░█░░▄▀░░░░░░▄▀░░░░███') |
| 122 | + print('████████░░▄▀░░█░░▄▀░░█████████░░▄▀░░██░░▄▀░░█████░░▄▀░░██░░▄▀░░█░░▄▀░░█████████░░▄▀░░█████████░░▄▀░░██░░▄▀░░█████') |
| 123 | + print('░░░░░░░░░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀░░██░░▄▀░░░░░░█░░▄▀░░██░░▄▀░░█░░▄▀░░█████████░░▄▀░░░░░░░░░░█░░▄▀░░██░░▄▀░░░░░░█') |
| 124 | + print('░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░█████████░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀▄▀▄▀░░█') |
| 125 | + print('░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░██░░░░░░░░░░█░░░░░░██░░░░░░█░░░░░░█████████░░░░░░░░░░░░░░█░░░░░░██░░░░░░░░░░█') |
| 126 | + print('█████████████████████████████████████████████████████████████████████████████████████████████████████████████████') |
| 127 | + print('') |
| 128 | + print(Fore.CYAN + "a) Profile Details b) Bio Email Finder c) Top Search Result Finder d) Post Download e) Follower and Following Data Extracter f) Main Menu") |
| 129 | + #print(Fore.CYAN + "") |
| 130 | + print('') |
| 131 | + choice = input(Fore.WHITE + 'What program is being run? >>> ') |
| 132 | + |
| 133 | + if((choice == 'a')): |
| 134 | + Profile() |
| 135 | + elif((choice == 'b')): |
| 136 | + Email() |
| 137 | + elif((choice == 'c')): |
| 138 | + TopSearch() |
| 139 | + elif((choice == 'd')): |
| 140 | + PostDownload() |
| 141 | + elif((choice == 'e')): |
| 142 | + FFExtracter() |
| 143 | + elif((choice == 'f')): |
| 144 | + os.system('sudo python RAVAGE.py') |
| 145 | + else: |
| 146 | + Start() |
0 commit comments