-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
修复fofa新版本发布后无法使用 fofa 币 获取超过 1w 条数据的问题。增加 -coin 参数强制用户注意扣币操作
- Loading branch information
Showing
3 changed files
with
18 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,26 +130,30 @@ func (f *FoFa) fetchByFields(fields string, queryStr string) bool { | |
printer.Successf("Fetch Data From FoFa: [%d/%d]", len(apiResult.Results), apiResult.Size) | ||
|
||
for _, result := range apiResult.Results { | ||
//if len(result[0]) == 0 || result[0] == ":0" { | ||
// printer.Debug("There is no HostInfo!") | ||
// continue | ||
// // https://fofa.so/api/v1/search/[email protected]&key=xxx&qbase64=YXBwPSJIaWt2aXNpb24tQ2FtZXJhcy1hbmQtU3VydmVpbGxhbmNlIiAmJiBwcm90b2NvbCE9cnN0cA==&size=100&page=1&fields=host | ||
//} | ||
|
||
if !f.FetchFn(result, int32(apiResult.Size)) { | ||
return true | ||
} | ||
maxSize-- | ||
if maxSize == 0 { | ||
return true | ||
} | ||
//maxSize-- | ||
//if maxSize == 0 { | ||
// return true | ||
//} | ||
} | ||
|
||
// 没有数据,退出 | ||
if len(apiResult.Results) == 0 || len(apiResult.Results) < perPage { | ||
if len(apiResult.Results) == 0 || maxSize < perPage { | ||
return true | ||
} | ||
maxSize -= perPage | ||
if maxSize <= 0 { | ||
return true | ||
} | ||
f.page++ | ||
if !f.option.Coin { | ||
printer.Infof("Use fofa coins to get more than 10,000 data please use -coin to confirm") | ||
return true | ||
} | ||
printer.Infof("The fofa coin will be deducted !!!") | ||
time.Sleep(time.Duration(f.option.ReqIntervalTime) * time.Millisecond) | ||
} | ||
} | ||
|
||
|