{"id":13620347,"url":"https://github.com/foyoux/aligo","last_synced_at":"2026-01-28T14:17:12.022Z","repository":{"id":40334710,"uuid":"385489471","full_name":"foyoux/aligo","owner":"foyoux","description":"🔥简单、易用、可扩展的阿里云盘 API 接口库🚀","archived":false,"fork":false,"pushed_at":"2026-01-15T15:39:36.000Z","size":3371,"stargazers_count":924,"open_issues_count":52,"forks_count":161,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-01-15T18:26:48.803Z","etag":null,"topics":["aliyunpan","api","python","sdk"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/foyoux.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-07-13T05:42:19.000Z","updated_at":"2026-01-15T15:40:00.000Z","dependencies_parsed_at":"2022-07-11T02:51:20.857Z","dependency_job_id":"c9efa6cf-8fbb-4a9e-a283-06b1aae98784","html_url":"https://github.com/foyoux/aligo","commit_stats":{"total_commits":396,"total_committers":6,"mean_commits":66.0,"dds":"0.41414141414141414","last_synced_commit":"e638c7681f5f5f93e010df39375e9eb8799d0841"},"previous_names":[],"tags_count":161,"template":false,"template_full_name":null,"purl":"pkg:github/foyoux/aligo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foyoux%2Faligo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foyoux%2Faligo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foyoux%2Faligo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foyoux%2Faligo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foyoux","download_url":"https://codeload.github.com/foyoux/aligo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foyoux%2Faligo/sbom","scorecard":{"id":408309,"data":{"date":"2025-08-11","repo":{"name":"github.com/foyoux/aligo","commit":"4be6ea054267cbc06a1ec686c30fda69eff57591"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 1/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: topLevel 'contents' permission set to 'write': .github/workflows/python-publish.yml:17","Warn: no topLevel permission defined: .github/workflows/started-notify.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/foyoux/aligo/python-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/foyoux/aligo/python-publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/python-publish.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/foyoux/aligo/python-publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/python-publish.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/foyoux/aligo/python-publish.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:33","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:34","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   2 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/python-publish.yml:20"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v6.2.6 not signed: https://api.github.com/repos/foyoux/aligo/releases/198733693","Warn: release artifact v6.2.5 not signed: https://api.github.com/repos/foyoux/aligo/releases/198732875","Warn: release artifact v6.2.4 not signed: https://api.github.com/repos/foyoux/aligo/releases/158486822","Warn: release artifact v6.2.3 not signed: https://api.github.com/repos/foyoux/aligo/releases/157932785","Warn: release artifact v6.2.2 not signed: https://api.github.com/repos/foyoux/aligo/releases/149904946","Warn: release artifact v6.2.6 does not have provenance: https://api.github.com/repos/foyoux/aligo/releases/198733693","Warn: release artifact v6.2.5 does not have provenance: https://api.github.com/repos/foyoux/aligo/releases/198732875","Warn: release artifact v6.2.4 does not have provenance: https://api.github.com/repos/foyoux/aligo/releases/158486822","Warn: release artifact v6.2.3 does not have provenance: https://api.github.com/repos/foyoux/aligo/releases/157932785","Warn: release artifact v6.2.2 does not have provenance: https://api.github.com/repos/foyoux/aligo/releases/149904946"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: PYSEC-2023-74 / GHSA-j8r2-6x86-q33q","Warn: Project is vulnerable to: PYSEC-2018-28 / GHSA-x84v-xcm2-53pg","Warn: Project is vulnerable to: GHSA-g7vv-2v7x-gj9p"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T21:57:36.569Z","repository_id":40334710,"created_at":"2025-08-18T21:57:36.569Z","updated_at":"2025-08-18T21:57:36.569Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28846058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T13:02:32.985Z","status":"ssl_error","status_checked_at":"2026-01-28T13:02:04.945Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["aliyunpan","api","python","sdk"],"created_at":"2024-08-01T21:00:54.837Z","updated_at":"2026-01-28T14:17:12.016Z","avatar_url":"https://github.com/foyoux.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# aligo\n\n🚀🔥 简单、易用、可扩展的 [阿里云盘](https://www.alipan.com/) API 接口库 👍👍\n\n[wiki 文档](https://github.com/foyoux/aligo/wiki) + [examples](https://github.com/foyoux/aligo/tree/main/examples)\n\n\u003e 文档写得很简单，详情请查看 代码提示 + 文档注释\n\u003e\n\u003e 有任何疑问 请 [issue](https://github.com/foyoux/aligo/issues/new?assignees=\u0026labels=\u0026template=bug_report.md\u0026title=)\n\u003e\n\u003e 附带一份文档 [阿里云盘开放平台文档](https://www.yuque.com/aliyundrive/zpfszx/fitzlb1uyy0pv0iw)\n\n## 安装\n\n[![python version](https://img.shields.io/pypi/pyversions/aligo)](https://pypi.org/project/aligo/)  [![Downloads](https://static.pepy.tech/personalized-badge/aligo?period=total\u0026units=international_system\u0026left_color=black\u0026right_color=orange\u0026left_text=Downloads)](https://pepy.tech/project/aligo)\n\n```sh\npip install -U aligo\npip install git+https://github.com/foyoux/aligo.git\n```\n\n\u003e **Notes：** 最近官方更新了接口，导致 `get_file_list` 无法直接获取下载链接，现在需要单独使用 `get_download_url` 接口获取下载链接。\n\u003e\n\u003e 对于不常用（没有封装）的接口，可以直接通过 `self.post` 方法直接发送请求。\n\u003e\n\u003e 接口变动较多，有问题请反馈，我会尽快修复。\n\n## 快速入门\n\n```python\n\"\"\"快速入门\"\"\"\nfrom aligo import Aligo\n\nif __name__ == '__main__':\n    ali = Aligo()  # 第一次使用，会弹出二维码，供扫描登录\n\n    user = ali.get_user()  # 获取用户信息\n    print(user.user_name, user.nick_name, user.phone)  # 打印用户信息\n\n    file_list = ali.get_file_list()  # 获取网盘根目录文件列表\n    for file in file_list:  # 遍历文件列表\n        # 注意：print(file) 默认只显示部分信息，但是实际上file有很多的属性\n        print(file.file_id, file.name, file.type)  # 打印文件信息\n```\n\nhttps://user-images.githubusercontent.com/35125624/150529002-c2f1b80b-fb11-4e0a-9fd7-6f57f678ccf5.mp4\n\n## 基本功能\n\n- [x] 完全的代码提示\n- [x] 持久化登录、多帐户登录\n- [x] 福利码兑换\n- [x] 文件夹同步\n- [x] 在线解压缩\n- [x] 支持功能扩展\n- [x] 搜索文件/标签\n- [x] 获取重复文件列表\n- [x] 文件（夹）重命名\n- [x] 文件（夹）上传下载\n- [x] 文件（夹）移动复制\n- [x] 文件（夹）删除恢复\n- [x] 获取文档在线预览接口\n- [x] 文件（夹）分享 保存 收藏\n- [x] 文件（夹）自定义分享（无限制）\n- [x] 获取帐户、云盘（容量）等基本信息\n- [x] 相册 创建 删除 修改 添加文件 获取文件\n\n\u003e **Notes：**\n\u003e 1. 由于秒传链接的失效，自定分享信息的有效期只有4个小时。\n\u003e 2. 阿里云盘不同于其他网盘或系统，其定位文件不是基于文件名（路径），而是通过 `file_id`，这才是唯一定位文件的方式，**aligo** 中提供了简便函数 `get_file_by_path`/`get_folder_by_path`，通过网盘路径获取文件对象，通过 其上的 `file_id` 属性即可获取所需文件标识。但不建议频繁使用此方法，因为内部是通过 `get_file_list` 遍历得到的。\n\u003e 3. 在保存超大分享时（分享中的文件特别多），执行保存全部的方法 - `share_file_save_all_to_drive`，它会立刻执行完毕，但是文件不会立刻被保存到网盘中，阿里云盘服务器会帮你在后台陆续将所有文件存到你的网盘中；所有当你使用 `share_file_save_all_to_drive` 保存超大分享时，却只看到一部分文件时，不用疑惑，这是正常情况。\n\n## 登录\n\n1. 网页扫码登录\n\n   ```python\n   from aligo import Aligo\n   \n   # 提供 port 参数即可, 之后打开浏览器访问 http://\u003cYOUR_IP\u003e:\u003cport\u003e\n   ali = Aligo(port=8080)\n   ```\n\n2. 发送登录二维码到邮箱（推荐）\n\n   **最佳实践**：建议将邮箱绑定到微信，这样能实时收到提醒，登录过期后也可以第一时间收到登录请求。\n\n   ```python\n   from aligo import Aligo, EMailConfig\n   \n   if __name__ == '__main__':\n       email_config = EMailConfig(\n           email='\u003c接收登录邮件的邮箱地址\u003e',\n           # 自配邮箱\n           user='',\n           password='',\n           host='',\n           port=0,\n       )\n       ali = Aligo(email=email_config)\n   ```\n\n## 如何操作资源盘\n\n```python\nfrom aligo import Aligo\n\nif __name__ == '__main__':\n    ali = Aligo()\n\n    drives = ali.list_my_drives()\n    # resource_drive_id = [drive.drive_id for drive in drives if drive.drive_name == 'resource'][0]\n\n    v2_user = ali.v2_user_get()\n    resource_drive_id = v2_user.resource_drive_id\n\n    # 如果后续默认操作资源盘\n    # ali.default_drive_id = resource_drive_id\n\n    file_list = ali.get_file_list(drive_id=resource_drive_id)\n    for file in file_list:\n        print(file)\n```\n\n## 如何自定义配置文件路径\n\n```py\nfrom aligo import set_config_folder, Aligo\n\nif __name__ == '__main__':\n    # 创建 Aligo 对象前，先设置配置文件目录，默认是 \u003c用户目录\u003e/.aligo\n    set_config_folder('/home/aligo')\n    # 会创建 /home/aligo/小号1.json 配置文件\n    ali1 = Aligo(name='小号1')\n    # 会创建 /home/aligo/小号2.json 配置文件\n    ali2 = Aligo(name='小号2')\n```\n\n## 关于扩展功能\n\n一般步骤：\n\n    1. 使用浏览器或其他抓包工具，观察通信过程；\n    2. 获取 url/path + 请求体；\n    3. 继承 `Aligo`, 使用现有的方法 `self._post` 等，进行发送请求；\n\n会自动维护 **token**, 你只需关注如何发送请求即可\n\n[扩展功能举栗🌰 - 配有视频和代码](https://github.com/foyoux/aligo/issues/24)\n\n## 如何彻底删除文件？\n\n\u003e 无需先移动文件到回收站\n\n此功能太危险，**aligo** 未直接提供。不过 [这里](https://github.com/foyoux/aligo/wiki/%E8%87%AA%E5%AE%9A%E4%B9%89%E5%8A%9F%E8%83%BD---%E5%BD%BB%E5%BA%95%E5%88%A0%E9%99%A4%E6%96%87%E4%BB%B6) 扩展了该功能，请小心使用！\n\n## 声明\n\n此项目仅供学习交流，若有不妥之处，侵联必删。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoyoux%2Faligo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoyoux%2Faligo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoyoux%2Faligo/lists"}