Bashige Blog

Download YouTube Videos as MP3s with OpenCode

A simple AI-agent workflow for focused listening, single downloads, and batch jobs

OpenCode AI Tools YouTube Audio

Why I Download Audio for Focused Listening

For a while now, I’ve preferred listening to the audio I’m interested in on an MP3 player. I also enjoy watching videos on YouTube, but when I browse video apps on my phone, I find it hard to stay focused. There is simply so much tempting content. Often, before I’ve finished one video, an enticing title nearby catches my eye and I click away. That is information noise. I want to focus, so I deliberately create an environment with fewer distractions: I download YouTube videos as video or audio files and play them on a separate player, away from my phone.

Let an AI Coding Agent Handle the Download

With help from an AI agent, downloading video or audio from YouTube and other platforms has become remarkably simple. The AI coding tool I use most often is OpenCode, an open-source AI agent that supports a range of capable language models, including some with free usage tiers. You can use another tool of this kind too; the general workflow is much the same.

Download a Single Video or Process a Batch

To download something with OpenCode, give it the link and ask: “Download this YouTube link as an MP4 or MP3 file.” It can then handle the task for you. If you have a batch of videos, first save their links in a plain-text file and give that file to OpenCode.

A text file containing a list of YouTube video links for batch processing
A plain-text list makes it easy to hand multiple links to the agent.
OpenCode prompt asking an AI coding agent to download YouTube links as MP3 audio
Ask OpenCode to download the links as MP3 audio.

When the task is complete, the MP3 files are saved in the folder you specified.

A Windows folder showing downloaded MP3 audio files
The resulting audio files, ready to play on a separate device.

A More Focused Alternative to Download Sites

Of course, search engines can turn up plenty of download websites. Many are crowded with pop-up ads, while others simply do not work. For the video or audio files I want, asking an AI coding agent to handle the task has been the most convenient approach for me.