NetEase Lyrics Vocab
Use this skill to turn a NetEase Cloud Music playlist into a vocabulary study table.
Workflow
- Identify the playlist ID from the user's URL or numeric ID.
- Run
scripts/netease_lyrics_vocab.pyto fetch playlist tracks, fetch lyrics, tokenize English words, count frequency, and export the table. - Run
scripts/enrich_dictionary.pyto add built-in dictionary columns: phonetic, part of speech, Chinese meaning, Chinese explanation, English definition, root/affix, and memory note. - Inspect the generated table and fill or improve
meaning_zhandexplanation_zhfor important words. Prefer concise Chinese meanings in the lyric context. - When the user wants a learning interface, run
scripts/build_vocab_site.pyagainst the enriched CSV/XLSX table to generate a static HTML study site. - Return the output file path and summarize coverage: songs processed, lyrics found, unique words, generated table, generated site, and any failures.
Script
Run from the skill directory or pass the full script path:
python3 scripts/netease_lyrics_vocab.py "https://music.163.com/#/playlist?id=123456" --output vocab.csv
Useful options:
--format csv|xlsx: Force output format. Defaults from the output extension.--max-songs N: Limit songs for a quick sample.--min-count N: Keep only words that appear at least N times.--include-stopwords: Keep common function words such asthe,and,you.--define english: Try to add short English definitions from dictionaryapi.dev. Keepmeaning_zhfor Codex or the user to fill.
The script uses public NetEase web endpoints. These endpoints are unofficial and can change or rate-limit. If live fetching fails, ask the user for exported lyric files or a song list, then adapt the script input rather than inventing data.
Dictionary Enrichment
Add built-in dictionary fields to the table before building the site:
python3 scripts/enrich_dictionary.py vocab.xlsx --output vocab.enriched.xlsx
When regenerating a playlist table, preserve previously filled dictionary fields with:
python3 scripts/enrich_dictionary.py vocab.xlsx --previous old-vocab.enriched.xlsx --output vocab.enriched.xlsx
The enrichment script reads and writes CSV/XLSX. It uses a small built-in Chinese meaning map for common words, local root/affix rules, and public English dictionary lookup for phonetics, part of speech, and English definitions. Use --offline to skip public dictionary lookup.
For high-quality Chinese explanations and deeper etymology, use the enriched table as the base and let Codex or another model fill meaning_zh, explanation_zh, root_affix, and memory_note; the study page embeds the completed values and works offline.
Study Website
Generate a static learning page from a finished table:
python3 scripts/build_vocab_site.py vocab.xlsx --output vocab-study-site/index.html --title "歌词单词学习"
The generated page embeds the vocabulary and dictionary data and works as a local file. It provides:
- Search by word, meaning, definition, or song.
- Frequency filtering and known-word marking stored in browser local storage.
- Word cards with meaning, phonetic, part of speech, Chinese explanation, English definition, root/affix, memory note, source indexes, source examples, and songs.
- Browser speech synthesis buttons for the word and each example sentence. The page prefers English system voices and uses slower rates for clearer study playback.
- Deduplicated examples per word, so repeated lyric lines do not crowd the card while frequency counts remain complete.
For more natural voices, generate cached model-based MP3 files before building the page:
OPENAI_API_KEY=... python3 scripts/generate_tts_audio.py vocab.xlsx \
--site-dir vocab-study-site \
--voice cedar \
--include-examples \
--max-examples 3
python3 scripts/build_vocab_site.py vocab.xlsx \
--output vocab-study-site/index.html \
--audio-manifest vocab-study-site/audio_manifest.json
The page plays generated MP3 files first and falls back to browser speech synthesis if audio is missing. Show the AI-generated audio disclosure when sharing the page with others.
If the user asks for a shareable or portable result, return both the table and the generated index.html. Do not commit generated study pages unless the user explicitly wants examples stored in the repository.
Output Columns
See references/output-schema.md for column definitions. Preserve these columns unless the user requests a different layout:
word, count, phonetic, part_of_speech, meaning_zh, explanation_zh, definition_en, root_affix, memory_note, source_indexes, source_examples, source_songs, songs.
Meaning Rules
- Fill
meaning_zhwith compact Chinese meanings, not long dictionary entries. - Use the lyric context where possible, especially for slang, contractions, idioms, and phrasal verbs.
- Leave ambiguous words with multiple likely meanings separated by semicolons.
- Do not output full lyrics. Keep only short snippets already produced by the script.
Quality Checks
- Confirm the playlist ID and output path.
- Check that
countis sorted descending. - Spot-check several
source_indexes,source_examples, andsource_songsrows for one-to-one alignment. - Report songs with missing lyrics or failed fetches.