Problem
When configuring NetEase Cloud Music via cliamp setup on Windows, validation fails with:
netease: validation: netease: load browser cookies: ERROR: Failed to decrypt with DPAPI.
See https://github.com/yt-dlp/yt-dlp/issues/10927 for more info
This is a known yt-dlp bug (yt-dlp#10927) where --cookies-from-browser fails on Windows due to DPAPI decryption issues. The issue is still open with no fix available.
Currently, the NetEase provider only supports cookies_from (browser name), which maps to yt-dlp --cookies-from-browser. There is no way to use a pre-exported cookies file.
Proposed solution
Add a cookies_file config option as an alternative to cookies_from. When set, the provider reads cookies directly from the Netscape-format file instead of calling yt-dlp --cookies-from-browser.
This serves as a workaround for the yt-dlp DPAPI issue on Windows, and is also useful for headless/CI environments where no browser is available.
[netease]
enabled = true
cookies_file = "/path/to/cookies.txt"
user_id = "your-account-user-id"
Verified implementation
I have built and tested a working implementation locally. The changes are minimal:
- config/config.go — add
CookiesFile field to NetEaseConfig, parse cookies_file key
- external/netease/provider.go — add
cookiesFile to Config and Provider; in ensureCookieHeader, read directly from file when cookiesFile is set, bypassing yt-dlp
- resolve/resolve.go — add
SetYTDLCookiesFile function
- player/ytdl.go — add
SetYTDLCookiesFile, pass --cookies <file> to yt-dlp instead of --cookies-from-browser
- main.go — wire
CookiesFile from config to provider and player
Tested on Windows 11 with a valid cookies.txt containing MUSIC_U — NetEase provider loads correctly, playlists display, and VIP playback works at full quality (lossless 797kbps).
Workaround attempted before this change
- Closing Chrome completely (including background processes) — still fails
- Exporting cookies.txt via browser extension — cliamp ignores it, still calls
--cookies-from-browser
Environment
- cliamp: v1.57.0
- yt-dlp: 2026.06.09
- OS: Windows 11 Pro
Problem
When configuring NetEase Cloud Music via
cliamp setupon Windows, validation fails with:This is a known yt-dlp bug (yt-dlp#10927) where
--cookies-from-browserfails on Windows due to DPAPI decryption issues. The issue is still open with no fix available.Currently, the NetEase provider only supports
cookies_from(browser name), which maps to yt-dlp--cookies-from-browser. There is no way to use a pre-exported cookies file.Proposed solution
Add a
cookies_fileconfig option as an alternative tocookies_from. When set, the provider reads cookies directly from the Netscape-format file instead of calling yt-dlp--cookies-from-browser.This serves as a workaround for the yt-dlp DPAPI issue on Windows, and is also useful for headless/CI environments where no browser is available.
Verified implementation
I have built and tested a working implementation locally. The changes are minimal:
CookiesFilefield toNetEaseConfig, parsecookies_filekeycookiesFiletoConfigandProvider; inensureCookieHeader, read directly from file whencookiesFileis set, bypassing yt-dlpSetYTDLCookiesFilefunctionSetYTDLCookiesFile, pass--cookies <file>to yt-dlp instead of--cookies-from-browserCookiesFilefrom config to provider and playerTested on Windows 11 with a valid cookies.txt containing
MUSIC_U— NetEase provider loads correctly, playlists display, and VIP playback works at full quality (lossless 797kbps).Workaround attempted before this change
--cookies-from-browserEnvironment