mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 12:57:50 +08:00
优化
This commit is contained in:
@@ -61,14 +61,22 @@ class GithubAPI(Search):
|
|||||||
if resp.status_code != 200:
|
if resp.status_code != 200:
|
||||||
logger.log('ERROR', f'{self.source}模块搜索出错')
|
logger.log('ERROR', f'{self.source}模块搜索出错')
|
||||||
break
|
break
|
||||||
|
subdomains = self.match(self.domain, resp.text)
|
||||||
subdomains = self.match(self.domain, str(resp.text))
|
|
||||||
if not subdomains:
|
if not subdomains:
|
||||||
break
|
break
|
||||||
self.subdomains = self.subdomains.union(subdomains)
|
self.subdomains = self.subdomains.union(subdomains)
|
||||||
page += 1
|
page += 1
|
||||||
if page * 100 > json.loads(resp.text)['total_count']:
|
try:
|
||||||
print(page)
|
resp_json = resp.json()
|
||||||
|
except Exception as e:
|
||||||
|
logger.log('ERROR', e.args)
|
||||||
|
break
|
||||||
|
total_count = resp_json.get('total_count')
|
||||||
|
if isinstance(total_count, int):
|
||||||
|
break
|
||||||
|
if page * 100 > total_count:
|
||||||
|
break
|
||||||
|
if page * 100 > 1000:
|
||||||
break
|
break
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
@@ -96,4 +104,4 @@ def do(domain): # 统一入口名字 方便多线程调用
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
do('freebuf.com')
|
do('exmaple.com')
|
||||||
|
|||||||
Reference in New Issue
Block a user