任何主题的大容量文件下载程序。
ctdl的Python项目详细描述
内容下载程序
content downloadera.k.actdl是一个带有command的python包 line实用程序和desktop gui 大块头!
功能
- ctdl可以用作命令行实用程序和桌面gui。
- ctdl从google获取与搜索查询相关的文件链接 搜索。
- 可以使用多线程并行下载文件。
- ctdl与python 2和python 3兼容。
安装
- 要安装内容下载程序,只需,
$ pip install ctdl
- TQM中的平行进度条似乎有一些问题 已经解决了 pull。直到这个拉力 合并后,请运行以下命令使用我的修补程序:
$ pip install -Ugit+https://github.com/nikhilkumarsingh/tqdm
桌面图形用户界面的使用
要使用ctdl桌面图形用户界面,请打开终端并运行以下命令:
$ ctdl-gui
命令行用法
$ ctdl [-h] [-f FILE_TYPE] [-l LIMIT] [-d DIRECTORY] [-p] [-a] [-t] [-minfs MIN_FILE_SIZE] [-maxfs MAX_FILE_SIZE] [-nr] [query]
可选参数为:
-F文件类型:设置文件类型。(可以采用ppt、pdf等值, XML等)
Default value: pdf
-l limit:指定要下载的文件数。
Default value: 10
-d目录:指定文件的存储目录。
Default: A directory with same name as the search query in the current directory.
-P:用于并行下载。
-minfs min_file_size:指定要下载的最小文件大小 千字节(KB)。
Default: 0
-nr:防止下载重定向。
Default: False
-Max FixMax文件大小:指定要下载的最大文件大小 千字节(KB)。
Default: -1 (represents no maximum file size)
示例
- 要获取可用文件类型的列表:
$ ctdl -a
- 要获取潜在高威胁文件类型的列表:
$ ctdl -t
- 下载主题为“python”的pdf文件:
$ ctdl python这是默认行为,将下载10 当前目录中名为“python”的文件夹中的pdf文件。
- 下载3个关于“健康”的PPT文件:
$ ctdl -f ppt -l 3 health
- 要显式指定下载文件夹:
$ ctdl -d/home/nikhil/Desktop/ml-pdfsmachine-learning
- 并行下载文件:$ ctdl -f pdf -p python
- 并行搜索和下载10个pdf格式的文件 包含文本“python”和“algorithm”,不允许 URL重定向,文件大小在10000 KB(10 MB)之间 和100000 KB(100 MB),其中KB表示千字节,其中 以兆字节表示的等效值: $ ctdl -f pdf -l 10 -minfs 10000 -maxfs 100000 -nr-p "python algorithm"
在python文件中的用法
fromctdlimportctdlctdl.download_content(file_type='ppt',limit=5,directory='/home/nikhil/Desktop/ml-pdfs',query='machine learning using python')
待办事项
- [X]在下载潜在的威胁性文件之前提示用户
- [X]创建CTDL图形用户界面
- []实施单元测试
- []使用DuckDuckGo API作为选项
想做贡献吗?
- 克隆存储库
$ git clone http://github.com/nikhilkumarsingh/content-downloader
- 安装依赖项$ pip install -r requirements.txt
注意:当前版本的tqdm似乎有一些问题。如果 您没有获得预期的进度条行为,请尝试此修补程序:
$ pip uninstall tqdm $ pip install git+https://github.com/nikhilkumarsingh/tqdm
- 在ctdl/ctdl.py中,从.downloader和 .utils用于以下导入,因此它从以下位置更改: python from .downloader import download_series, download_parallel from .utils import FILE_EXTENSIONS, THREAT_EXTENSIONS 致: python from downloader import download_series, download_parallel from utils import FILE_EXTENSIONS, THREAT_EXTENSIONS
- 直接运行python文件python ctdl/ctdl.py ___(而不是 使用ctdl ___)