From 2d456f80ee123e1389fbc25af7065a0913099488 Mon Sep 17 00:00:00 2001 From: ovax <181485458+banaxou@users.noreply.github.com> Date: Mon, 22 Dec 2025 11:39:11 +0100 Subject: [PATCH] hostagram 1.4 --- hostagram.py | 516 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 434 insertions(+), 82 deletions(-) diff --git a/hostagram.py b/hostagram.py index 671ec1e..ec6d040 100644 --- a/hostagram.py +++ b/hostagram.py @@ -1,5 +1,5 @@ -# code by ovax version 1.3 -# best funk [ MONTAGEM BATCHI SLOWED and VAI NO VAPOR SLOWED] +# code by ovax version 1.4 +# best funk [ REZA TORTA | MTG batchi ] import instaloader, fade, os import time @@ -22,7 +22,7 @@ apix = 'https://i.instagram.com/api/v1/users/lookup/' sig_key = '4' KEY = 'e6358aeede676184b9fe702b30f4fd35e71744605e39d2181a34cede076b3c33' -v = "v1.3" +v = "v1.4" q = "https://github.com/banaxou/" white = "\033[97m" b = "\033[94m" @@ -30,6 +30,15 @@ r = "\033[0m" R = "\033[91m" +RED = "\033[91m" +GRN = "\033[92m" +BLU = "\033[94m" +YEL = "\033[93m" +CYN = "\033[96m" +BOLD = "\033[1m" +RST = "\033[0m" +MAG = "\033[95m" + bann = """ .__ __ | |__ ____ ______/ |______ ________________ _____ @@ -38,38 +47,35 @@ |___| /\____/____ >|__| (____ |___ /|__| (____ /__|_| / \/ \/ \/_____/ \/ \/ """ -ban = fr""" +ban = fr""" code by ovax {v} {fade.greenblue(q)} - .__ __ {white}╔ ╗ {white} - | |__ ____ ______/ |______ ________________ _____ [1] user info - | | \ / _ \/ ___| __\__ \ / ___\_ __ \__ \ / \ - | Y ( <_> )___ \ | | / __ \/ /_/ > | \// __ \| Y Y \ [2] id info - |___| /\____/____ >|__| (____ |___ /|__| (____ /__|_| / - \/ \/ \/_____/ \/ \/ [3] watch user - {white}╚ ╝{white} + .__ __ ╭─────────────────────╮ + | |__ ____ ______/ |______ ________________ _____ │ [1] user info │ + | | \ / _ \/ ___| __\__ \ / ___\_ __ \__ \ / \ │ │ + | Y ( <_> )___ \ | | / __ \/ /_/ > | \// __ \| Y Y \ │ [2] id info │ + |___| /\____/____ >|__| (____ |___ /|__| (____ /__|_| / │ │ + \/ \/ \/_____/ \/ \/ │ [3] watch user │ + ╰─────────────────────╯ {R}>{r} 4 new page """ ban2 = fr"""code by ovax {v} {fade.greenblue(q)} - - .__ __ - | |__ ____ ______/ |______ ________________ _____ - | | \ / _ \/ ___| __\__ \ / ___\_ __ \__ \ / \ - | Y ( <_> )___ \ | | / __ \/ /_/ > | \// __ \| Y Y \ - |___| /\____/____ >|__| (____ |___ /|__| (____ /__|_| / - \/ \/ \/_____/ \/ \/ - - ┌─────────────────────────────────────────[ hostagram {v} ]──────────────────────────────────────────┐ - │ [5] Phone Number :: soon │ - │ [6] Email :: soon │ - │ [7] user Check :: soon │ - └─────────────────────────────────────────────────────────────────────────────────────────────────────┘ - - {R}<{r} 8 menu + {bann} + ╭───────────────────[ hostagram {v} ]──────────────────╮ + │ │ + │ • [5] Phone Number • [8] Follow Insight │ + │ │ + │ • [6] Email • [9] List Viewer │ + │ │ + │ • [7] User Check • [10] Follow Watch │ + ╰───────────────────────────────────────────────────────╯ + +{R}<{r} 0 menu """ + loginz = fr""" .__ .__ @@ -83,7 +89,6 @@ code by ovax """ - async def datax(query): def generate_sig(data): return 'ig_sig_key_version=' + sig_key + '&signed_body=' + hmac.new( @@ -121,6 +126,7 @@ def cook_data(q): except Exception as e: print(f"[{R}!{r}] {R}Error during verification {r}: {e}") return False + def datax_user(): p = input(f"{R}>{r} Enter username: ").strip() if not p: @@ -130,12 +136,13 @@ def datax_user(): try: exists = asyncio.run(datax(p)) if exists: - print(f"[{g}+{r}] {p} is associated with Instagram") + input(f"[{g}+{r}] {p} is associated with Instagram") else: print(f"[{R}-{r}] {p} is not associated with any Instagram account") + time.sleep(2) except Exception as ex: print(f"[{R}!{r}] Error: {ex}") - input("Press Enter to continue...") + time.sleep(2) def datax_email(): e = input(f"{R}>{r} Enter email: ").strip().replace(" ", "") @@ -146,12 +153,13 @@ def datax_email(): try: exists = asyncio.run(datax(e)) if exists: - print(f"[{g}+{r}] True {e} is associated with Instagram") + input(f"[{g}+{r}] True {e} is associated with Instagram") else: print(f"[{R}-{r}] {e} is not associated with any Instagram account") + time.sleep(2) except Exception as ex: print(f"[{R}!{r}] {R} Error {r}: {ex}") - input("Press Enter to continue...") + time.sleep(1) def datax_phone(): p = input(f"{R}>{r} Enter phone number (with country code +xx xxxxxxxxxx): ").strip() @@ -162,13 +170,327 @@ def datax_phone(): try: exists = asyncio.run(datax(p)) if exists: - print(f"[{g}+{r}] {p} is associated with Instagram") + input(f"[{g}+{r}] {p} is associated with Instagram") else: print(f"[{R}-{r}] {p} is not associated with any Instagram account") + time.sleep(2) except Exception as ex: print(f"[{R}!{r}] Error: {ex}") - input("Press Enter to continue...") + time.sleep(2) + input("") + +def show_list(): + files = [f for f in os.listdir('.') if f.endswith('.json')] + if not files: + print(f"{R}No JSON files found{r}") + return + os.system("cls" if os.name == "nt" else "clear") + print(f"┌──────────────[{R} Available JSON files {r}]──────────────┐") + for f in files: + print(f" {R}-{r} {f}") + print("└──────────────────────────────────────────────────────────┘") + + filename = input(f"{R}>{r} Enter the JSON file name: ").strip() + os.system("cls" if os.name == "nt" else "clear") + if filename not in files: + print(f"{R}File not found{r}") + time.sleep(2) + return + + try: + with open(filename, "r", encoding="utf-8") as fh: + data = json.load(fh) + except Exception as e: + print(f"{R}Error loading the JSON:{r} {e}") + time.sleep(2) + return + + def print_user(username="N/A", full="N/A", uid="N/A", private="N/A", verified="N/A"): + print(f"{R}Username{r}: {username}") + print(f"{R}Full Name{r}: {full}") + print(f"{R}ID{r}: {uid}") + print(f"{R}Private{r}: {private}") + print(f"{R}Verified{r}: {verified}") + print("──────────────────────────") + + if isinstance(data, list): + for u in data: + if isinstance(u, dict): + print_user( + username=u.get("username"), + full=u.get("full_name") or u.get("name"), + uid=u.get("id") or u.get("pk"), + private=u.get("is_private"), + verified=u.get("is_verified"), + ) + elif isinstance(data, dict) and "users" in data: + for u in data["users"]: + print_user( + username=u.get("username"), + full=u.get("full_name"), + uid=u.get("pk"), + private=u.get("is_private"), + verified=u.get("is_verified"), + ) + else: + print(json.dumps(data, indent=4, ensure_ascii=False)) + + input("") + +def datax_follow(sessionId): + headers = { + "User-Agent": "Instagram 123.0.0.21.114", + "Accept": "*/*", + "Accept-Language": "en-US,en;q=0.9", + "Content-Type": "application/x-www-form-urlencoded", + "X-IG-App-ID": "936619743392459", + } + + print("") + usid = input(f"{R}>{r} Enter Instagram username: ") + + resp = requests.get( + f"https://i.instagram.com/api/v1/users/web_profile_info/?username={usid}", + headers=headers, + cookies={'sessionid': sessionId} + ) + if resp.status_code == 404: + print(f"{R}User doesn't exist{r}") + time.sleep(2) + return + + if resp.status_code != 200: + print(f"Instagram error: {resp.status_code}") + time.sleep(2) + return + + try: + user_id = resp.json()["data"]["user"]["id"] + except: + print(f"{R}Unable to extract data error{r}") + time.sleep(2) + return + + def follow_h(user_id, rel_type="followers"): + all_users = [] + next_max_id = "" + while True: + url = f"https://i.instagram.com/api/v1/friendships/{user_id}/{rel_type}/" + if next_max_id: + url += f"?max_id={next_max_id}" + r = requests.get(url, headers=headers, cookies={'sessionid': sessionId}) + if r.status_code == 404: + print(f"{R}Private account{r}") + time.sleep(2) + return [] + if r.status_code != 200: + print(f"{R}API error: {r.status_code}{r}") + time.sleep(1) + break + try: + data = r.json() + except: + print(f"{R}json error{r}") + time.sleep(1) + break + for u in data.get("users", []): + all_users.append({ + "id": u.get("pk"), + "username": u.get("username"), + "full_name": u.get("full_name"), + "is_verified": u.get("is_verified"), + "is_private": u.get("is_private"), + }) + next_max_id = data.get("next_max_id") + if not next_max_id: + break + return all_users + + followers = follow_h(user_id, "followers") + followings = follow_h(user_id, "following") + + if not followers and not followings: + print(f"{R}Private account{r}") + time.sleep(2) + else: + os.system("cls" if os.name == "nt" else "clear") + print(f"\n┌─────────[ {R}FOLLOWERS{r} ]──────────────────────[ {R}FOLLOWING{r} ]───────────────────────┐\n") + max_50 = 50 + max_view = min(max_50, max(len(followers), len(followings))) + for i in range(max_view): + left = "" + right = "" + if i < len(followers): + f_user = followers[i] + left = ( + f"{R}Username{r} : {f_user['username']}\n" + f"{R}Full name{r} : {f_user['full_name']}\n" + f"{R}ID{r} : {f_user['id']}\n" + f"{R}Verified{r} : {f_user['is_verified']}\n" + f"{R}Private {r}: {f_user['is_private']}" + ) + if i < len(followings): + fo_user = followings[i] + right = ( + f"{R}Username{r}: {fo_user['username']}\n" + f"{R}Full name{r}: {fo_user['full_name']}\n" + f"{R}ID {r}: {fo_user['id']}\n" + f"{R}Verified {r}: {fo_user['is_verified']}\n" + f"{R}Private {r}: {fo_user['is_private']}" + ) + left_line = left.split("\n") if left else [] + right_line = right.split("\n") if right else [] + for j in range(max(len(left_line), len(right_line))): + l = left_line[j] if j < len(left_line) else "" + ri = right_line[j] if j < len(right_line) else "" + print(f" {l:<45} {ri:<45}") + print() + + with open(f"{usid}_followers.json", "w", encoding="utf-8") as f: + json.dump(followers, f, ensure_ascii=False, indent=4) + with open(f"{usid}_following.json", "w", encoding="utf-8") as f: + json.dump(followings, f, ensure_ascii=False, indent=4) + + print("└───────────────────────────────────────────────────────────────────────────────┘") + input("") + print(f"{BLU} Followings | followers Data has been saved to {usid}_following.json | {usid}_followers.json{r} ") + time.sleep(2) +def banner(username): + os.system("cls" if os.name == "nt" else "clear") + width = 44 + header = "FOLLOWER / FOLLOWING TRACKER" + + print(f"{RED}╭{'─' * width}╮{RST}") + print(f"{RED}│{RST} {CYN}{header.center(width - 1)}{RST}{RED}│{RST}") + print(f"{RED}│{RST} {YEL}{username.center(width - 1)}{RST}{RED}│{RST}") + print(f"{RED}╰{'─' * width}╯{RST}\n") + +def fetch_all(sessionId, user_id, rel_type, headers): + users = set() + next_max_id = "" + + while True: + url = f"https://i.instagram.com/api/v1/friendships/{user_id}/{rel_type}/" + if next_max_id: + url += f"?max_id={next_max_id}" + + r = requests.get(url, headers=headers, cookies={'sessionid': sessionId}) + if r.status_code != 200: + break + + try: + data = r.json() + except: + break + + for u in data.get("users", []): + users.add(u.get("username")) + + next_max_id = data.get("next_max_id") + if not next_max_id: + break + + return users + +def follow_watch(sessionId): + headers = { + "User-Agent": "Instagram 123.0.0.21.114", + "X-IG-App-ID": "936619743392459" + } + + username = input(f"{R}>{r} Enter Instagram username: ").strip() + url = f"https://i.instagram.com/api/v1/users/web_profile_info/?username={username}" + + resp = requests.get(url, headers=headers, cookies={'sessionid': sessionId}) + if resp.status_code != 200: + print(f"{R}API error: {resp.status_code}{RST}") + return + + try: + user = resp.json()["data"]["user"] + except: + print(f"{R}Invalid response{RST}") + return + + user_id = user["id"] + followers_count = user["edge_followed_by"]["count"] + following_count = user["edge_follow"]["count"] + + followers = fetch_all(sessionId, user_id, "followers", headers) + followings = fetch_all(sessionId, user_id, "following", headers) + old_counts = (followers_count, following_count) + + print(f"{YEL}Initial snapshot loaded: {followers_count} followers, {following_count} following{RST}") + time.sleep(2) + + history = [] + width = 44 + + try: + while True: + banner(username) + + resp = requests.get(url, headers=headers, cookies={'sessionid': sessionId}) + if resp.status_code != 200: + time.sleep(10) + continue + + data = resp.json()["data"]["user"] + + followers_count = data["edge_followed_by"]["count"] + following_count = data["edge_follow"]["count"] + + now = datetime.now().strftime("%Y-%m-%d %H:%M:%S") + delta_f = followers_count - old_counts[0] + delta_fg = following_count - old_counts[1] + followers_t = f"Followers : {GRN}{followers_count}{RST} ({YEL}{'+' if delta_f > 0 else ''}{delta_f}{RST})" + following_t = f"Following : {GRN}{following_count}{RST} ({YEL}{'+' if delta_fg > 0 else ''}{delta_fg}{RST})" + + print(f"{RED}╭{'─' * width}╮{RST}") + print(f"{RED}│ │{RST}") + print(f"{RED}│{RST}{YEL}{username:^{width}}{RST}{RED}│{RST}") + print(f"{RED}│{RST}{now:^{width}}{RED}│{RST}") + print(f"{RED}├{'─' * width}┤{RST}") + print(f"{RED}│{RST}{followers_t:^{width}} {RED}│{RST}") + print(f"{RED}│{RST}{following_t:^{width}} {RED}│{RST}") + print(f"{RED}╰{'─' * width}╯{RST}") + + + if delta_f != 0: + new_followers = fetch_all(sessionId, user_id, "followers", headers) + if delta_f > 0: + for u in new_followers - followers: + print(f"{GRN}[{now}] + {u} followed {username}{RST}") + history.append({"time": now, "action": "followed", "user": u}) + else: + for u in followers - new_followers: + print(f"{RED}[{now}] - {u} unfollowed {username}{RST}") + history.append({"time": now, "action": "unfollowed", "user": u}) + followers = new_followers + + if delta_fg != 0: + new_following = fetch_all(sessionId, user_id, "following", headers) + if delta_fg > 0: + for u in new_following - followings: + print(f"{RED}[{now}] + {username} now follows {u}{RST}") + history.append({"time": now, "action": "target_followed", "user": u}) + else: + for u in followings - new_following: + print(f"{RED}[{now}] - {username} no longer follows {u}{RST}") + history.append({"time": now, "action": "target_unfollowed", "user": u}) + followings = new_following + + old_counts = (followers_count, following_count) + + with open(f"{username}_changes.json", "w", encoding="utf-8") as f: + json.dump(history, f, ensure_ascii=False, indent=4) + + time.sleep(10) + + except KeyboardInterrupt: + print(f"{RED}Stopped by user{RST}") + def menu_2(): while True: os.system("cls" if os.name == "nt" else "clear") @@ -177,19 +499,51 @@ def menu_2(): w = input(f"{R}>{r} {u}: ").strip() if w == "5": - datax_phone() # Phone Number + datax_phone() elif w == "6": - datax_email() # Email + datax_email() elif w == "7": - datax_user() # User check + datax_user() elif w == "8": - try: - menu() - except NameError: - input("Press Enter to continue...") - break + session_file = "sessionid.txt" + + if not os.path.exists(session_file): + print(f"{R}No session id found,log in with session id {r}") + time.sleep(2) + continue + + with open(session_file, "r") as f: + sessionId = f.read().strip() + + if not sessionId: + print(f"{R}No session id found,log in with session id {r}") + time.sleep(2) + continue + + datax_follow(sessionId) + elif w == "9": + show_list() + elif w == "10": + session_file = "sessionid.txt" + + if not os.path.exists(session_file): + print(f"{R}No session id found,log in with session id {r}") + time.sleep(2) + continue + + with open(session_file, "r") as f: + sessionId = f.read().strip() + + if not sessionId: + print(f"{R}No session id found,log in with session id {r}") + time.sleep(2) + continue + + follow_watch(sessionId) + elif w == "0": + return else: - print(f"[{r}-{r}] {R}Invalid choice{r}") + print(f"[{R}-{r}] Invalid choice") time.sleep(1) def getUserId(username, sessionId): @@ -263,9 +617,7 @@ def lookup(username): def user_info(): ig = instaloader.Instaloader() - red = "\033[1;31m" - r = "\033[0m" - b = "\033[1;34m" + bb = "\033[1;34m" session_file = "sessionid.txt" session_id = "" @@ -273,7 +625,7 @@ def user_info(): with open(session_file, "r") as f: session_id = f.read().strip() - ins = input(f"{red}>{r} Enter Instagram username: ") or "zuck" + ins = input(f"{R}>{r} Enter Instagram username: ") or "zuck" os.system("cls" if os.name == "nt" else "clear") try: ig.context._session.cookies.set("sessionid", session_id) @@ -332,14 +684,13 @@ def user_info(): "Lookup message": u.get("message") }) - - title = f"[ {red}User info{r} ]" + title = f"[ {R}User info{r} ]" line = "─" * (45 - len(title)//2) print("") print(f"┌{line}{title}{line}┐") print("") for key, value in info.items(): - print(f" {red}{key}{r}: {value}") + print(f" {R}{key}{r}: {value}") print("") input(f"└{'─' * (len(line)*2 + len(title))}┘") @@ -352,19 +703,18 @@ def user_info(): with open(xjson, "w", encoding="utf-8") as jsson: json.dump(info, jsson, ensure_ascii=False, indent=4) print("") - print(f"{b}Data has been saved to {file_txt} and {xjson}{r}") + print(f"{bb}Data has been saved to {file_txt} and {xjson}{r}") time.sleep(2) except instaloader.exceptions.ProfileNotExistsException: - print(f"{red}Error{r}: The user does not exist") + print(f"{R}Error{r}: The user does not exist") + time.sleep(1) except Exception as e: - print(f"{red}Unexpected error{r}: {e}") + print(f"{R}Unexpected error{r}: {e}") def id_info(): s = instaloader.Instaloader() - R = "\033[1;31m" - r = "\033[0m" - b = "\033[1;34m" + bb = "\033[1;34m" user_id = input(f"{R}>{r} Enter Instagram ID: ") or "176702683" @@ -417,21 +767,18 @@ def id_info(): json.dump(info, jsson, ensure_ascii=False, indent=4) print("") - print(f"{b}Data has been saved to {file_txt} and {xjson}{r}") + print(f"{bb}Data has been saved to {file_txt} and {xjson}{r}") time.sleep(2) except Exception as e: - print(f"{R}Error Instaloader{r}: {e}") + print(f"{R}Instaloader error{r}: {e}") else: print(f"{R}Error{r}: Username not found") - else: - print(f"{R}HTTP Error{r}: {res.status_code}") except Exception as e: print(f"{R}Unexpected error{r}: {e}") def decox(info): - r = "\033[0m" bold = "\033[1m" gray = "\033[90m" blue = "\033[94m" @@ -455,28 +802,24 @@ def separator(char="─", w=None, color=white): os.system("cls" if os.name == "nt" else "clear") - # Effet d'apparition title = "INSTAGRAM PROFILE" print(separator("═", color=blue)) print(center(bold + white + title + r)) print(separator("═", color=blue)) time.sleep(0.2) - # Nom complet + type + vérification full_name = info.get('Full name', 'N/A') account_type = info.get('Type account', 'N/A') verified = f"{blue}✔ VERIFIED{r}" if info.get('Verified account', 'No') == 'Yes' or info.get('Verified', 'No') == 'Yes' else "" print(center(f"{bold}{full_name}{r} {gray}({account_type}){r} {verified}")) time.sleep(0.1) - # Username + ID print(center(f"{yellow}@{info.get('Username', 'N/A')}{r} {gray}|{r} ID: {info.get('ID', 'N/A')}")) time.sleep(0.1) - # Privacy privacy = f"{yellow}PRIVATE ACCOUNT{r}" if info.get('Private account', False) else f"{blue}PUBLIC ACCOUNT{r}" print(center(f"[{privacy}]")) - time.sleep(0.1) + time.sleep(0.1) # bug don't fixe don't touch print(separator("─", color=gray)) @@ -489,7 +832,6 @@ def separator(char="─", w=None, color=white): print(separator("─", color=gray)) - # Bio if info.get('Bio'): print() print(center(f"{gray}\"{white}{info['Bio']}{gray}\"{r}")) @@ -499,16 +841,13 @@ def separator(char="─", w=None, color=white): print() time.sleep(0.1) - # Extra print(separator("─", color=gray)) print(center(f"{white}Category: {yellow}{info.get('Business category', 'N/A')}{r}")) print(center(f"{white}Highlights available: {yellow}{info.get('Has highlight reels', info.get('Highlight reels', 'N/A'))}{r}")) - print(separator("═", color=blue)) -#End code by IA + print(separator("═", color=blue)) + def watch_id(): - R = "\033[1;31m" - r = "\033[0m" ig = instaloader.Instaloader() idx = input(f"{R}>{r} Enter Instagram ID: ") or "314216" log_file = f"{idx}_log.txt" @@ -527,19 +866,19 @@ def log_info(info_dict): while True: try: - # Fetch username from Instagram API res = requests.get(url, headers=headers) if res.status_code == 200: data = res.json() username = data.get("user", {}).get("username") if not username: print(f"{R}Error: Username not found for ID '{idx}'{r}") + time.sleep(2) break else: - print(f"{R}HTTP Error: {res.status_code}{r}") + print(f"{R}Error: {res.status_code}{r}") + time.sleep(2) break - # Step 2: Use instaloader to fetch detailed profile info try: profile = instaloader.Profile.from_username(ig.context, username) info = { @@ -566,23 +905,28 @@ def log_info(info_dict): except instaloader.exceptions.ProfileNotExistsException: print(f"{R}Error: Profile with username '{username}' not found{r}") + time.sleep(2) break except instaloader.exceptions.ConnectionException as e: print(f"{R}Connection error: {e}{r}") + time.sleep(2) break except Exception as e: print(f"{R}Unexpected error: {e}{r}") + time.sleep(2) break except requests.exceptions.RequestException as e: print(f"{R}Request error: {e}{r}") + time.sleep(2) break except Exception as e: print(f"{R}Unexpected error: {e}{r}") + time.sleep(2) break try: - time.sleep(20) # Wait 20 seconds + time.sleep(10) except KeyboardInterrupt: print(f"{R}Stopped by user{r}") break @@ -627,12 +971,18 @@ def log_info(info_dict): log_info(info) except instaloader.exceptions.ProfileNotExistsException: - print(f"{R}Error : profile '{ins}' not found{r}") + print(f"{R}Error: profile '{ins}' not found{r}") + time.sleep(2) break except Exception as e: - print(f"{R}Error : {e}{r}") + print(f"{R}Error: {e}{r}") + time.sleep(2) - time.sleep(20) # 20s plus chill que 5s pour eviter les ban api ou active un vpn ou add un proxy + try: + time.sleep(20) + except KeyboardInterrupt: + print(f"{R}Stopped by user{r}") + break def watch_menu(): while True: @@ -642,7 +992,7 @@ def watch_menu(): print() print(f"[{R}i{r}] - Instagram ID") print(f"[{R}u{r}] - Instagram Username") - print(f'[{R}m{r}] - menu') + print(f'[{R}m{r}] - Menu') choice = input(f"{b}>{r} Enter your choice (i|u|m): ").strip().lower() @@ -651,7 +1001,7 @@ def watch_menu(): elif choice == 'u': watch_user() elif choice == 'm': - menu() + return else: print(f"{R}Invalid choice Please select either (i/u/m){r}") time.sleep(2) @@ -668,7 +1018,7 @@ def login_easy(): open("sessionid.txt", "w").close() os.system("cls" if os.name == "nt" else "clear") print(fade.greenblue(loginz)) - print(f"{R}If you connect with the session ID, you will have more access to the information{r}") + print(f"{R}If you connect with the session ID, you will have more access to the information{r} ") m = input(f"{b}>{r} Do you want to login with password or session ID (p|s): ").lower().strip() if m == "p": @@ -696,11 +1046,13 @@ def login_easy(): ig.context._session.cookies.set("sessionid", session) profile = instaloader.Profile.from_username(ig.context, uzer) print(f"Successfully logged in as: {profile.username}") + time.sleep(1) with open("sessionid.txt", "w") as f: f.write(session) break - print(f"[{R}-{r}] Invalid choice Please enter 'p' or 's'") + else: + print(f"[{R}-{r}] Invalid choice. Please enter 'p' or 's'") time.sleep(1) def menu():