Check whether the file exists, do not report a bunch of exceptions

This commit is contained in:
h 2023-03-19 16:08:44 +08:00
parent 79b2d67cc9
commit e0aef6f8af

View File

@ -190,6 +190,11 @@ So you are close to reaching the limit. You have to choose your own value, there
) )
options = parser.parse_args() options = parser.parse_args()
if not os.path.isfile(options.book_name):
print(f"Error: {options.book_name} does not exist.")
exit(1)
PROXY = options.proxy PROXY = options.proxy
if PROXY != "": if PROXY != "":
os.environ["http_proxy"] = PROXY os.environ["http_proxy"] = PROXY