f droid dl是一个f-droid(脱机)镜像生成和更新实用程序
fdroid-dl的Python项目详细描述
fdroid dl
是一个基于python的f-droid镜像生成和更新实用程序。指向一个或多个现有的F DROID库,实用程序将下载元数据(图片、描述……),并将其放在本地系统中。只要运行fdroid-dl && fdroid update
就可以了。
动机
我们的想法是拥有一个或多个存储库的无Internet本地副本,而无需在自己的构建服务器上编译数以千计的应用程序,而是像Android客户端那样下载它们。因此,这个工具是简单地下载一个完整的存储库并将应用程序导入本地安装的。在编写一份完整的离线拷贝时,包括f-droid.org官方存储库的资产大约为7.5gb。
安装
fdroid dl可以通过pip获得,只需运行pip install fdroid-dl
,您就可以在命令行上使用fdroid-dl
。pypi.org - fdroid-dl
文档
命令行选项
Usage: fdroid-dl [OPTIONS] COMMAND [ARGS]...
Is a python based f-droid mirror generation and update utility. Point at
one or more existing f-droid repositories and the utility will download
the metadata (pictures, descriptions,..) for you and place it in your
local system.
Simply run "fdroid-dl update && fdroid update" in your folder with repo
and you are set.
Options:
-d, --debug enable debug level logging
-c, --config FILE location of your fdroid-dl.json configuration file
[default: fdroid-dl.json]
-r, --repo DIRECTORY location of your fdroid repository to store the
apk files [default: ./repo]
-m, --metadata DIRECTORY location of your fdroid metadata to store the
asset files [default: ./metadata]
--cache DIRECTORY location for fdroid-dl to store cached data
[default: ./.cache]
--help Show this message and exit.
Commands:
update starts updating process
Usage: fdroid-dl update [OPTIONS] COMMAND [ARGS]...
Options:
--index / --no-index download repository index files [default: True]
--metadata / --no-metadata download metadata assset files [default: True]
--apk / --no-apk download apk files [default: True]
--apk-versions INTEGER how many versions of apk to download [default:
1]
--src / --no-src download src files [default: True]
--threads INTEGER configure number of parallel threads used for
download [default: 10]
--head-timeout INTEGER maximum time in seconds a HEAD request is
allowed to take [default: 10]
--index-timeout INTEGER maximum time in seconds index file download is
allowed to take [default: 60]
--download-timeout INTEGER maximum time in seconds file download is allowed
to take [default: 60]
--help Show this message and exit.
配置文件
待办事项
- [X]创建后端爬行现有的版本
- [X]直接获取index.jar和index-v1.jar的信息
- [X]与新旧回购风格的兼容性
- [X]下载多线程
- [X]验证APK校验和
- [X]索引文件的本地缓存
- []源代码下载尚未实现
- []元数据更新以执行增量,而不是始终完全下载
- []旧apk文件的清理策略(可能已经有了吗?)
- [x]创建一个clipython click
- [X]PIP包packaging.python.org
- [X]PIP包的CI生成
- []文档;-)
- []编写测试pytest
更改日志
- WIP:添加了文档
- WIP:已添加测试
- 请求模拟?
想法
- 请求缓存?
开发
要求
- python 2.7.*或3.5.*
- PIP 3.x
- Virtualenv 3.x
本地安装
# git clone https://github.com/t4skforce/fdroid-dl.git
# cd fdroid-dl
# virtualenv .env
# source .env/bin/activate
# python setup.py install
# fdroid-dl --help
# python3 -m fdroid_dl --help
参考文献
在开发本项目时,使用了以下参考资料
飞行机器人
- 设置f-droid应用程序回购f-droid.org
- 生成元数据引用f-droid.org
- 所有关于描述、图形和屏幕截图的内容f-droid.org
- 如何向f-droid添加回购f-droid.org
- 如何脱机发送和接收应用程序f-droid.org
Python
- python文档python.org
- pyyaml文档pyyaml.org
- 请求:人类的http python-requests.org
- 抑制不安全的请求警告:python2.6stackoverflow.com中正在发出未验证的https请求
- 如何在python中下载带有requests.py的大文件?stackoverflow.com
- 使用futures的人类的异步python http请求requests-futures
- 测试代码python-guide.org
- 抑制不安全的请求警告:python2.6stackoverflow.com中正在发出未验证的https请求
- 如何在python中下载带有requests.py的大文件?stackoverflow.com