From 8e55e4bcf570383334f87e2a7b05035cc7779e4e Mon Sep 17 00:00:00 2001 From: /XNL-h4ck3r Date: Fri, 3 Mar 2023 09:57:53 +0000 Subject: [PATCH] v1.19 - Bug fix --- CHANGELOG.md | 6 ++++++ README.md | 2 +- waymore.py | 27 ++++++++++++++------------- waymore/__init__.py | 2 +- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee70007..af3a653 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ ## Changelog +- v1.19 + + - Changed + + - Bug fix - ignore any blank lines in the input file when validating if input is in the correct format + - v1.18 - Changed diff --git a/README.md b/README.md index f4088d2..8c52724 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
-## About - v1.18 +## About - v1.19 The idea behind **waymore** is to find even more links from the Wayback Machine than other existing tools. diff --git a/waymore.py b/waymore.py index 72f956a..d117a45 100644 --- a/waymore.py +++ b/waymore.py @@ -951,19 +951,20 @@ def validateArgInput(x): for i in inputValues: - # Check if input seems to be valid domain or URL - match = re.search(r"^([a-z0-9\-\_][a-z0-9\-\_]{0,61}[a-z0-9]{0,1}\.)+([a-z0-9\-\_]{1,61}|[a-z0-9\-\_]{1,30}\.[a-z]{2,})(/[^\n|?#]*)?$", i.strip().rstrip('\n')) - if match is None: - if isInputFile: - error = 'Each line of the input file must contain a domain only (with no schema) to search for all links, or a domain and path (with no schema) to just get archived response for that URL. Do not pass a query string or fragment in any lines.' - else: - error = 'Pass a domain only (with no schema) to search for all links, or pass a domain and path (with no schema) to just get archived responses for that URL. Do not pass a query string or fragment.' - error = error + ' The first line that seems invalid is: ' + str(i) + '\nIf you believe this is flagged in error, please raise an issue on Github :)' - if x == '': - writerr(colored(error,'red')) - sys.exit() - else: - raise argparse.ArgumentTypeError(error) + if i.strip().rstrip('\n') != '': + # Check if input seems to be valid domain or URL + match = re.search(r"^([a-z0-9\-\_][a-z0-9\-\_]{0,61}[a-z0-9]{0,1}\.)+([a-z0-9\-\_]{1,61}|[a-z0-9\-\_]{1,30}\.[a-z]{2,})(/[^\n|?#]*)?$", i.strip().rstrip('\n')) + if match is None: + if isInputFile: + error = 'Each line of the input file must contain a domain only (with no schema) to search for all links, or a domain and path (with no schema) to just get archived response for that URL. Do not pass a query string or fragment in any lines.' + else: + error = 'Pass a domain only (with no schema) to search for all links, or pass a domain and path (with no schema) to just get archived responses for that URL. Do not pass a query string or fragment.' + error = error + ' The first line that seems invalid is: ' + str(i) + '\nIf you believe this is flagged in error, please raise an issue on Github :)' + if x == '': + writerr(colored(error,'red')) + sys.exit() + else: + raise argparse.ArgumentTypeError(error) return x def processAlienVaultPage(url): diff --git a/waymore/__init__.py b/waymore/__init__.py index 0e5f308..f6ae582 100644 --- a/waymore/__init__.py +++ b/waymore/__init__.py @@ -1 +1 @@ -__version__="1.18" \ No newline at end of file +__version__="1.19" \ No newline at end of file