explaingit

sophomoresty/qmdec

20PythonAudience · generalComplexity · 2/5Setup · moderate

TLDR

A Windows command-line tool that decrypts QQ Music's proprietary encrypted song files (.mflac/.mgg) into standard FLAC or OGG audio files you can play anywhere.

Mindmap

mindmap
  root((qmdec))
    What it does
      Decrypts QQ Music files
      Converts to FLAC or OGG
      Embeds song metadata
    How it works
      Reads session from memory
      Fetches decryption keys
      RC4-based decryption
    Use Cases
      Personal music library
      Offline playback
      Cross-device transfer
    Tech Stack
      Python
      Windows API
      QQ Music API
    Setup
      Standalone EXE
      pip install option
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Convert your QQ Music VIP downloads to standard FLAC files so you can play them in any music player.

USE CASE 2

Pre-fetch decryption keys for an entire folder of songs to enable offline decryption later.

USE CASE 3

Copy cached decryption keys to another computer that does not have QQ Music installed.

Tech stack

PythonWindows APIRC4 encryptionQQ Music API

Getting it running

Difficulty · moderate Time to first run · 30min

Requires a VIP subscription to QQ Music and a Windows machine with QQ Music running for initial authentication.

No license information was mentioned in the explanation.

In plain English

qmdec is a command-line tool for Windows that converts the encrypted music files downloaded by QQ Music (a Chinese music streaming service) into standard audio files you can play in any music player. When QQ Music's VIP subscribers download songs, the files are saved in proprietary encrypted formats (.mflac and .mgg) that only play inside the QQ Music app itself. This tool decrypts those files and converts them to standard FLAC or OGG audio, and it also fetches and writes the song's title, artist, album, and cover art into the output file automatically. The tool works in three steps. First, you run an authentication command while QQ Music is open and logged in. The tool reads the session credential directly from QQ Music's running process memory using a standard Windows system call, so there is nothing to copy or paste manually. Second, that credential is used to contact QQ Music's API to retrieve the decryption key for each song file. Those keys are saved locally. Third, the files are decrypted using the same RC4-based cipher that QQ Music uses internally. Once the decryption keys are cached locally, you can decrypt files without an internet connection and without QQ Music running. The cached keys do not expire, so they can also be copied to another computer that does not have QQ Music installed. A separate cache-keys command lets you pre-fetch keys for an entire folder at once. Installation is either a standalone Windows executable (no Python required) or a pip package for Python 3.10 and above. The README is bilingual, with the full documentation available in both English and Chinese. A VIP subscription to QQ Music is required to use the tool, because the encrypted files themselves are only available to paying subscribers and the decryption key API checks for VIP status.

Copy-paste prompts

Prompt 1
I have .mflac files from QQ Music. Using qmdec, write me the exact commands to authenticate, cache keys for a folder, and then decrypt all files in that folder to FLAC.
Prompt 2
How does qmdec read the QQ Music session credential from process memory on Windows? Explain what Windows API call it uses and why this is safer than manual copy-paste.
Prompt 3
I want to script qmdec to automatically decrypt all new .mflac files dropped into a folder. Write a Python or batch script that watches the folder and runs qmdec on new files.
Prompt 4
How do I install qmdec as a pip package on Python 3.10 and set it up to convert QQ Music downloads to OGG format?
Open on GitHub → Explain another repo

← sophomoresty on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.