From e736f6b0b0e6a097410c45ea5a7bb5d8df5e0f39 Mon Sep 17 00:00:00 2001 From: JrDw0 <37445725+JrDw0@users.noreply.github.com> Date: Thu, 9 Apr 2020 16:38:23 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oneforall/modules/search/github_api.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/oneforall/modules/search/github_api.py b/oneforall/modules/search/github_api.py index 1bcaf6f..9d66755 100644 --- a/oneforall/modules/search/github_api.py +++ b/oneforall/modules/search/github_api.py @@ -1,6 +1,7 @@ import requests import api import json +from common.utils import match_subdomain from common.search import Search from config import logger @@ -61,7 +62,7 @@ class GithubAPI(Search): if resp.status_code != 200: logger.log('ERROR', f'{self.source}模块搜索出错') break - subdomains = self.match(self.domain, resp.text) + subdomains = match_subdomain(self.domain, resp.text) if not subdomains: break self.subdomains = self.subdomains.union(subdomains) @@ -72,8 +73,6 @@ class GithubAPI(Search): 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: From 1e44b46b17cf3e0861f6b4fd49195c80a770f8a3 Mon Sep 17 00:00:00 2001 From: Jing Ling Date: Fri, 10 Apr 2020 02:44:02 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oneforall/modules/search/github_api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oneforall/modules/search/github_api.py b/oneforall/modules/search/github_api.py index 9d66755..e87b39e 100644 --- a/oneforall/modules/search/github_api.py +++ b/oneforall/modules/search/github_api.py @@ -73,6 +73,8 @@ class GithubAPI(Search): logger.log('ERROR', e.args) break total_count = resp_json.get('total_count') + if not isinstance(total_count, int): + break if page * 100 > total_count: break if page * 100 > 1000: