File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -479,7 +479,21 @@ def _setCrawler():
479479 if not conf .crawlDepth :
480480 return
481481
482- crawl (conf .url )
482+ if not conf .bulkFile :
483+ crawl (conf .url )
484+ else :
485+ targets = getFileItems (conf .bulkFile )
486+ for i in xrange (len (targets )):
487+ try :
488+ target = targets [i ]
489+ crawl (target )
490+
491+ if conf .verbose in (1 , 2 ):
492+ status = '%d/%d links visited (%d%%)' % (i + 1 , len (targets ), round (100.0 * (i + 1 ) / len (targets )))
493+ dataToStdout ("\r [%s] [INFO] %s" % (time .strftime ("%X" ), status ), True )
494+ except Exception , ex :
495+ errMsg = "problem occured while crawling at '%s' ('%s')" % (target , ex )
496+ logger .error (errMsg )
483497
484498def _setGoogleDorking ():
485499 """
Original file line number Diff line number Diff line change @@ -102,17 +102,25 @@ def crawlThread():
102102 threadData .shared .deeper = set ()
103103 threadData .shared .unprocessed = set ([target ])
104104
105- logger .info ("starting crawler" )
105+ infoMsg = "starting crawler"
106+ if conf .bulkFile :
107+ infoMsg += " for target URL '%s'" % target
108+ logger .info (infoMsg )
106109
107110 for i in xrange (conf .crawlDepth ):
108111 if i > 0 and conf .threads == 1 :
109112 singleTimeWarnMessage ("running in a single-thread mode. This could take a while" )
113+
110114 threadData .shared .count = 0
111115 threadData .shared .length = len (threadData .shared .unprocessed )
112116 numThreads = min (conf .threads , len (threadData .shared .unprocessed ))
113- logger .info ("searching for links with depth %d" % (i + 1 ))
117+
118+ if not conf .bulkFile :
119+ logger .info ("searching for links with depth %d" % (i + 1 ))
120+
114121 runThreads (numThreads , crawlThread )
115122 clearConsoleLine (True )
123+
116124 if threadData .shared .deeper :
117125 threadData .shared .unprocessed = set (threadData .shared .deeper )
118126 else :
You can’t perform that action at this time.
0 commit comments