tools.auto_cover module

S.N.E.S. Auto-Cover Pipeline.

Full cover pipeline: YouTube rip -> lyrics lookup -> Suno cover. The LLM handles lyrics rewriting via the GAME ACTION injection. # 💀🔥 CORRUPTED COVER FREQUENCY PIPELINE

async tools.auto_cover.run(youtube_url, song_info, style='', custom_themes='', rewritten_lyrics='', save_as='', ctx=None)[source]

Run the auto-cover pipeline up to the point the LLM takes over.

Entry point for the auto_cover tool. It orchestrates the three helper stages – rip the YouTube audio (_rip_youtube_audio), upload it to Discord for a fetchable URL (_upload_to_discord, deleting the temp mp3 and its directory immediately after), and look up the original lyrics (_lookup_lyrics) – then assembles a phase-tagged instruction payload rather than calling Suno itself. This is the GAME ACTION injection hand-off described in the module: the LLM reads the returned instruction and is expected to rewrite (or write) lyrics with Stargazer themes and then call generate_suno_music with the captured audio_url and style. The chosen phase is ready_for_suno when rewritten_lyrics is already supplied, rewrite_lyrics when originals were found, or write_original when no lyrics could be located. Touches the filesystem (temp files), the network (via the helpers), and the Discord channel through ctx.adapter.

Dispatched by the tool loader as the run handler for the auto_cover tool (the single-tool TOOL_NAME/run convention); it is not called directly anywhere in the repo.

Parameters:
  • youtube_url (str) – The YouTube link to rip and cover.

  • song_info (str) – Title - Artist string used for the lyrics lookup and in the generated Suno title.

  • style (str) – Optional style override; defaults to the S.N.E.S. DEFAULT_STYLE preset when empty.

  • custom_themes (str) – Optional extra theme notes appended to the rewrite instructions.

  • rewritten_lyrics (str) – Pre-rewritten lyrics; when present the rewrite step is skipped and the phase jumps straight to Suno.

  • save_as (str) – Optional name under which to save the resulting cover as a game asset; echoed back in the payload.

  • ctx (ToolContext | None) – The ToolContext supplying the channel ID and platform adapter.

Return type:

str

Returns:

A JSON string describing the pipeline result – the phase, the audio_url, the resolved style, and an instruction for the next LLM step – or a JSON error object if the context is missing or a stage failed.