Repository navigation
Import tracks from a saved page, for sites that block GAM (Pixabay) - #50
Merged
Merged
Conversation
Pixabay answers GAM's fetch with 403 and rules out automated access, so the person does the browser part: save the page, download the tracks, and hand both to GAM, which never contacts the site. - page_tracks.extract_saved reads only the uploaded page: its address from the canonical link, og:url or Chrome's saved-from comment; a Pixabay adapter over the rendered rows (title, artist, track page, duration, genre, tags, the listing's mood, and the track ID); and the existing adapters without the network for other saved pages. - match_files pairs downloads to tracks by the ID in the filename, then by longest contained title, one to one; mirrored in the browser so matches show before upload. - POST /api/assets/import-page/saved[/preview]: files stored as music (no transcription, analysis queued), page details on matched files, unmatched ones imported and reported, checksum duplicates not stored. - Add → "Or use a saved page" in the UI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DCL4jm6ogZBBhnjEfBBaXU
davior
marked this pull request as ready for review
October 27, 2026 03:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pixabay answers GAM's page fetch with a 403, and its terms rule out automated access. GAM does not disguise itself to get past that. Instead, the person does the part that needs a browser, and GAM never contacts the site:
Reading the saved page (
page_tracks.extract_saved, no network)Page address: read from the canonical link,
og:url, or Chrome's<!-- saved from url=… -->comment, because adapters key on host and path.Pixabay adapter: one rendered row per track. Class names carry build hashes (
audioRow--et3ac), so only their stable prefixes are matched. Each row gives:/mood/<x>/(or/genre/) applied to every track.On the real saved "mysterious" page, all 20 tracks extract with every field.
Other saved pages reuse the existing adapters without the network, so a saved Mixkit page works. A saved incompetech page says to use the link instead, because that page only points to
pieces.json.Matching (
page_tracks.match_files, mirrored inutils/matchFiles.ts)artist-title-604094.mp3.Importing (
page_import.import_saved)POST /api/assets/import-page/saved/previewandPOST /api/assets/import-page/savedare multipart and synchronous, like an upload.music, so it is never transcribed, and is queued for tempo/key/energy analysis.embedded.PageTrack.audio_urlis now optional, for saved pages with no audio link, andmatch_idis new. Akeyproperty replacesaudio_urlas the identity in the duplicate helpers. Live imports still require an audio URL.Testing
pytest -q: 1397 passed. The newtests/test_saved_page_import.py(its fixture is a hand-trimmed copy of the Pixabay row structure) covers:npm run format:check,npm run lint,npm test(429 passed, includingSavedPageImport.test.tsx) andnpm run buildall clean.Generated by Claude Code