2024/09: 毕业啦?本项目暂停维护
Tsinghua Cloud Disk Batch Download Assistant is suitable for situations where the shared file size is too large and cannot be downloaded directly. This script adds more practical functions:
You need to install python in advance, the installation process is abbreviated, and the dependent libraries in the requirements.txt
file:
pip install -r requirements.txt
Flags | Default | Description |
---|---|---|
--link, -l | Required | Share link of Tsinghua Cloud. |
--save_dir, -s | ~/Desktop | Path to save the files. Default: Desktop |
--file, -f | None | Regex to match the file path. Default: download all files. |
python thu_cloud_download.py
-l https://cloud.tsinghua.edu.cn/d/1234567890/
-s " /PATH/TO/SAVE "
-f " *.pptx? " (regex, 正则表达式)
The --file, -f parameters support UNIX shell-style pattern strings and support the following wildcard characters:
The specific usage is as follows
# 下载链接中所有文件
python thu_cloud_download.py -l https://xxx
# 下载链接中所有的.txt文件
python thu_cloud_download.py -l https://xxx -f * .txt
# 下载链接中某个文件夹的所有文件
python thu_cloud_download.py -l https://xxx -f folder/subfolder/ *
Download all txt files in the link
>> python thu_cloud_download.py -l https://cloud.tsinghua.edu.cn/d/b9aca92417f04166acdc/ -f *.pcd
2023-12-18 21:15:11,853 - INFO - Share key: b9aca92417f04166acdc
2023-12-18 21:15:12,811 - INFO - Searching for files to be downloaded, Wait a moment...
=======================================================
Last Modified Time File Size File Path
-------------------------------------------------------
2022-06-27T19:30:21+08:00 53324648 /cam3.pcd
2022-06-27T19:30:28+08:00 52693930 /cam4.pcd
2022-06-27T19:30:35+08:00 52672991 /cam5.pcd
2022-06-27T19:30:42+08:00 52774114 /cam6.pcd
-------------------------------------------------------
2023-12-18 21:15:14,449 - INFO - # Files: 4. Total size: 201.7 MB.
Start downloading? [y/n]y
2023-12-18 21:15:25,671 - INFO - Root directory name: livoxscan_20220626
[4/4]: 100%|███████████████████████████████| 202M/202M [00:33<00:00, 6.26MiB/s]
2023-12-18 21:15:59,479 - INFO - Download finished.