diff --git a/DownloadUsage/DownloadUsage.py b/DownloadUsage/DownloadUsage.py index e27fa2e..cfd832a 100644 --- a/DownloadUsage/DownloadUsage.py +++ b/DownloadUsage/DownloadUsage.py @@ -3,7 +3,6 @@ import requests import json from colorama import Fore, Back, Style -import colorama username = "admin" #EDIT THIS password = "password" #EDIT THIS @@ -20,10 +19,10 @@ notfound = 0 with open(readfile) as f: - print "Parsing Access Log..." + print("Parsing Access Log...") for line in f: try: - p = re.compile(ur'(\d*)-(\d*-\d*\d*......)(........)(.*])(.*)(:)(.*)(for)(.)(.*)(\/)(.*)(\.)') + p = re.compile(r'(\d*)-(\d*-\d*\d*......)(........)(.*])(.*)(:)(.*)(for)(.)(.*)(\/)(.*)(\.)') match = re.match(p,line) if "ACCEPTED DOWNLOAD" in match.group(4): checkfile = match.group(5) + "/" + match.group(7) @@ -36,7 +35,7 @@ except Exception: notfound +=1 #An error may occur if the file has been deleted. This script is not perfect. pass -print Fore.RED + "Could not find",(notfound),"artifacts(most likely deleted)" -print Fore.GREEN + "Total download usage:",(totalbytes/1000000),"MB" -print (Style.RESET_ALL) +print(Fore.RED + "Could not find",(notfound),"artifacts(most likely deleted)") +print(Fore.GREEN + "Total download usage:",(totalbytes/1000000),"MB") +print(Style.RESET_ALL) exit() \ No newline at end of file diff --git a/DownloadUsage/README.md b/DownloadUsage/README.md index 6fb8988..f846436 100644 --- a/DownloadUsage/README.md +++ b/DownloadUsage/README.md @@ -1,2 +1,4 @@ -To install all requirements, use pip install -r requirements. \ No newline at end of file +To install all requirements, use `pip install -r requirements`. + +Usage: `python DownloadUsage.py access.log` diff --git a/DownloadUsage/requirements.txt b/DownloadUsage/requirements.txt index 00b8ae9..580af6b 100644 --- a/DownloadUsage/requirements.txt +++ b/DownloadUsage/requirements.txt @@ -1,5 +1,2 @@ -sys -re requests -json colorama