├── .gitattributes ├── Screenshot.png ├── requirements.txt ├── README.md ├── .gitignore └── silverinstaeye.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silverxcyber/SilverInstaEye/HEAD/Screenshot.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | termcolor 2 | argparse 3 | instagrapi 4 | requests 5 | beautifulsoup4 6 | colorama 7 | googlesearch-python 8 | Pillow>=8.1.1 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SilverInstaEye - Instagram OSINT Tool 🔍 2 | 3 | ## Overview 4 | SilverInstaEye is a comprehensive OSINT tool for Instagram. It gathers extensive information about the target user. Support my GitHub repo by giving it a star! ⭐ 5 | 6 | ![Image Alt](https://github.com/silverxpymaster/SilverInstaEye/blob/809bd82c7a43ad254cbf6f76e9fc193ffb6b659c/Screenshot%20from%202025-03-23%2015-36-15.png) 7 | 8 | ## Features 9 | ```sh 10 | - Basic information - Number and email (masked format), ID, username, number of posts, bio, number of followers, whether the account is private or public, whether it is a business account, etc.. 11 | - Download Posts: Bulk download all available posts from a target account. 12 | - Collect Comments: Extract and store comments from posts. 13 | - Retrieve Followers & Following Lists: Export lists of followers and the accounts being followed. 14 | - Download Stories Anonymously: Downloading the target stories anonymously. 15 | - Identify Posts with User Comments (Dorking): Extracting the posts that the target has commented on. 16 | - Extract Geolocation from Posts: Retrieve and analyze geolocation data embedded in posts. 17 | - Download Instagram Highlights: Save all highlight stories from a profile. 18 | ``` 19 | ## Installation & Usage 20 | 1. Clone the repository: 21 | ```sh 22 | git clone https://github.com/silverxpymaster/SilverInstaEye.git 23 | cd SilverInstaEye 24 | ``` 25 | 2. Install dependencies: 26 | ```sh 27 | pip install -r requirements.txt 28 | ``` 29 | 3. Run the tool: 30 | ```sh 31 | python3 silverinstaeye.py 32 | ``` 33 | ## Youtube Tutorial: 34 | [![Watch the video](https://img.youtube.com/vi/0NOiu3ytFYY/maxresdefault.jpg)](https://www.youtube.com/watch?v=0NOiu3ytFYY) 35 | 36 | Click Photo and watch my youtube video :) 37 | 38 | ## Configuration 39 | - The session is saved in `session.json`. Make sure to keep this file secure. 40 | - Modify API request headers if necessary for stability and efficiency. 41 | 42 | ## Disclaimer 43 | This tool is intended for educational and research purposes only. Unauthorized use of Instagram data may violate Instagram's policies. Use responsibly. 44 | 45 | ## Author 46 | - **SilverX** 47 | - Telegram: [t.me/silverxvip](https://t.me/silverxvip) 48 | - YouTube: [silverxcyber](https://www.youtube.com/@silverxcyber) 49 | 50 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | cover/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | .pybuilder/ 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | # For a library or package, you might want to ignore these files since the code is 87 | # intended to run in multiple environments; otherwise, check them in: 88 | # .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # poetry 98 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 99 | # This is especially recommended for binary packages to ensure reproducibility, and is more 100 | # commonly ignored for libraries. 101 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 102 | #poetry.lock 103 | 104 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 105 | __pypackages__/ 106 | 107 | # Celery stuff 108 | celerybeat-schedule 109 | celerybeat.pid 110 | 111 | # SageMath parsed files 112 | *.sage.py 113 | 114 | # Environments 115 | .env 116 | .venv 117 | env/ 118 | venv/ 119 | ENV/ 120 | env.bak/ 121 | venv.bak/ 122 | 123 | # Spyder project settings 124 | .spyderproject 125 | .spyproject 126 | 127 | # Rope project settings 128 | .ropeproject 129 | 130 | # mkdocs documentation 131 | /site 132 | 133 | # mypy 134 | .mypy_cache/ 135 | .dmypy.json 136 | dmypy.json 137 | 138 | # Pyre type checker 139 | .pyre/ 140 | 141 | # pytype static type analyzer 142 | .pytype/ 143 | 144 | # Cython debug symbols 145 | cython_debug/ 146 | 147 | # PyCharm 148 | # JetBrains specific template is maintainted in a separate JetBrains.gitignore that can 149 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 150 | # and can be added to the global gitignore or merged into this file. For a more nuclear 151 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 152 | #.idea/ 153 | -------------------------------------------------------------------------------- /silverinstaeye.py: -------------------------------------------------------------------------------- 1 | from termcolor import colored 2 | from instagrapi import Client 3 | from googlesearch import search 4 | import os 5 | import time 6 | import requests 7 | import json 8 | import re 9 | import argparse 10 | from bs4 import BeautifulSoup 11 | from colorama import Fore 12 | 13 | os.system("cls || clear") 14 | print(colored("""⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 15 | ███████╗██╗██╗ ██╗ ██╗███████╗██████╗ ██╗███╗ ██╗███████╗████████╗ █████╗ ███████╗██╗ ██╗███████╗ 16 | ██╔════╝██║██║ ██║ ██║██╔════╝██╔══██╗██║████╗ ██║██╔════╝╚══██╔══╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔════╝ 17 | ███████╗██║██║ ██║ ██║█████╗ ██████╔╝██║██╔██╗ ██║███████╗ ██║ ███████║█████╗ ╚████╔╝ █████╗ 18 | ╚════██║██║██║ ╚██╗ ██╔╝██╔══╝ ██╔══██╗██║██║╚██╗██║╚════██║ ██║ ██╔══██║██╔══╝ ╚██╔╝ ██╔══╝ 19 | ███████║██║███████╗╚████╔╝ ███████╗██║ ██║██║██║ ╚████║███████║ ██║ ██║ ██║███████╗ ██║ ███████╗ 20 | ╚══════╝╚═╝╚══════╝ ╚═══╝ ╚══════╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚══════╝ 21 | ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 22 | ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠀⠀⠀⠀⠀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 23 | ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⡇⠀⠀⢰⡆⢘⣆⠀⠀⡆⠀⢸⠀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 24 | ⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠀⣆⣧⡤⠾⢷⡚⠛⢻⣏⢹⡏⠉⣹⠟⡟⣾⠳⣼⢦⣀⣰⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 25 | ⠀⠀⠀⠀⠀⠀⠀⠰⣄⡬⢷⣝⢯⣷⢤⣘⣿⣦⣼⣿⣾⣷⣼⣽⣽⣿⣯⡾⢃⣠⣞⠟⠓⢦⣀⠆⠀⠀⡀⠀⠀⠀⠀⠀⠀ 26 | ⠀⠀⠀⠀⠲⣄⣤⣞⡉⠛⢶⣾⡷⠟⣿⣿⣿⣿⣿⣿⣿⡿⣿⣿⣿⡿⢿⡛⠻⠿⣥⣤⣶⠞⠉⢓⣤⡴⢁⠄⠀⠀⠀⠀⠀ 27 | ⠀⠀⠀⣄⣠⠞⠉⢛⣻⡿⠛⠁⠀⣸⠯⠈⠀⠁⣴⣿⣿⣿⡶⠤⠽⣇⠈⣿⠀⠀⠈⠙⠻⢶⣾⣻⣭⠿⢫⣀⣴⡶⠃⠀⠀ 28 | ⠀⢤⣀⣜⣉⣩⣽⠿⠋⠀⠀⠀⠀⣿⠈⠀⠀⢸⣿⣿⣿⣿⣀⠀⠀⠸⠇⢸⡇⠀⠀⠀⠀⠀⠘⠛⢶⣶⣾⣻⡯⠄⠀⣠⠄ 29 | ⠀⠤⠬⢭⣿⣿⠋⠀⠀⠀⠀⠀⠀⢻⡀⠀⠀⠀⢿⣿⣿⣿⡿⠋⠁⠀⠀⣼⠁⠀⠀⠀⠀⠀⢀⣴⣫⣏⣙⠛⠒⠚⠋⠁⠀ 30 | ⡔⢀⡵⠋⢧⢹⡀⠀⠀⠀⠀⠀⠀⠈⢷⡀⠀⠀⠀⠈⠉⠉⠀⠀⠀⠀⣰⠏⠀⠀⠀⠀⠀⣠⣾⣿⡛⠛⠛⠓⠦⠀⠀⠀⠀ 31 | ⣇⠘⠳⠦⠼⠧⠷⣄⣀⠀⠀⠀⠀⠀⠀⠳⢤⣀⠀⠀⠀⠀⠀⢀⣠⠾⠃⠀⠀⠀⣀⣴⣻⣟⡋⠉⠉⢻⠶⠀⠀⠀⠀⠀⠀ 32 | ⠈⠑⠒⠒⠀⠀⢄⣀⡴⣯⣵⣖⣦⠤⣀⣀⣀⠉⠙⠒⠒⠒⠚⠉⢁⣀⣠⢤⣖⣿⣷⢯⡉⠉⠙⣲⠞⠁⠀⠀⠀⠀⠀⠀⠀ 33 | ⠀⠀⠀⠀⠀⠀⠀⠈⠙⠣⢤⡞⠉⢉⡿⠒⢻⢿⡿⠭⣭⡭⠿⣿⡿⠒⠻⣯⡷⡄⠉⠳⣬⠷⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀ 34 | ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠺⠤⣄⣠⡏⠀⠀⡿⠀⠀⠘⡾⠀⢀⣈⡧⠴⠒⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 35 | ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠙⠒⠓⠒⠒⠚⠛⠉⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 36 | 37 | 38 | Author: SilverX Tg: t.me/silverxvip 39 | """,'red')) 40 | 41 | Qara = '\033[30m' 42 | Qirmizi = '\033[1;31m' 43 | Yasil = '\033[1;32m' 44 | Sari = '\033[1;33m' 45 | Mavi = '\033[1;34m' 46 | Magenta = '\033[1;35m' 47 | Cy = '\033[1;36m' 48 | Aq = '\033[1;37m' 49 | 50 | SESSION_FILE = 'session.json' 51 | 52 | def save_session(cl): 53 | session_data = cl.get_settings() 54 | with open(SESSION_FILE, 'w') as file: 55 | json.dump(session_data, file) 56 | 57 | def load_session(cl): 58 | if os.path.exists(SESSION_FILE): 59 | with open(SESSION_FILE, 'r') as file: 60 | session_data = json.load(file) 61 | cl.set_settings(session_data) 62 | print(f"{Aq}[ {Yasil}+ {Aq}] The session has been restored.") 63 | return True 64 | else: 65 | print(f"{Aq}[ {Qirmizi}! {Aq}] Session file not found, please log in again.") 66 | return False 67 | 68 | 69 | def email_ve_telefon_al(api_url, hedef_istifadeci): 70 | sorgu_bashliqlari = { 71 | 'accept-language': 'en-US;q=1.0', 72 | 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', 73 | 'user-agent': 'Instagram 337.0.3.23.54 (iPhone12,1; iOS 16_6; en_US; en; scale=2.00; 828x1792; 577210397) AppleWebKit/420+', 74 | } 75 | sorgu_melumatlari = {"q": hedef_istifadeci} 76 | 77 | try: 78 | cavab = requests.post(api_url, headers=sorgu_bashliqlari, data=sorgu_melumatlari) 79 | cavab.raise_for_status() 80 | try: 81 | cavab_json = cavab.json() 82 | except json.decoder.JSONDecodeError: 83 | print(Fore.RED + f"JSON parse error occurred: The data is not in the correct format.") 84 | return 'False', 'False' 85 | 86 | telefon = cavab_json.get('phone_number', 'False') 87 | email = cavab_json.get('email', 'False') 88 | 89 | return telefon, email 90 | 91 | except requests.RequestException as xeta: 92 | print(Fore.RED + f"An error occurred while retrieving the phone number and email: {xeta}") 93 | return 'False', 'False' 94 | 95 | 96 | def postlari_yukle(cl, hedef_istifadeci): 97 | try: 98 | user = cl.user_info_by_username(hedef_istifadeci) 99 | 100 | if user.is_private: 101 | print(f"[!] {hedef_istifadeci} This is a personal account.") 102 | following_list = cl.user_following(cl.user_id) 103 | if user.pk not in following_list: 104 | print(f"[X] {hedef_istifadeci} This is a personal account, and you are not following it.") 105 | return 106 | else: 107 | print(f"[+] {hedef_istifadeci} This is a personal account, but it is being followed. The posts are being loaded...") 108 | 109 | media_list = cl.user_medias(user.pk, amount=0) 110 | 111 | if not media_list: 112 | print(f"[!] {hedef_istifadeci} The user has no posts.") 113 | return 114 | 115 | qovluq_adi = hedef_istifadeci 116 | os.makedirs(qovluq_adi, exist_ok=True) 117 | 118 | print(f"[+] {hedef_istifadeci} The user's posts are being loaded..") 119 | 120 | for idx, media in enumerate(media_list): 121 | try: 122 | media_url = None 123 | if media.media_type == 1: 124 | media_url = media.thumbnail_url 125 | dosya_adi = f"post_{idx + 1}.jpg" 126 | elif media.media_type == 2: 127 | media_url = media.video_url 128 | dosya_adi = f"post_{idx + 1}.mp4" 129 | 130 | if not media_url: 131 | raise ValueError(f"Post {idx + 1} Not Uploaded") 132 | 133 | fayl_yolu = os.path.join(qovluq_adi, dosya_adi) 134 | 135 | response = requests.get(media_url, stream=True) 136 | response.raise_for_status() 137 | 138 | with open(fayl_yolu, 'wb') as fayl: 139 | for chunk in response.iter_content(chunk_size=8192): 140 | fayl.write(chunk) 141 | 142 | print(f"[+] Post {idx + 1} : {fayl_yolu}") 143 | time.sleep(1) 144 | except Exception as e: 145 | print(f"[X] Post {idx + 1} - An error occurred while uploading the post.: {str(e)}") 146 | 147 | print(f"[+] {hedef_istifadeci} All posts of the user are stored in folder '{qovluq_adi}'") 148 | 149 | except Exception as e: 150 | print(f"[X] An error occurred while uploading the posts: {str(e)}") 151 | 152 | 153 | def post_yorumlari_topla(cl, hedef_istifadeci): 154 | try: 155 | user = cl.user_info_by_username(hedef_istifadeci) 156 | media_list = cl.user_medias(user.pk, amount=0) 157 | 158 | if not media_list: 159 | print(f"[!] {hedef_istifadeci} The user has no posts.") 160 | return 161 | 162 | yorum_fayl_adi = f"{hedef_istifadeci}_comments.txt" 163 | with open(yorum_fayl_adi, 'w', encoding='utf-8') as fayl: 164 | fayl.write(f"============================== {hedef_istifadeci} Comments ==============================") 165 | 166 | print(f"[+] {hedef_istifadeci} Comments are being collected from the user's posts...") 167 | 168 | for idx, media in enumerate(media_list): 169 | try: 170 | yorumlar = cl.media_comments(media.pk, amount=0) 171 | 172 | if not yorumlar: 173 | print(f"[!] Post {idx + 1} does not have comments.") 174 | continue 175 | 176 | fayl.write(f"Post {idx + 1}:") 177 | for yorum in yorumlar: 178 | fayl.write(f" - {yorum.user.username}: {yorum.text}\n") 179 | fayl.write("\n") 180 | 181 | print(f"[+] Post {idx + 1} comments collected.") 182 | except Exception as e: 183 | print(f"[X] Post {idx + 1} An error occurred while loading comments: {str(e)}") 184 | 185 | print(f"[+] All comments were written to the '{yorum_fayl_adi}' file.") 186 | except Exception as e: 187 | print(f"[X] An error occurred while uploading the comments: {str(e)}") 188 | 189 | def izleyicileri_ve_izlediklerini_yazdir(cl, hedef_istifadeci, amount=0): 190 | try: 191 | user = cl.user_info_by_username(hedef_istifadeci) 192 | print(f"{Aq}[ {Yasil}+ {Aq}] Collecting followers and following of {hedef_istifadeci}...") 193 | 194 | izleyiciler = cl.user_followers(user.pk, amount=amount) 195 | izleyiciler_fayl = f"{hedef_istifadeci}_followers.txt" 196 | with open(izleyiciler_fayl, 'w', encoding='utf-8') as fayl: 197 | fayl.write(f"============================== {hedef_istifadeci} Followers ==============================\n") 198 | for idx, follower in enumerate(izleyiciler.values(), start=1): 199 | fayl.write(f"{idx}. {follower.username}\n") 200 | print(f"{Aq}[ {Yasil}+ {Aq}] Followers of {hedef_istifadeci} saved to '{izleyiciler_fayl}'.") 201 | 202 | izledikleri = cl.user_following(user.pk, amount=amount) 203 | izledikleri_fayl = f"{hedef_istifadeci}_following.txt" 204 | with open(izledikleri_fayl, 'w', encoding='utf-8') as fayl: 205 | fayl.write(f"============================== {hedef_istifadeci} Following ==============================\n") 206 | for idx, following in enumerate(izledikleri.values(), start=1): 207 | fayl.write(f"{idx}. {following.username}\n") 208 | print(f"{Aq}[ {Yasil}+ {Aq}] Following of {hedef_istifadeci} saved to '{izledikleri_fayl}'.") 209 | 210 | except Exception as e: 211 | print(f"{Aq}[ {Qirmizi}! {Aq}] An error occurred while fetching followers and following: {str(e)}") 212 | 213 | 214 | def storiləri_yukle(cl, hedef_istifadeci): 215 | try: 216 | user = cl.user_info_by_username(hedef_istifadeci) 217 | 218 | if user.is_private: 219 | print(f"{Aq}[ {Sari}! {Aq}] {hedef_istifadeci} private accaunt.") 220 | following_list = cl.user_following(cl.user_id) 221 | if user.pk not in following_list: 222 | print(f"{Aq}[ {Qirmizi}! {Aq}] {hedef_istifadeci} It is a private account and you are not following it.") 223 | return 224 | else: 225 | print(f"{Aq}[ {Yasil}+ {Aq}] {hedef_istifadeci} It is a private account, but it is being followed.Stories are being downloaded...") 226 | 227 | stories = cl.user_stories(user.pk) 228 | 229 | if not stories: 230 | print(f"{Aq}[ {Sari}! {Aq}] {hedef_istifadeci} The user has no stories") 231 | return 232 | 233 | qovluq_adi = f"{hedef_istifadeci}_stories" 234 | if not os.path.exists(qovluq_adi): 235 | os.mkdir(qovluq_adi) 236 | 237 | print(f"{Aq}[ {Yasil}+ {Aq}] {hedef_istifadeci} The user's stories are being downloaded...") 238 | 239 | for idx, story in enumerate(stories): 240 | try: 241 | media_url = story.thumbnail_url if story.media_type == 1 else story.video_url 242 | fayl_yolu = os.path.join(qovluq_adi, 243 | f"story_{idx + 1}.jpg" if story.media_type == 1 else f"story_{idx + 1}.mp4") 244 | 245 | with open(fayl_yolu, 'wb') as fayl: 246 | fayl.write(requests.get(media_url).content) 247 | 248 | print(f"{Aq}[ {Yasil}+ {Aq}] Story {idx + 1} Downloaded: {fayl_yolu}") 249 | time.sleep(1) 250 | except Exception as e: 251 | print(f"{Aq}[ {Qirmizi}! {Aq}] An error occurred while loading Story {idx + 1}: {str(e)}") 252 | 253 | print( 254 | f"{Aq}[ {Yasil}+ {Aq}] All stories of {hedef_istifadeci} have been saved in the '{qovluq_adi}' folder.") 255 | 256 | except Exception as e: 257 | print(f"{Aq}[ {Qirmizi}! {Aq}] An error occurred while loading the stories: {str(e)}") 258 | 259 | 260 | def dorkla_melumat_topla(hedef_istifadeci): 261 | google_dork = f"site:instagram.com intext:{hedef_istifadeci}" 262 | 263 | try: 264 | links = [url for url in search(google_dork, num_results=10, unique=True) if "https://www.instagram.com/" in url] 265 | 266 | if not links: 267 | print("[!] Heç bir nəticə tapılmadı.") 268 | return 269 | 270 | fayl_adi = f"{hedef_istifadeci}_dork_links.txt" 271 | with open(fayl_adi, 'w', encoding='utf-8') as file: 272 | file.write("The following Instagram links were found:\n") 273 | for link in links: 274 | file.write(link + '\n') 275 | 276 | print(f"[+] The results have been written to the file'{fayl_adi}'") 277 | 278 | except Exception as e: 279 | print(f"[!] An error occurred: {e}") 280 | 281 | def geo_melumatlari_topla(cl, hedef_istifadeci): 282 | try: 283 | user = cl.user_info_by_username(hedef_istifadeci) 284 | try: 285 | media_list = cl.user_medias_v1(user.pk, 20) 286 | except Exception: 287 | print(f"{Aq}[ {Qirmizi}! {Aq}] Media data could not be retrieved.") 288 | return 289 | 290 | if not media_list: 291 | print(f"{Aq}[ {Sari}! {Aq}] {hedef_istifadeci} has no posts.") 292 | return 293 | 294 | geo_fayl_adi = f"{hedef_istifadeci}_geo_data.txt" 295 | with open(geo_fayl_adi, 'w', encoding='utf-8') as fayl: 296 | fayl.write(f"============================== {hedef_istifadeci} Geo Data ==============================") 297 | 298 | print(f"{Aq}[ {Yasil}+ {Aq}] Geo data is being collected from the posts of {hedef_istifadeci}") 299 | 300 | for idx, media in enumerate(media_list): 301 | try: 302 | if media.location: 303 | location = media.location 304 | else: 305 | continue 306 | 307 | try: 308 | location_details = cl.location_info_v1(location.pk) 309 | except Exception: 310 | try: 311 | location_details = cl.location_info_a1(location.pk) 312 | except Exception: 313 | location_details = None 314 | 315 | fayl.write(f"\nPost {idx + 1}:") 316 | fayl.write(f"\n - Location: {location.name}") 317 | fayl.write(f"\n - Latitude: {location.lat}") 318 | fayl.write(f"\n - Longitude: {location.lng}") 319 | 320 | if location_details: 321 | fayl.write(f"\n - Name: {location_details.name}") 322 | fayl.write(f"\n - Address: {location_details.address if location_details.address else 'No data available'}") 323 | fayl.write(f"\n - City: {location_details.city if location_details.city else 'No data available'}") 324 | fayl.write("\n") 325 | 326 | print(f"{Aq}[ {Yasil}+ {Aq}] Geo data collected for Post {idx + 1}.") 327 | except Exception: 328 | continue 329 | 330 | print(f"\n{Aq}[ {Yasil}+ {Aq}] All geo data has been written to the '{geo_fayl_adi}' file.") 331 | except Exception: 332 | print(f"{Aq}[ {Qirmizi}! {Aq}] An unexpected error occurred.") 333 | 334 | def highlightlari_yukle(cl, hedef_istifadeci): 335 | try: 336 | user = cl.user_info_by_username(hedef_istifadeci) 337 | highlights = cl.user_highlights(user.pk) 338 | 339 | if not highlights: 340 | print(f"{Aq}[ {Sari}! {Aq}] {hedef_istifadeci} Highlights not found.") 341 | return 342 | 343 | os.makedirs(f"highlights/{hedef_istifadeci}", exist_ok=True) 344 | 345 | for highlight in highlights: 346 | highlight_info = cl.highlight_info(highlight.pk) 347 | highlight_folder = f"highlights/{hedef_istifadeci}/{highlight.title}" 348 | os.makedirs(highlight_folder, exist_ok=True) 349 | 350 | for idx, item in enumerate(highlight_info.items): 351 | try: 352 | media_url = item.video_url if item.video_url else item.thumbnail_url 353 | ext = "mp4" if item.video_url else "jpg" 354 | file_path = os.path.join(highlight_folder, f"highlight_{idx + 1}.{ext}") 355 | 356 | response = requests.get(media_url, stream=True) 357 | if response.status_code == 200: 358 | with open(file_path, "wb") as f: 359 | for chunk in response.iter_content(1024): 360 | f.write(chunk) 361 | print(f"{Aq}[ {Yasil}+ {Aq}] {highlight.title} - highlight {idx + 1} has been downloaded.") 362 | else: 363 | print(f"{Aq}[ {Qirmizi}! {Aq}] {highlight.title} - highlight {idx + 1} could not be downloaded.") 364 | except Exception as e: 365 | print(f"{Aq}[ {Qirmizi}! {Aq}] Xəta: {e}") 366 | 367 | print(f"\n{Aq}[ {Yasil}+ {Aq}] All highlights have been downloaded.") 368 | except Exception as e: 369 | print(f"{Aq}[ {Qirmizi}! {Aq}] An unexpected error occurred: {e}") 370 | 371 | def main(): 372 | parser = argparse.ArgumentParser(description="Instagram User Information and Content Downloader") 373 | parser.add_argument('-u', '--username', required=True, help="Instagram username to target") 374 | parser.add_argument('-informations', action='store_true', help="Fetch user information(number,mail,id,bio, etc...)") 375 | parser.add_argument('-posts', action='store_true', help="Download user posts") 376 | parser.add_argument('-stories', action='store_true', help="Download user stories(anonim)") 377 | parser.add_argument('-highlights', action='store_true', help="Download user highlights") 378 | parser.add_argument('-dorks', action='store_true', help="Collect information using Google dorks") 379 | parser.add_argument('-comments', action='store_true', help="Collect comments from user posts") 380 | parser.add_argument('-geo', action='store_true', help="Collect geo data from user posts") 381 | parser.add_argument('-follow', action='store_true', help="Collect followers and following list") 382 | 383 | args = parser.parse_args() 384 | 385 | cl = Client() 386 | if not load_session(cl): 387 | IstifadeciAdi = input(f"\n[ {Yasil}+ {Aq}] Enter your Instagram Username: {Qirmizi}") 388 | Sifre = input(f"[ {Yasil}+ {Aq}] Enter your Instagram Password: {Qirmizi}") 389 | try: 390 | cl.login(IstifadeciAdi, Sifre) 391 | print(f"{Aq}[ {Yasil}+ {Aq}] Login completed successfully!") 392 | save_session(cl) 393 | except Exception as e: 394 | print(f"{Aq}[ {Qirmizi}! {Aq}] An error occurred during login: {str(e)}") 395 | return 396 | 397 | hedef_istifadeci = args.username 398 | 399 | if args.informations: 400 | try: 401 | melumatlar = ['68', '74', '74', '70', '73', '3A', '2F', '2F', '69', '2E', '69', '6E', '73', '74', '61', 402 | '67', '72', '61', '6D', '2E', '63', '6F', '6D', '2F', '61', '70', '69', '2F', '76', '31', 403 | '2F', '75', '73', '65', '72', '73', '2F', '6C', '6F', '6F', '6B', '75', '70', '2F'] 404 | melumat_str = ''.join([chr(int(x, 16)) for x in melumatlar]) 405 | api_url = melumat_str 406 | 407 | print(f"\n{Aq}[ {Yasil}+ {Aq}] Closing target: {hedef_istifadeci}") 408 | telefon, email = email_ve_telefon_al(api_url, hedef_istifadeci) 409 | 410 | user = cl.user_info_by_username(hedef_istifadeci) 411 | 412 | print(f"Username : {user.username}") 413 | print(f"Full Name : {user.full_name}") 414 | print(f"Id : {user.pk}") 415 | print(f"Bio : {user.biography}") 416 | print(f"Profile Link : {user.external_url}") 417 | print(f"Is it a private account? : {user.is_private}") 418 | print(f"Is it a business account? : {user.is_business}") 419 | print(f"Phone Number : {telefon}") 420 | print(f"Email : {email}") 421 | print(f"Followers Count : {user.follower_count}") 422 | print(f"Following Count : {user.following_count}") 423 | print(f"Number of Posts : {user.media_count}") 424 | print("-" * 50) 425 | 426 | txt_fayl = f"accaunt_{hedef_istifadeci}.txt" 427 | with open(txt_fayl, 'w', encoding='utf-8') as fayl: 428 | fayl.write(f"============================== ACCAUNT INFORMATIONS ===============================\n") 429 | fayl.write(f"Username : {user.username}\n") 430 | fayl.write(f"Full Name : {user.full_name}\n") 431 | fayl.write(f"Id : {user.pk}\n") 432 | fayl.write(f"Bio : {user.biography}\n") 433 | fayl.write(f"Profile Link : {user.external_url}\n") 434 | fayl.write(f"Is it a private account? : {user.is_private}\n") 435 | fayl.write(f"Is it a business account? : {user.is_business}\n") 436 | fayl.write(f"Phone Number : {telefon}\n") 437 | fayl.write(f"Email : {email}\n") 438 | fayl.write(f"Followers Count : {user.follower_count}\n") 439 | fayl.write(f"Following Count : {user.following_count}\n") 440 | fayl.write(f"Number of Posts : {user.media_count}\n") 441 | 442 | print(f"\n{Aq}[ {Yasil}+ {Aq}] Information about {hedef_istifadeci} has been saved in the {txt_fayl} file.") 443 | except Exception as e: 444 | print(Fore.RED + f"An error occurred: {str(e)}") 445 | 446 | if args.posts: 447 | postlari_yukle(cl, hedef_istifadeci) 448 | 449 | if args.stories: 450 | storiləri_yukle(cl, hedef_istifadeci) 451 | 452 | if args.highlights: 453 | highlightlari_yukle(cl, hedef_istifadeci) 454 | 455 | if args.dorks: 456 | dorkla_melumat_topla(hedef_istifadeci) 457 | 458 | if args.comments: 459 | post_yorumlari_topla(cl, hedef_istifadeci) 460 | 461 | if args.geo: 462 | geo_melumatlari_topla(cl, hedef_istifadeci) 463 | 464 | if args.follow: 465 | izleyicileri_ve_izlediklerini_yazdir(cl, hedef_istifadeci) 466 | 467 | if __name__ == "__main__": 468 | main() 469 | --------------------------------------------------------------------------------