Skip to content

Instantly share code, notes, and snippets.

@mirh
Created October 22, 2025 18:17
Show Gist options
  • Select an option

  • Save mirh/51ae5b61d10d3a5ab2ec40085a92016a to your computer and use it in GitHub Desktop.

Select an option

Save mirh/51ae5b61d10d3a5ab2ec40085a92016a to your computer and use it in GitHub Desktop.
#! /usr/bin/python
import time
import requests
import os
PREFIX = [
'http://file.dlh.net/public/data/Cheats/'
]
POSTFIX = [
'/wargames.zip'
]
###############################################################################
# Don't edit below this line
###############################################################################
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
ENDC = '\033[0m'
def main():
#while True:
print("\nTesting URLs.", time.ctime())
os.system("color")
checkUrls()
# print("Press CTRL+C to exit")
# time.sleep(10) #Sleep 10 seconds
def checkUrls():
for num in range(48500, 48530, 1):
status = "N/A"
try:
status = checkUrl(PREFIX[0] + str(num) + POSTFIX[0])
except requests.exceptions.ConnectionError:
status = "DOWN"
printStatus(str(num), status)
def checkUrl(url):
r = requests.get(url, timeout=5)
#print r.status_code
return str(r.status_code)
def printStatus(url, status):
color = GREEN
if status != "200":
color=RED
print(color+status+ENDC+' '+ url)
#
# Main app
#
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment