{"id":27933583,"url":"https://github.com/do1e/apicache4shiro","last_synced_at":"2025-06-11T00:06:43.851Z","repository":{"id":291091748,"uuid":"976555040","full_name":"Do1e/APICache4Shiro","owner":"Do1e","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-02T12:10:56.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T04:59:22.162Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.do1e.cn/linkcard-test","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Do1e.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-05-02T10:17:51.000Z","updated_at":"2025-05-02T12:19:32.000Z","dependencies_parsed_at":"2025-05-07T04:59:23.073Z","dependency_job_id":"58bcc654-7246-495d-9635-b6c46a48f29f","html_url":"https://github.com/Do1e/APICache4Shiro","commit_stats":null,"previous_names":["do1e/apicache4shiro"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Do1e%2FAPICache4Shiro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Do1e%2FAPICache4Shiro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Do1e%2FAPICache4Shiro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Do1e%2FAPICache4Shiro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Do1e","download_url":"https://codeload.github.com/Do1e/APICache4Shiro/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Do1e%2FAPICache4Shiro/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259172969,"owners_count":22816558,"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":"2025-05-07T04:59:21.377Z","updated_at":"2025-06-11T00:06:43.793Z","avatar_url":"https://github.com/Do1e.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API Cache for Shiro\r\n\r\n用于缓存[Shiro](https://github.com/Innei/Shiro)中LinkCard的API请求，使用FastAPI和SQLite实现。\r\n\r\n## 功能特点\r\n\r\n- 基于FastAPI构建的高性能API代理服务\r\n- 使用SQLite数据库进行本地缓存\r\n- 支持多种API服务：Bangumi、GitHub、LeetCode、网易云音乐、QQ音乐、TMDB\r\n- 为不同API设置不同的缓存时间\r\n- 支持TMDB API的多语言缓存\r\n- 支持Bangumi API的多语言翻译(为避免返回数据过慢，没有翻译缓存会首先返回原始文本，翻译完成后会更新缓存，在下次请求时返回翻译文本)\r\n\r\n## 默认缓存时间配置\r\n\r\n- Bangumi API: 5天\r\n- GitHub API: 1天\r\n- LeetCode API: 1天\r\n- 音乐API: 30天\r\n- TMDB API: 5天\r\n\r\n## 使用\r\n\r\n```\r\ndocker pull do1e/apicache4shiro\r\ndocker compose up -d\r\n```\r\n\r\n在Shiro的nginx配置靠前的未知添加：\r\n\r\n```nginx\r\nlocation ~ ^/api/(tmdb|bangumi|gh|leetcode|music) {\r\n    proxy_pass http://127.0.0.1:8000$request_uri;\r\n    proxy_set_header Host $host;\r\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\n    proxy_set_header X-Real-IP $proxy_add_x_forwarded_for;\r\n    proxy_set_header X-Forwarded-Host $server_name;\r\n    proxy_set_header Upgrade $http_upgrade;\r\n    proxy_set_header Connection \"upgrade\";\r\n    proxy_set_header X-Forwarded-Proto $scheme;\r\n}\r\n```\r\n\r\n请注意，Bangumi翻译需要修改Shiro的代码，参考下述commit。\r\n\r\nhttps://github.com/Do1e/Shiro/commit/73dd1f1567185abdb10df46988fdb79d24401031\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdo1e%2Fapicache4shiro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdo1e%2Fapicache4shiro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdo1e%2Fapicache4shiro/lists"}