Skip to content

Commit

Permalink
v1.12 - please see CHANGELOG.md for changes
Browse files Browse the repository at this point in the history
  • Loading branch information
xnl-h4ck3r committed Dec 21, 2022
1 parent 403fc1f commit 718c627
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Changelog

- v1.12

- New
- Added argument `-c` / `--config` to specify the full path of a YML config file. If not passed, it looks for file `config.yml` in the same directory as runtime file `waymore.py`

- v1.11

- New
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<center><img src="https://github.com/xnl-h4ck3r/waymore/blob/main/waymore/images/title.png"></center>

## About - v1.11
## About - v1.12

The idea behind **waymore** is to find even more links from the Wayback Machine than other existing tools.

Expand Down Expand Up @@ -65,6 +65,7 @@ $ sudo pip3 install -r requirements.txt
| -lr | --limit-requests | Limit the number of requests that will be made when getting links from a source (this doesn\'t apply to Common Crawl). Some targets can return a huge amount of requests needed that are just not feasible to get, so this can be used to manage that situation. This defaults to 0 (Zero) which means there is no limit. |
| -ow | --output-overwrite | If the URL output file (`waymore.txt`) already exists, it will be overwritten instead of being appended to. |
| -nlf | --new-links-file | If this argument is passed, a waymore.new file will also be written that will contain links for the latest run. This can be used for continuous monitoring of a target. |
| -c | --config | Path to the YML config file. If not passed, it looks for file `config.yml` in the same directory as runtime file `waymore.py` |
| -v | --verbose | Verbose output |
| | --version | Show current version number. |
| -h | --help | Show the help message and exit. |
Expand Down
39 changes: 30 additions & 9 deletions waymore.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ def showOptions():
write(colored('-mode: ' + args.mode, 'magenta')+colored(' Only Responses will be downloaded for the input.','white'))
elif args.mode == 'B':
write(colored('-mode: ' + args.mode, 'magenta')+colored(' URLs will be retrieved AND Responses will be downloaded for the input.','white'))

if args.config is not None:
write(colored('-c: ' + args.config, 'magenta')+colored(' The path of the config.yml file.','white'))

if not inputIsDomainANDPath:
if args.no_subs:
Expand Down Expand Up @@ -366,16 +369,25 @@ def getConfig():
HTTP_ADAPTER = HTTPAdapter(max_retries=retry)
except Exception as e:
writerr(colored('ERROR getConfig 2: ' + str(e), 'red'))

# Try to get the config file values
try:
waymorePath = Path(
os.path.dirname(os.path.realpath(__file__))
)
waymorePath.absolute
if waymorePath == '':
configPath = 'config.yml'
try:
# Get the path of the config file. If -c / --config argument is not passed, then it defaults to config.yml in the same directory as the run file
if args.config is None:
waymorePath = Path(
os.path.dirname(os.path.realpath(__file__))
)
waymorePath.absolute
if waymorePath == '':
configPath = 'config.yml'
else:
configPath = Path(waymorePath / 'config.yml')
else:
configPath = Path(waymorePath / 'config.yml')
try:
waymorePath = args.config
configPath = Path(waymorePath)
except Exception as e:
print(str(e))
config = yaml.safe_load(open(configPath))
try:
FILTER_URL = config.get('FILTER_URL')
Expand Down Expand Up @@ -432,7 +444,10 @@ def getConfig():
CONTINUE_RESPONSES_IF_PIPED = True

except:
writerr(colored('WARNING: Cannot find config.yml, so using default values', 'yellow'))
if args.config is None:
writerr(colored('WARNING: Cannot find file "config.yml", so using default values', 'yellow'))
else:
writerr(colored('WARNING: Cannot find file "' + args.config + '", so using default values', 'yellow'))
FILTER_URL = DEFAULT_FILTER_URL
FILTER_MIME = DEFAULT_FILTER_MIME
FILTER_CODE = DEFAULT_FILTER_CODE
Expand Down Expand Up @@ -2108,6 +2123,12 @@ def argcheckPercent(value):
action="store_true",
help="If this argument is passed, a waymore.new file will also be written that will contain links for the latest run.",
)
parser.add_argument(
"-c",
"--config",
action="store",
help="Path to the YML config file. If not passed, it looks for file 'config.yml' in the same directory as runtime file 'waymore.py'.",
)
parser.add_argument('-v', '--verbose', action='store_true', help="Verbose output")
parser.add_argument('--version', action='store_true', help="Show version number")
args = parser.parse_args()
Expand Down
2 changes: 1 addition & 1 deletion waymore/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__="1.11"
__version__="1.12"

0 comments on commit 718c627

Please sign in to comment.