{"id":21847682,"url":"https://github.com/aoirint/lastfm_api_middleware","last_synced_at":"2026-04-05T22:04:09.735Z","repository":{"id":113789178,"uuid":"575210283","full_name":"aoirint/lastfm_api_middleware","owner":"aoirint","description":"Middleware API server to proxy and cache Last.fm API","archived":false,"fork":false,"pushed_at":"2024-07-09T23:35:10.000Z","size":211,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-15T01:34:47.866Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://lastfm-api-middleware.aoirint.com/docs","language":"Python","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/aoirint.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":"2022-12-07T01:57:58.000Z","updated_at":"2024-07-09T23:35:13.000Z","dependencies_parsed_at":"2024-04-12T11:10:12.874Z","dependency_job_id":null,"html_url":"https://github.com/aoirint/lastfm_api_middleware","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoirint%2Flastfm_api_middleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoirint%2Flastfm_api_middleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoirint%2Flastfm_api_middleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoirint%2Flastfm_api_middleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aoirint","download_url":"https://codeload.github.com/aoirint/lastfm_api_middleware/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244835574,"owners_count":20518263,"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-27T23:19:05.116Z","updated_at":"2025-12-30T23:56:52.389Z","avatar_url":"https://github.com/aoirint.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lastfm_api_middleware\n\n[Last.fm](https://www.last.fm/)からユーザのScrobble情報を取得して結果を返すAPIサーバ。個人サイトなどに自分のScrobble情報を表示するために使うことを想定しています。\n\n## 機能\n\n### 対応サービス\n\n- [Last.fm](https://www.last.fm/)\n\n1ユーザのみ、データ取得できます。\n複数のユーザからデータを取得したい場合、必要な数のAPIサーバを起動してください（各サービスに過剰なアクセスが発生しないように注意してください）。\n\n### キャッシュ\n\nAPIサーバから各サービスに過剰なアクセスが発生しないように、取得結果を1分間キャッシュします。キャッシュ間隔の間に再度APIサーバへのリクエストがあった場合、キャッシュした内容を返します。\n\n## リリース\n\nソースコードおよびDockerイメージを配布しています。\n\n- [GitHub](https://github.com/aoirint/lastfm_api_middleware)\n- [Docker Hub](https://hub.docker.com/r/aoirint/lastfm_api_middleware)\n\n## デプロイ手順\n\nDocker Composeおよびリバースプロキシを使ったデプロイを想定しています。\n\n### 1. 永続化ディレクトリを作成\n\n永続化のため、`UID=2000`、`GID=2000`のデータディレクトリを作成します（Docker Volumeで代用可）。\n\n```shell\nmkdir -p data\nsudo chown -R 2000:2000 data\n```\n\n### 2. .envファイルを作成\n\n`template.env`を`.env`としてコピーして、設定します。設定項目については、[設定](#設定)の項目を参照してください。\n\n### 3. Docker Composeサービスを起動\n\n`docker-compose.yml`をコピーして、以下のコマンドを実行します。\n\n```shell\nsudo docker compose up -d\n```\n\n### 4. リバースプロキシを設定\n\n必要に応じて、nginxやcloudflaredを設定してください。\n\n## （開発者向け）開発環境\n\n- Python 3.11\n- Docker Engine 23.0+\n\n## （開発者向け）実行手順\n\n### 1. 永続化ディレクトリを作成\n\n永続化のため、`UID=2000`、`GID=2000`のデータディレクトリを作成します（Docker Volumeで代用可）。\n\n```shell\nmkdir -p data\nsudo chown -R 2000:2000 data\n```\n\n### 2. .envファイルを作成\n\n`template.env`を`.env`としてコピーして、設定します。設定項目については、[設定](#設定)の項目を参照してください。\n\n### 3. Dockerイメージをビルド\n\n```shell\nsudo docker build -t aoirint/lastfm_api_middleware .\n```\n\n### 4. Dockerイメージを実行\n\n```shell\nsudo docker run --rm --init --env-file \"./.env\" -v \"./data:/data\" -p \"127.0.0.1:8000:8000\" aoirint/lastfm_api_middleware\n```\n\n## 設定\n\n環境変数または`.env`ファイルで設定します。\n\n|項目|詳細|\n|:--|:--|\n|LASTFM_USER|Last.fmのユーザ名（username）|\n|LASTFM_API_KEY|Last.fm APIのAPIキー|\n|DUMP_PATH|キャッシュの保存先（JSONファイルのパス）|\n|CORS_ALLOW_ORIGINS|CORSを許可するオリジンのリスト（カンマ区切り）|\n|HOST_DATA_DIR|（Docker Composeの場合のみ）ホスト側からコンテナにマウントするデータディレクトリのパス|\n|HOST_PORT|（Docker Composeの場合のみ）ホスト側にバインドするAPIサーバのTCPポート番号|\n\n## （開発者向け） ライブラリ管理\n\nライブラリ管理には[Poetry](https://python-poetry.org/docs/#installation)を使っています。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faoirint%2Flastfm_api_middleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faoirint%2Flastfm_api_middleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faoirint%2Flastfm_api_middleware/lists"}