Compare commits

...

3 Commits

Author SHA1 Message Date
9513141ccf 0.4.12 2021-01-17 11:51:22 +08:00
bdc9fa113e fix #197 set proxy to null 2021-01-17 11:50:22 +08:00
36946111db fix #198 add notice 2021-01-17 11:42:06 +08:00
4 changed files with 8 additions and 9 deletions

View File

@ -1,3 +1,3 @@
__version__ = '0.4.11' __version__ = '0.4.12'
__author__ = 'RicterZ' __author__ = 'RicterZ'
__email__ = 'ricterzheng@gmail.com' __email__ = 'ricterzheng@gmail.com'

View File

@ -120,7 +120,6 @@ def cmd_parser():
try: try:
sys.argv = [unicode(i.decode(sys.stdin.encoding)) for i in sys.argv] sys.argv = [unicode(i.decode(sys.stdin.encoding)) for i in sys.argv]
print()
except (NameError, TypeError): except (NameError, TypeError):
pass pass
except UnicodeDecodeError: except UnicodeDecodeError:
@ -157,7 +156,7 @@ def cmd_parser():
exit(0) exit(0)
# TODO: search without language # TODO: search without language
if args.proxy: if args.proxy is not None:
proxy_url = urlparse(args.proxy) proxy_url = urlparse(args.proxy)
if not args.proxy == '' and proxy_url.scheme not in ('http', 'https'): if not args.proxy == '' and proxy_url.scheme not in ('http', 'https'):
logger.error('Invalid protocol \'{0}\' of proxy, ignored'.format(proxy_url.scheme)) logger.error('Invalid protocol \'{0}\' of proxy, ignored'.format(proxy_url.scheme))
@ -171,7 +170,7 @@ def cmd_parser():
write_config() write_config()
exit(0) exit(0)
if args.viewer_template: if args.viewer_template is not None:
if not args.viewer_template: if not args.viewer_template:
args.viewer_template = 'default' args.viewer_template = 'default'

View File

@ -19,6 +19,11 @@ from nhentai.utils import generate_html, generate_cbz, generate_main_html, gener
def main(): def main():
banner() banner()
if sys.version_info < (3, 0, 0):
logger.error('nhentai now only support Python 3.x')
exit(1)
options = cmd_parser() options = cmd_parser()
logger.info('Using mirror: {0}'.format(BASE_URL)) logger.info('Using mirror: {0}'.format(BASE_URL))
@ -114,8 +119,4 @@ signal.signal(signal.SIGINT, signal_handler)
if __name__ == '__main__': if __name__ == '__main__':
if sys.version_info < (3, 0, 0):
logger.error('nhentai now only support Python 3.x')
exit(1)
main() main()

View File

@ -1,7 +1,6 @@
# #
# Copyright (C) 2010-2012 Vinay Sajip. All rights reserved. Licensed under the new BSD license. # Copyright (C) 2010-2012 Vinay Sajip. All rights reserved. Licensed under the new BSD license.
# #
from __future__ import print_function, unicode_literals
import logging import logging
import re import re
import platform import platform