diff --git a/README.md b/README.md index f5579fe3fe4a6478c7ba16859e22afb91f50eaa6..116f38b4b13b8f69476e67d6329f5f4ff86d3474 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,12 @@ ## 使用指南 +### 准备 + +前往[发布页](https://github.com/Hsury/BiliDrive/releases/latest)获取可直接运行的二进制文件 + +亦可[下载源代码](https://github.com/Hsury/BiliDrive/archive/master.zip)后使用Python 3.6或更高版本运行 + ### 登录 ``` diff --git a/drive.py b/drive.py index b2907f5477e6728e5cc60528a1f85f97003a32b7..f11f17b8a72d9f0a9d3227da4117bde76b20a6ab 100644 --- a/drive.py +++ b/drive.py @@ -196,6 +196,9 @@ def upload_handle(args): log("Cookies加载失败, 请先登录") return None file_name = args.file + if not os.path.exists(file_name): + log(f"{file_name}不存在") + return None log(f"上传: {os.path.basename(file_name)} ({os.path.getsize(file_name) / 1024 / 1024:.2f} MB)") first_4mb_sha1 = calc_sha1(read_in_chunks(file_name, chunk_size=4 * 1024 * 1024, chunk_number=1), hexdigest=True) history = read_history() @@ -371,6 +374,7 @@ if __name__ == "__main__": args = parser.parse_args() try: args.func(args) + break except AttributeError: shell = True parser.print_help() diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..41602756bd5c056d40ac0f4000b052e565265d37 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +requests +rsa