diff --git a/nhentai/constant.py b/nhentai/constant.py index 11f175c..d07ff38 100644 --- a/nhentai/constant.py +++ b/nhentai/constant.py @@ -1,6 +1,9 @@ -SCHEMA = 'http://' +import os + +SCHEMA = os.getenv('NHENTAI_SCHEMA', 'http://') # BASE_URL = 'nhentai.net' -BASE_URL = 'nhentai.ricterz.me' +BASE_URL = os.getenv('NHENTAI', 'nhentai.ricterz.me') + URL = '%s%s' % (SCHEMA, BASE_URL) DETAIL_URL = '%s/g' % URL SEARCH_URL = '%s/search/' % URL diff --git a/nhentai/parser.py b/nhentai/parser.py index f897754..a3d4ad0 100644 --- a/nhentai/parser.py +++ b/nhentai/parser.py @@ -90,6 +90,9 @@ def search_parser(keyword, page): title = (title[:85] + '..') if len(title) > 85 else title id_ = re.search('/g/(\d+)/', doujinshi.a['href']).group(1) result.append({'id': id_, 'title': title}) + if not result: + logger.warn('Not found anything of keyword {}'.format(keyword)) + return result