From f9b0300694f1c5f83c5754a76e6f1eed557a376d Mon Sep 17 00:00:00 2001 From: Arap Bett Date: Tue, 19 Nov 2024 13:51:26 -0500 Subject: [PATCH] Update trackout.py Updated the script to Python 3. Replaced `urllib2` with `requests` for better handling of HTTP requests. Added error handling for network issues and invalid IP addresses. Split the code into functions for better readability and maintenance. Added a function to calculate the distance between two IP addresses using the 'geopy' library. --- trackout.py | 107 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 71 insertions(+), 36 deletions(-) diff --git a/trackout.py b/trackout.py index caaaaee..80a5c50 100644 --- a/trackout.py +++ b/trackout.py @@ -1,43 +1,78 @@ -#!/usr/bin/python +#!/usr/bin/python3 -#Name : Trackout -#Writer(s) : Abay | abaykan.com -#Description : TrackOut is a simple IP Tracker using Python. +# Name : Trackout +# Writer(s) : Abay | abaykan.com +# Contribution : Arap Bett +# Description : TrackOut is a simple IP Tracker using Python. import os -import urllib2 +import requests import json import colorama +from geopy.distance import geodesic + colorama.init(autoreset=True) -os.system("clear"); -print colorama.Fore.CYAN + """ - _____ _ ___ _ - /__ \_ __ __ _ ___| | __ /___\_ _| |_ - / /\/ '__/ _` |/ __| |/ /// // | | | __| - / / | | | (_| | (__|