Skip to content

Commit

Permalink
Add option to specify the root directory in which the files will be s…
Browse files Browse the repository at this point in the history
…aved
  • Loading branch information
guyo13 committed Jun 14, 2018
1 parent 6c537ed commit ab384f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions modules/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ def folder(website, verbose):
outpath = website.replace("http://","")
if website.startswith('https'):
outpath = website.replace("https://","")
else:
outpath = website
if outpath.endswith('/'):
outpath = outpath[:-1]
if not os.path.exists(outpath):
Expand Down
8 changes: 7 additions & 1 deletion torcrawl.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ def main():
'--log',
action='store_true',
help='A save log will let you see which URLs were visited')
parser.add_argument('-f',
'--folder',
help='The root directory which will contain the generated files')

args = parser.parse_args()

Expand All @@ -138,7 +141,10 @@ def main():
# Canon/ion of website and create path for output
if len(args.url) > 0:
website = urlcanon(args.url, args.verbose)
outpath = folder(website, args.verbose)
if args.folder is not None:
outpath = folder(args.folder, args.verbose)
else:
outpath = folder(website, args.verbose)

if args.crawl == True:
lst = crawler(website, cdepth, args.pause, outpath, args.log, args.verbose)
Expand Down

0 comments on commit ab384f7

Please sign in to comment.