By August 2025, goo.gl is being deprecated by Google (surprise!). Hence we need a way to preserve what goo.gl shortened link points to what webpage to refer in the future.
This is primarily a Python script for checking goo.gl's shortened URLs. It generates IDs of a specified length, validates their resolution, and logs the results in a CSV file. As it is theoretically impossible for me to parse them all, please do contribute.
requests
librarytermcolor
libraryInstall the required libraries using:
pip install requests termcolor
To run the script, execute:
python script.py
Adjust the following parameters in the script:
length
: Length of IDs to check (default: 4).output_file
: Output CSV file name (default: 'goo_gl_results.csv'
).wait_time
: Wait time between requests in seconds (default: 0).batch_size
: Number of results to save in each batch (default: 20).start_id
: Start ID (inclusive), or None
to start from the beginning.end_id
: End ID (exclusive), or None
to continue until the end.Modify these settings as needed:
if __name__ == "__main__":
length = 4
output_file = 'goo_gl_results.csv'
wait_time = 0.5
batch_size = 20
start_id = "aaaa"
end_id = "a999"
print(f"Starting the script with length {length}, output file '{output_file}', wait time {wait_time} seconds, and batch size {batch_size}.")
print(f"Checking IDs from {start_id} to {end_id}")
main(length, output_file, wait_time, batch_size, start_id=start_id, end_id=end_id)
If you want to help with parsing:
start_id
and end_id
in the script to match your chosen range.For questions or to discuss this initiative, please open a new issue. If you'd like to contribute and reserve an ID range for parsing, please let me know under this issue..