From 1f73dfb5dbf1cac251305cacbe1794df545d8376 Mon Sep 17 00:00:00 2001 From: Hsury Date: Wed, 30 Oct 2019 20:00:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++++++ drive.py | 4 ++++ requirements.txt | 2 ++ 3 files changed, 12 insertions(+) create mode 100644 requirements.txt diff --git a/README.md b/README.md index f5579fe..116f38b 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 b2907f5..f11f17b 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 0000000..4160275 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +requests +rsa -- GitLab