{"id":18857479,"url":"https://github.com/podboy/xiaoya-kits","last_synced_at":"2025-07-25T06:35:40.758Z","repository":{"id":247005098,"uuid":"823430393","full_name":"podboy/xiaoya-kits","owner":"podboy","description":"小雅 alist 部署和维护","archived":false,"fork":false,"pushed_at":"2024-07-17T06:39:09.000Z","size":88,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-30T06:45:42.682Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/podboy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-03T02:59:35.000Z","updated_at":"2025-04-22T04:47:26.000Z","dependencies_parsed_at":"2024-07-06T04:44:32.130Z","dependency_job_id":"e70dd2e3-d2ac-4641-b2af-8248c5c2a3e9","html_url":"https://github.com/podboy/xiaoya-kits","commit_stats":null,"previous_names":["podboy/xiaoya-kits"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/podboy/xiaoya-kits","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/podboy%2Fxiaoya-kits","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/podboy%2Fxiaoya-kits/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/podboy%2Fxiaoya-kits/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/podboy%2Fxiaoya-kits/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/podboy","download_url":"https://codeload.github.com/podboy/xiaoya-kits/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/podboy%2Fxiaoya-kits/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260545094,"owners_count":23025644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T04:06:32.044Z","updated_at":"2025-06-18T11:33:28.145Z","avatar_url":"https://github.com/podboy.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xiaoya-kits\n\n\u003e 小雅 alist 部署和维护。\n\n## ❤️ 赞助\n\n`xiaoya-kits` 完全免费获取及使用，但是您的赞赏可以鼓励作者维护，万分谢谢！\n\n### 🌟 GitHub Star\n\n请点击 [GitHub](https://github.com/podboy/xiaoya-kits) 右上角的 `⭐ Star` 增加人气，以便更多的人发现此工具。\n\n### 💽 转存阿里云盘文件\n\n点击链接保存，或者复制本段内容，打开「阿里云盘」APP 。\n\n\u003chttps://www.alipan.com/s/dn6J8Gg4FUC\u003e\n\n这是一个非常小的文件（仅占用您几KB空间），您的转存可以使作者获得更多的存储空间。\n\n### 💰 打赏\n\n欢迎直接通过打赏来支持作者！\n\n![微信赞赏码](.resource/wechatpay_rewardcode.jpg)\n\n## 🗑️ xiaoya clear-aliyundrive\n\n\u003e 一个清理`阿里云盘`中 `xiaoya` 转存文件的工具。\n\n### 为什么选择 `xiaoya clear-aliyundrive`\n\n相比于其他（使用 `Shell` 开发）的清理脚本，`xiaoya clear-aliyundrive` 的清理更加灵活。\n\n由于 `xiaoya-kits` 基于 `Python` 开发，并且使用了 [xarg-python](https://github.com/bondbox/xarg-python) 模块，因此 `xiaoya clear-aliyundrive` 命令行更为友好，可同时进行多维度的清理过滤，维护也相对来说更加简单。\n\n### 过滤条件\n\n`xiaoya clear-aliyundrive` 会对小雅转存文件夹下的所有文件（包括文件夹）按照 `updated_at` 时间进行排序，所有最新的转存文件会被优先保留。\n\n#### 强制条件\n\n1. 为避免清理正在转存或者刚刚转存的文件，会强制保留 `60` 秒内的文件（和文件夹）。\n2. 由于当前文件夹没有 `size` 属性，还无法统计文件夹的占用空间，并且小雅一般转存的都是文件而非文件夹，所以文件夹会被强制清理。\n3. 虽然可以根据文件大小来过滤文件，但是（大于空间约束条件的）超大文件总是会被清理，所以必须强制保留一些（没有过时的）文件。\n\n#### 清理过多的文件\n\n`--file`，十进制数，指定最大保留的文件数（默认值为：100）。\n\n按照 `updated_at` 时间进行排序，超过指定数量后的文件会被强制清理。\n\n**默认值 `100` 应该够保持一部电视连续剧了，如果你转存了非常多的小文件，可适当增大此值。**\n\n#### 清理较大的文件\n\n`--byte`，十进制数，最大保留的空间量（默认值为：50.0GB），单位为字节数。\n\n按照 `updated_at` 时间进行排序并计算空间，超过指定空间后的文件会被清理。\n\n**默认值 `50.0GB` 即一半的 `阿里云盘` 永久免费空间，如果您有更多可用空间或可用空间不足，可适当调整此值。**\n\n#### 清理较早的文件\n\n`--minute`，十进制数，最大保留的分钟值（默认值为：24h），单位为分钟。\n\n按照 `updated_at` 时间，和当前时间的差值超过指定分钟数强制清理。\n\n### ⏩ 快速清理（一次性）\n\n使用 `Python\u003e=3.8` 环境，在小雅数据目录下执行以下命令：\n\n```bash\npip3 install --upgrade xiaoya \u0026\u0026 xiaoya --version\nxiaoya clear-aliyundrive --stdout --format\n```\n\n### ⏱️ 定时清理\n\n您可以将 `xiaoya clear-aliyundrive` 命令添加到 `crontab` 中，实现定时清理。\n\n### 🪐 持续清理（守护模式）\n\n在小雅数据目录下执行以下命令，使用守护模式持续清理，按 `ctrl+c` 退出：\n\n```bash\npip3 install --upgrade xiaoya \u0026\u0026 xiaoya --version\nxiaoya clear-aliyundrive --stdout --format --daemon\n```\n\n### docker 部署\n\n```bash\ndocker run -v \u003cxiaoya_config_path\u003e:/etc/xiaoya --name xiaoya-clear ghcr.io/podboy/xiaoya-clear:latest\n```\n\n环境变量：\n\n- `ROOT`：xiaoya 配置文件目录，默认 `/etc/xiaoya`\n- `LEVEL`：日志级别，默认 `info`\n- `MAX_INTERVAL`：两次清理的最大间隔时间，单位秒，默认 `300`\n- `MAX_RESERVED_FILE`：每次清理最大保留的文件数，默认 `100`\n- `MAX_RESERVED_BYTE`：每次清理最大保留的空间量，单位字节，默认 `53687091200`\n- `MAX_RESERVED_MINUTE`：每次清理大保留的分钟值，默认 `1440`\n\n**docker-compose**\n\n```yaml\nversion: '3'\nservices:\n    podboy:\n        image: 'ghcr.io/podboy/xiaoya-clear:latest'\n        container_name: xiaoya-clear\n        volumes:\n            - '\u003cxiaoya_config_path\u003e:/etc/xiaoya'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpodboy%2Fxiaoya-kits","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpodboy%2Fxiaoya-kits","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpodboy%2Fxiaoya-kits/lists"}