如何快速上手 spotDL:3 条命令跑通 Spotify 歌单下载的完整指南
【免费下载链接】spotify-downloaderDownload your Spotify playlists and songs along with album art and metadata (from YouTube if a match is found).项目地址: https://gitcode.com/GitHub_Trending/sp/spotify-downloader
Spotify 里没有下载离线音乐的入口,你想把喜欢的歌单存到本地,只能一首一首手动找音源、改名、补封面。spotDL 就是干这件事的:它读你的 Spotify 链接,自动去 YouTube 匹配对应歌曲,下载后把封面、歌手、歌词、元数据一并写进文件。
安装 spotDL:一条命令加两个依赖
前提:系统里装了 Python 3.10–3.14 并加入了 PATH(Windows 安装时勾选 "Add to PATH")。打开终端,运行:
pip install spotdl spotdl --download-ffmpeg spotdl --download-denopip install spotdl:安装本体spotdl --download-ffmpeg:FFmpeg 是转码必需依赖,这条命令直接装到 spotDL 目录,不用管系统环境spotdl --download-deno:没有它,部分视频(包括标记 "made for kids" 的)会报YT-DLP download error
macOS / Linux 上把pip换成pip3即可。装完运行spotdl --version能打印版本号,说明安装成功。
第一次下载:单曲、歌单和按名字搜
下载命令统一是spotdl download <查询>,查询可以是链接,也可以是文字。
| 你想下载什么 | 命令 |
|---|---|
| 单曲 | spotdl download https://open.spotify.com/track/xxx |
| 专辑 | spotdl download https://open.spotify.com/album/xxx |
| 整个歌单 | spotdl download https://open.spotify.com/playlist/xxx |
| 歌手全部歌曲 | spotdl download https://open.spotify.com/artist/xxx |
| 按名字搜 | spotdl download 'The Weeknd - Blinding Lights' |
| 按名字搜专辑/歌单 | spotdl download 'album:专辑名'或'playlist:歌单名' |
几个容易忽略的点:
- 文件下载到你运行命令时所在的目录,想存到哪个文件夹,就先在那个目录打开终端
- 多个任务可以一条命令排队:
spotdl download '歌名1' 歌单链接 '歌名2' - 下载你点过赞的全部歌曲:
spotdl download saved --user-auth
比特率和音频格式怎么选
默认输出 MP3,128 kbps,兼容性最好,绝大多数场景选它就够了。
- 有 YouTube Music Premium 的话,音质上限是 256 kbps:在 YouTube Music 设置里把音质调到最高,导出
cookies.txt后加--cookie-file cookies.txt,并把格式换成 M4A 或 OPUS - 普通用户没有会员时,源音质就是 128 kbps,此时
--bitrate 320k只会让文件变大,音质不会提升,不建议用 - 想让 M4A/OPUS 保留源文件原样不转码:
--bitrate disable
支持--format的格式有 mp3、flac、ogg、opus、m4a、wav。日常使用推荐 MP3;想留个无损备份就用 flac。参数说明见 docs/usage.md。
让本地库跟着歌单更新:spotdl sync
歌单是会变的:你加歌、删歌,本地文件夹不会自动跟。sync 操作解决这个:先建一个同步档案,之后一条命令对齐差异——新增的歌下载下来,被删掉的歌从本地移除。
# 第一步:创建同步档案 spotdl sync https://open.spotify.com/playlist/xxx --save-file mylist.spotdl # 以后每次同步,只跑这一条 spotdl sync mylist.spotdl如果不想删掉本地已有的歌,加--sync-without-deleting。文件名必须以.spotdl结尾。
不想敲命令?用网页界面
spotdl web浏览器里直接搜索、点下载,不用记任何参数:
注意两点:网页界面目前只支持单曲下载,整歌单还是走命令行;它默认存到独立目录,想跟随--output指定的目录,加--web-use-output-dir。
卡住了先看这里
| 现象 | 处理 |
|---|---|
'spotdl' is not recognized/command not found | Python 的 Scripts 目录没进 PATH;重装 Python 并勾选 Add to PATH,或在~/.bashrc加export PATH=~/.local/bin:$PATH |
AudioProviderError: YT-DLP download error | 缺 Deno,跑spotdl --download-deno |
KeyError: 'header' | pip install -U ytmusicapi,不行就pip install -U --force spotdl |
| 下载到的歌不对 | 检查查询是否加了引号;换更完整的 "歌手 - 歌名" 写法 |
更多错误对照见 docs/troubleshooting.md。
下一步:复制你 Spotify 里最常用的那个歌单链接,打开终端,运行spotdl download 你的歌单链接。跑通之后,把它换掉,换成spotdl sync 你的歌单链接 --save-file 歌单名.spotdl,之后这条歌单就再也不用你手动维护了。
【免费下载链接】spotify-downloaderDownload your Spotify playlists and songs along with album art and metadata (from YouTube if a match is found).项目地址: https://gitcode.com/GitHub_Trending/sp/spotify-downloader
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考