Created
October 22, 2025 18:17
-
-
Save mirh/51ae5b61d10d3a5ab2ec40085a92016a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /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