maoty is a small Astro site that surfaces albums worth tracking. The homepage is built from generated JSON data and is intended to be refreshed from external music sources.
- Astro frontend in
src/pages/index.astro - Generated album dataset in
src/data/album-list.json - Album aggregation script in
scripts/build_album_data.py - Last.fm library scraper in
scripts/scrape_lastfm_library.py
Install dependencies:
bun installStart the Astro dev server:
bun run devBuild the production site:
bun run buildPreview the production build:
bun run previewThe site reads album entries from src/data/album-list.json.
To refresh that file:
bun run albumsscripts/build_album_data.py currently does all of the following:
- reads the Last.fm export at
output/mameli_mixtape_first50_artists_with_tags.json - derives a tag profile summary and writes
output/mameli_mixtape_tags_browse.md - opens Album of the Year pages, collects album metadata, and merges the result into
src/data/album-list.json
The album build is not fully self-contained. It expects:
python3playwright-cliavailable onPATH- a usable Playwright session/profile for Album of the Year scraping
- the Apple Music helper script at
$HOME/.codex/skills/apple-music-album-linker/scripts/find_apple_music_album.py - the Last.fm export file at
output/mameli_mixtape_first50_artists_with_tags.json
If any of those are missing, scripts/build_album_data.py will fail early.
scripts/build_album_data.py is hard-coded to use:
- session name:
aoty - profile directory:
.playwright/aoty-profile
Create that session once from the repo root:
playwright-cli -s=aoty open about:blank --headed --persistent --profile .playwright/aoty-profileWhat this does:
-s=aotygives the browser session the exact name the script expects--persistentstores cookies and browser storage on disk instead of keeping them only in memory--profile .playwright/aoty-profilekeeps that persistent profile inside this repo--headedopens a visible browser so you can complete any login or Cloudflare challenge manually
Recommended first-run flow:
- Run the command above.
- In the opened browser, visit Album of the Year and complete any login or anti-bot challenge if needed.
- Leave the browser open and run
bun run albums, or close it and reuse the saved profile later.
Useful session commands:
playwright-cli list
playwright-cli -s=aoty open about:blank --headed --persistent --profile .playwright/aoty-profile
playwright-cli -s=aoty closeNotes:
- The script checks whether the
aotysession is already open and will attach to it if available. - If the session is closed, the saved profile at
.playwright/aoty-profileis what preserves cookies between runs. - If Album of the Year starts returning
Just a moment..., reopen the sameaotysession headed and refresh manually before rerunning the build.
Use the standalone scraper to create or refresh the Last.fm export:
python3 scripts/scrape_lastfm_library.py \
"https://www.last.fm/user/<user>/library/artists" \
--output-base output/lastfm_library_artists_with_tagsUseful flags:
--workerscontrols concurrent artist tag requests--max-pageslimits how many library pages are scraped--max-artistscaps the total number of artists written
The scraper writes both CSV and JSON outputs.