zksbx/TuneFree
About
mflac / mgg 转 FLAC、MP3 — 解密 QQ音乐加密歌曲,全程本地、不上传
Security & PrivacyMeasured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.en.md
OriginalTuneFree
Turn the encrypted songs you downloaded in QQ Music (.mflac / .mgg) into MP3 or FLAC that any player can open.
No membership tricks, no uploading — everything happens on your own computer.
⬇️ Download latest · 🌐 Website & help · ☁️ Lanzou mirror (access code 0211) · 💬 QQ group: 1067975918 · 中文 README
🍎 macOS version: developed and maintained independently by Dora-z. It is not part of this repository and not a port of this code — it takes a different route: no process injection, the decryption algorithm runs natively and the key is fetched using the local QQ Music login. Downloads, issues and feedback live in that repo: https://github.com/Dora-z/TuneFree_Mac
What problem does it solve
Some tracks downloaded in QQ Music come in encrypted containers:
| Extension | What it really is | Typical case |
|---|---|---|
.mflac |
encrypted FLAC (lossless) |
lossless downloads |
.mgg |
encrypted OGG |
some licensed tracks |
Only QQ Music can play these. Copy one to a car stereo, an MP3 player or any other player and all you get is "unsupported format".
TuneFree does something simple: it calls QQ Music's own decryption function inside the running process, restores the file to a normal FLAC/OGG, then converts it to MP3 with FFmpeg.
.mflac / .mgg ──decrypt──▶ .flac / .ogg ──encode──▶ .mp3
Three steps
- Open QQ Music and log in, keep it running (you don't need to play anything)
- Double-click
TuneFree.exe, click the folder button on the left of the top bar and pick the folder holding your.mflacor.mggfiles (or just drag the folder onto the window) - Press Start converting, wait for the progress to finish, collect the
MP3s fromoutput\mp3(you get a dialog, and a system notification if you enabled it)
Output files keep the original names, so you can copy them straight onto a phone or car stereo.
Support the author
TuneFree is completely free — no ads, no feature gates, no paid tier. If it genuinely helped you, you can buy the author a milk tea:
No money is fine too — leave a star or tell someone who needs it. That helps just as much.
Is it a virus? Read this first
The previous release v2.0.0 shipped on 2026-06-30 and had been downloaded 3,660 times on Lanzou by 2026-10-31 (the counter comes from Lanzou's own backend — the author cannot edit it). Thousands of people have installed and used it; something genuinely malicious would not stay quiet that long.
Your antivirus will still complain, and that is expected: TuneFree injects code into the QQ Music process with Frida, which is exactly what malware does. The difference is that the entire source is public — you can read every line of what it does.
Features
- 🎵 Batch decryption of
.mflac/.mgg, walks subfolders automatically - 🎚
320kMP3 by default; keep the decrypted lossless files with one checkbox. Tick decrypt only to stop after restoring files (.mflac→FLAC,.mgg→OGG) - 🏷 Tags first: when a file carries
TITLE/ARTIST, they win over noisy file names - 🏷 Format pills tell you where each track stands:
MFLAC/MGGnot decrypted yet,FLAC/OGGdecrypted,MP3converted - 🗂 One-click filter pills (all / undecrypted /
MFLAC/MGG/FLAC/OGG/MP3) with live counts, plus an artist filter - 🎧 Double-click any row to preview it; the player bar shows cover art and two lyric lines. Click the cover or Immersive for a full-page player: cover and controls on the left, bilingual lyrics on the right
- 🔀 Pick which copy to play when a song has MP3 / FLAC / OGG versions, right from the player bar
- 🪟 Mini player: a small always-on-top window with lyrics and progress that remembers where you put it
- 📥 Drag and drop: drop a folder onto the window to start scanning
- ⌨️ Global media keys (play/pause, next, previous) plus a set of in-app shortcuts
- 🔔 Tray mode: closing the window keeps a conversion running in the background, with a notification when it is done
- 🎨 Light / dark built in, plus up to three custom colour schemes; UI and lyric font sizes are adjustable
- ⚡ Multi-threaded encoding + resume: an interrupted run skips what is already done
- 🔄 Update check with in-place upgrade that keeps your colours, font sizes and options; downloads come from GitHub, so use an accelerator first if it is slow
- 📖 Help works offline: Help and Support fall back to the bundled guide when there is no network
- 🔒 Offline: apart from the update check it contacts no server at all
Requirements
- Windows 10 / 11 (64-bit)
- QQ Music client (logged in — decryption borrows its key)
- Only the
Standard/HQ/SQquality tiers are supported. Tracks downloaded as Hi-Res (臻品音质), Master (臻品母带) or Dolby Atmos are not supported and will fail to decrypt.
FAQ
"Windows protected your PC" — a blue window blocks it from running
That is SmartScreen's "unknown publisher" warning, not a virus detection — an unsigned exe is blocked the first time, always.
Two ways out:
- Before unzipping (recommended): right-click the zip → Properties → tick Unblock at the bottom of the General tab → Apply, then unzip. The extracted files are no longer marked as "from the internet" and will never prompt again.
- Already unzipped: in the blue window click More info, then Run anyway at the bottom right. Once per file is enough.
The zip also ships a !首次运行请看.txt, but that file is only visible after unzipping, so it documents method 2 only (plus how to whitelist the app when antivirus blocks it).
My antivirus flags it as a virus
The app uses Frida to inject code into the QQ Music process — behaviour that looks exactly like malware, so most antivirus products will report it.
Fix: add the TuneFree folder to your antivirus trust list. The source is fully public, you can read every line.
"Please make sure the QQ Music client is running, then try again"
Open QQ Music and log in first, then hit start. Decryption borrows the key from the QQ Music process; without it there is no key.
invalid size or "QQ Music version mismatch"
QQ Music changed its internal function names, so the current build cannot inject into it.
- Downgrade QQ Music to a known-good version, or
- Wait for TuneFree to support the new release (watch Releases)
Decryption works, but every MP3 conversion fails
Usually security software is preventing ffmpeg.exe from creating files. The app automatically retries through "pipe output + write the file itself", which normally gets through.
If it still fails, add the TuneFree folder to your trust list.
A handful of songs simply won't convert
Check the quality tier first. Only Standard / HQ / SQ are supported; if a song was downloaded as Hi-Res (臻品音质), Master (臻品母带) or Dolby Atmos it carries no normal audio stream, so conversion always fails — re-download it at SQ or lower and retry.
If it is already Standard / HQ / SQ, some files need to be played once in QQ Music first so the full data lands in the local cache, then convert them.
Batch conversion errors out or stops after ~100 songs
QQ Music is a 32-bit process with roughly 4GB of address space. Up to 3.1.2 every decrypt allocated a whole song's worth of memory inside that process, so ~100 SQ files exhausted it — and the error that surfaced looked like a file or quality problem.
Since 3.1.3 decryption streams in 4MB chunks (read 4MB, write 4MB, reuse the buffer), so the footprint no longer scales with track size. The runner also probes free address space every ten tracks and pauses with a clear message before things go wrong.
If you see that message: fully quit QQ Music (right-click its tray icon and exit too) → reopen and sign in → hit Start again. Files already converted are skipped.
Mac / Linux support?
The Windows build is the only official release here — the QQ Music client it injects into exists only on Windows.
The macOS version is developed and maintained independently by Dora-z. It takes a different approach: no process injection, the decryption algorithm runs locally, and for the newer musicex files it reads the local QQ Music login and asks the official API for the per-song key. Source, builds and issue tracker:
👉 github.com/Dora-z/TuneFree_Mac
Linux is currently unmaintained.
Run from source
# 1. install dependencies
pip install -r requirements.txt
# 2. put ffmpeg.exe in this folder (the app looks for it here)
# Windows builds: https://www.gyan.dev/ffmpeg/builds/ (pick release essentials)
# 3. launch the GUI
python app.py
# or use the command line (app.py and main.py both work)
python app.py --cli -i "D:\downloads" -o "D:\music" -b 320k
python main.py -i "D:\downloads" -o "D:\music" -b 320k
Command-line options:
| Option | Description |
|---|---|
-i, --input |
input folder, defaults to the current folder |
-o, --output |
output folder, defaults to ./output |
--mp3-dir / --flac-dir |
set the MP3 / FLAC output locations separately |
-b, --bitrate |
MP3 bitrate, default 192k |
--keep-flac |
keep the decrypted FLAC |
--no-mp3 |
decrypt only, no encoding: .mflac → FLAC, .mgg → OGG (written to output/ogg by default) |
--force |
rebuild MP3s that already exist |
-v, --version |
print the version |
Project layout
app.py single entry point: GUI with no args, CLI with --cli
TuneFree.py main window and every custom-painted widget (PySide6)
miniplayer.py mini player window
hotkeys.py global media keys (low-level keyboard hook)
player.py playback wrapper around QMediaPlayer
lyrics.py lyric lookup, parsing and cache
main.py CLI / backend: inject, decrypt, encode
scanner.py scans the music folder, reads metadata, finds covers
metainfo.py FLAC / OGG / MP3 header parsing
coverart.py cover lookup in the QQ Music picture cache (falls back to online search)
converter.py ffmpeg encoding thread pool
session.py session / process-injection helpers
hook_qq_music.js Frida injection script (the decryption core)
version.py single source of truth for the version and repo URL
version.json update source for mainland users (served via jsDelivr)
TuneFree.spec PyInstaller spec (produces exactly one TuneFree.exe)
docs/ website (static single page, Chinese and English)
发版清单.md release checklist (Chinese)
Disclaimer
This tool is for personal study and interoperability only, used to decrypt music files you legitimately downloaded on this machine so you can play them on devices you own.
Do not redistribute, re-share or use it commercially. Any legal consequences are the user's own.
License
The code is released under the MIT License. Fork it, change it, build on it.
One reminder: MIT covers the code. It does not loosen the limits on how you may use it described in the disclaimer above.
Credits
- Frida — process injection
- FFmpeg — audio encoding
- music-decryptor — where the decryption script started
- Unlock Music — format parsing experience
- PyInstaller — packaging
- Dora-z/TuneFree_Mac — the macOS version, an independent implementation
- Ajing — reported the memory exhaustion after ~100 batch conversions, which led to chunked decryption in 3.1.3
- GuerGuaZhang — contributed the exit-code, file-name splitting, tag-priority and decrypt-only changes (PR #7/#8/#9/#10); 3.1.3 adopts the ideas
Support
- 🐛 Open an issue
- 💬 QQ group: 1067975918
- ☕ Afdian
Explore related projects
Loading…
