Skip to content

Instantly share code, notes, and snippets.

@devinschumacher
Last active October 15, 2025 08:42
Show Gist options
  • Save devinschumacher/849135d124379f0865f75e17db05f1d5 to your computer and use it in GitHub Desktop.
Save devinschumacher/849135d124379f0865f75e17db05f1d5 to your computer and use it in GitHub Desktop.
How to Download TikTok Audio

How to Download TikTok Audio (Music, Audio, etc.) from Videos

TikTok videos always contain both audio and video in a single MP4 file, but sometimes you just want the audio track — to save music, quotes, or background sounds.

Easy.

🎧 1. Extract Audio Only (MP3 Format)

If you want to save just the audio, use:

yt-dlp -x --audio-format mp3 "https://www.tiktok.com/@user/video/1234567890"

Flags explained:

• -x → extract only the audio track • --audio-format mp3 → convert to MP3 (you can also use m4a, opus, or wav)

✅ Result: you’ll get an MP3 file with the video’s sound only.

🎼 2. Keep the Original Audio (No Re-encode)

If you want to keep TikTok’s native audio without re-encoding:

yt-dlp -x --audio-format best "https://www.tiktok.com/@user/video/1234567890"

This preserves the original AAC or Opus audio track used by TikTok.

🪄 3. Add Metadata and Clean Filenames

To automatically name your files and embed metadata:

yt-dlp -x --audio-format mp3 --add-metadata -o "%(title)s.%(ext)s" "https://www.tiktok.com/@user/video/1234567890"
•	--add-metadata → embeds the creator and title into the file
•	-o "%(title)s.%(ext)s" → names the file after the TikTok’s title

⚡ 4. Extract Both Video and Audio (Optional)

If you want both formats, you can chain commands:

yt-dlp "URL" && yt-dlp -x --audio-format mp3 "URL"

This saves the full MP4 and the audio-only MP3 version together.

🧠 Notes

•	TikTok doesn’t provide separate audio files or transcripts.

Any captions or lyrics you see in the app are generated dynamically. • yt-dlp uses FFmpeg under the hood to demux and convert the audio. You don’t need to install or call FFmpeg manually — yt-dlp handles it.

✅ Want the Easy Way?

You can also extract TikTok audio online without touching the command line:

👉 TikTok Video Downloader — paste any TikTok link, and it’ll generate downloadable video and audio-only files automatically.

TL;DR:

Use yt-dlp -x --audio-format mp3 "URL" to pull audio from any TikTok — fast, simple, and watermark-free.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment