Automatically assign Yoto playlist icons based on track titles using OpenAI Vision API and AI-powered semantic matching.
- π Plan Mode: Uses OpenAI Vision to map 352 Yoto icon IDs to semantic keywords
- π― Apply Mode: Intelligently assigns icons to playlist tracks with AI fallback
- π Report Mode: Analyzes missing icons and shows improvement potential
- π¨ Generate Mode: Creates custom icons for missing keywords (framework ready)
- π Multi-language: Full support for English and Hebrew with pure language synonyms
- π Smart Matching: Exact β Partial β AI semantic matching with 95%+ success rates
- π§ͺ Safe Testing: Dry-run mode to preview changes before applying
- β‘ Bulk Updates: Efficient API calls with proper rate limiting
# Step 1: Install dependencies and configure environment
npm install
export OPENAI_API_KEY="your_openai_api_key_here"
export BEARER="your_yoto_bearer_token_here"
# Step 2: Generate icon mappings from Yoto's existing icons
npm run plan -- --bearer $BEARER --language hebrew
# Step 3: Identify missing icons needed for your playlists
npm run report -- --bearer $BEARER --language hebrew
# Step 4: Generate missing icons with AI (saves to generated-icons/)
npm run generate -- --language hebrew --limit 10
# Step 5: MANUALLY upload generated icons to Yoto via web interface
# (See "Manual Upload Process" section below)
# Step 6: Update mappings with new icon IDs
# (See "Updating Mappings" section below)
# Step 7: Apply icons to your playlist
npm run apply -- --bearer $BEARER --playlist gkLcn --language hebrew --dry
npm run apply -- --bearer $BEARER --playlist gkLcn --language hebrewMaps Yoto icon IDs to semantic keywords using OpenAI Vision API.
# Generate English icon mappings
npm run plan -- --bearer $BEARER --language english
# Generate Hebrew icon mappings
npm run plan -- --bearer $BEARER --language hebrew
# Resume from specific index
npm run plan -- --bearer $BEARER --language hebrew --startFrom 100
# Process in smaller batches
npm run plan -- --bearer $BEARER --batchSize 5Output: data/yoto_icon_ids_hebrew.json / data/yoto_icon_ids.json
{
"ΧΧΧ": "yoto:#p_yLNC3TPtuo8MNv5WSG0q5aqTPD-WRRRWYkPB0cbjA",
"Χ¦ΧΧ€ΧΧ¨": "yoto:#pcGl9aZOfMwiNUm8Rfu4wRYPkBuDiEB5nwwy76aVtCM",
"Χ‘Χ€Χ¨": "yoto:#uiqaZz3Q_kM359pgiMaIkK-grc19uo4tRK5bSAMro7o"
}Intelligently matches track titles to icons using multi-layer matching strategy.
# Preview changes (recommended first step)
npm run apply -- --bearer $BEARER --playlist $CARD_ID --language hebrew --dry
# Apply icon updates
npm run apply -- --bearer $BEARER --playlist $CARD_ID --language hebrewMatching Strategy:
- β Exact matches: Direct keyword matches in track titles
- π‘ Partial matches: Fuzzy matching with synonyms and Hebrew prefix stripping
- π€ AI matches: OpenAI semantic matching for unmatched tracks
- π‘ Suggestions: Shows potential alternatives for manual review
- π Comprehensive stats: Detailed success rates and coverage analysis
Analyzes missing icons and prioritizes generation needs.
# Generate missing icons report
npm run report -- --bearer $BEARER --language hebrew
# Analyze specific playlist gaps
npm run report -- --bearer $BEARER --playlist $CARD_ID --language hebrewShows:
- π Current coverage statistics
- π₯ Priority missing icons by usage frequency
- π― Potential success rate improvements
Creates custom icons for missing keywords using DALL-E 3.
# Generate all missing icons (saves to generated-icons/)
npm run generate -- --language hebrew
# Generate specific icons only
npm run generate -- --keywords "ΧΧΧΧ,ΧΧ¨Χ§ΧΧΧ¨" --dry
# Generate with limit
npm run generate -- --language hebrew --limit 5Features:
- π¨ AI-powered icon generation using DALL-E 3
- π Saves icons to
generated-icons/directory - π§ͺ Dry-run testing support
- π Multi-language support (English/Hebrew)
- π― Custom keyword targeting
Note: Generated icons require manual upload through the Yoto web interface and manual mapping updates.
yoto-auto-icons/
βββ src/
β βββ plan.ts # Vision API mode - generates keyword mappings
β βββ apply.ts # Playlist update mode - assigns icons to tracks
β βββ matchIcon.ts # Multi-layer matching with AI fallback
β βββ yoto.ts # Yoto API integration with bulk updates
β βββ config.ts # Configuration & language handling
β βββ types.ts # TypeScript interfaces
βββ data/
β βββ yoto_icon_ids_hebrew.json # Hebrew icon mappings
β βββ yoto_icon_ids.json # English icon mappings
βββ synonyms/
β βββ english.json # English keyword synonyms
β βββ hebrew.json # Hebrew keyword synonyms
βββ icon_ids.txt # 352 Yoto icon IDs
βββ package.json # NPM scripts & dependencies
Maps keywords to arrays of synonyms for each language:
{
"dog": ["ΧΧΧ", "dog", "puppy"],
"moon": ["ΧΧ¨Χ", "moon", "ΧΧΧΧ"],
"music_notes": ["Χ©ΧΧ¨", "Χ©ΧΧ¨ΧΧ", "ΧΧΧΧΧ§Χ", "music", "song"]
}One icon ID per line (352 total):
3ZnJD74DawVPKntS3pIEpDlM57daHtDuczmf2JI_EBw
_WWpLHoOj6iqeREcGkJnGlsis2QSF6znM0UPFdXTjf8
...
- OpenAI Vision: 200ms delay between calls
- Yoto API: 100ms delay between track updates
- Batch Processing: Default 10 icons per batch (configurable)
- Resume Capability: Plan mode saves progress after each batch
- Graceful Failures: Continues processing even if individual icons fail
- Validation: Checks bearer token and playlist access before processing
# 1. Generate icon mappings from existing Yoto icons
npm run plan -- --bearer $BEARER --language hebrew
# 2. Check what icons are missing
npm run report -- --bearer $BEARER --language hebrew
# 3. Generate missing icons (saves to generated-icons/)
npm run generate -- --language hebrew --limit 10
# 4. Manually upload generated icons via Yoto web interface
# 5. Update mappings with new icon IDs (see Manual Upload Process below)
# 6. Preview playlist changes
npm run apply -- --bearer $BEARER --playlist gkLcn --language hebrew --dry
# 7. Apply changes
npm run apply -- --bearer $BEARER --playlist gkLcn --language hebrewSuccessfully processed Hebrew children's audiobook playlist (61 tracks) with 95% match rate:
π― Apply Mode - Playlist: gkLcn (Hebrew)
π LIVE MODE - Changes will be applied
π€ AI MATCHING - Using OpenAI for unmatched tracks
π Icon Mapping Status (Χ’ΧΧ¨ΧΧͺ):
Available keywords: 339
Mapped to icons: 223
Unmapped: 116
π΅ Fetching playlist...
β Found 61 tracks
π Analyzing tracks for icon matches...
β
"ΧΧ¦ΧΧ€ΧΧ¨ Χ©Χ©ΧΧΧ ΧΧ’ΧΧ£"
β Χ¦ΧΧ€ΧΧ¨ (yoto:#pcGl9aZOfMwiNUm8Rfu4wRYPkBuDiEB5nwwy76aVtCM)
π‘ "Χ¨ΧΧ Χ ΧΧ ΧΧΧ ΧΧΧΧ ΧΧ’Χ§Χ - Χ‘ΧΧ€ΧΧ¨ ΧΧΧΧΧΧ"
β ΧΧΧ (yoto:#p_yLNC3TPtuo8MNv5WSG0q5aqTPD-WRRRWYkPB0cbjA)
π€ "Χ’ΧΧ¨ ΧΧ§ΧΧ ΧΧΧΧ - Χ‘ΧΧ€ΧΧ¨ ΧΧͺΧΧ§ ΧΧΧΧΧΧ"
β Χ©ΧΧ§ΧΧΧ (yoto:#LCBoQM5qDDHBwPWdP1SM55hDvMu06-DRLod3Le5k1a0)
π Match Statistics:
Total tracks: 61
β
Exact matches: 26 (43%)
π‘ Partial matches: 32 (52%)
π€ AI matches: 0 (0%)
β No matches: 3 (5%)
π― Assignable: 58 (95%)
π― Bulk updating 42 tracks...
π¨ Successfully updated card
π Apply Mode completed!
β
Successfully updated: 42
β Failed: 0
π§ Work in Progress: This is an experimental tool under active development. Features may change and bugs may exist.
--dry flag first to preview changes. The authors are not responsible for any data loss or unexpected modifications.
π’ Third-Party Tool: This is an unofficial, community-created tool. It is not affiliated with, endorsed by, or supported by Yoto. All Yoto trademarks, API endpoints, and related intellectual property belong to Yoto.
π API Usage: You are responsible for your own API keys and bearer tokens. Ensure you comply with OpenAI and Yoto's terms of service.
π Rate Limits: The tool implements conservative rate limiting, but you are responsible for monitoring your API usage and costs.
- Node.js 16+
- TypeScript 5+
- OpenAI API key (for Plan Mode and Generate Mode)
- Yoto bearer token (for Plan and Apply modes)
Currently, generated icons must be manually uploaded through the Yoto web interface due to OAuth authentication complexities. Future improvements could include:
- Direct Cloud Storage: Upload generated icons to a public cloud storage (AWS S3, Google Cloud Storage) with automatic URL generation
- Image Hosting Integration: Integration with image hosting services (Imgur, Cloudinary) for direct sharing
- OAuth Integration: Proper OAuth Device Code Flow implementation for direct Yoto API uploads
- Web Interface: Simple web UI for drag-and-drop icon upload and mapping management
These enhancements would eliminate the manual upload step and provide a fully automated icon generation and assignment workflow.
No icon mappings available:
# Run plan mode first
npm run plan -- --bearer $BEARER --language englishInvalid playlist error:
- Check bearer token is valid
- Verify playlist/card ID is correct
- Ensure you have access to the playlist