# 批量音乐下载器 **Repository Path**: honghuang-xiandi/bulk-music-downloader ## Basic Information - **Project Name**: 批量音乐下载器 - **Description**: 开源音乐软件listen1 + 网易云的公开音乐API + eyed3对MP3音乐文件ID3.2加入信息标签(歌名、歌手、专辑名、音乐风格、歌词、) - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 12 - **Forks**: 3 - **Created**: 2023-02-04 - **Last Updated**: 2025-06-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 批量音乐下载器 ## 洪荒仙帝 #### 介绍 开源项目地址:[洪荒仙帝 / 批量音乐下载器](https://gitee.com/honghuang-xiandi/bulk-music-downloader) [开源音乐软件listen1](https://listen1.github.io/listen1/) + 网易云的公开音乐API + [eyed3](https://eyed3.readthedocs.io/en/latest/)对MP3音乐文件ID3.2加入信息标签(歌名、歌手、专辑名、音乐风格、歌词、) #### 软件架构 listen1 + requests + eyed3 #### 安装教程 1. [listen1](https://listen1.github.io/listen1/) https://listen1.github.io/listen1/ 在listen1主页,点击**下载Windows桌面版安装包**。下载时间较长,请耐心等待。 ![listen1主页](/source/listen1主页.png) 2. 在**本电脑 -> 快速访问 -> Downloads -> listen1_*_win.exe**的文件,双击进行安装。 ![下载的安装包](/source/下载安装包.png) 安装界面,默认安装路径,点击安装 ![安装界面](/source/安装界面.png) 正在安装 ![正在安装](/source/正在安装.png) 完成安装 ![完成安装](/source/完成安装.png) 3. git或者zip download本开源项目并解压。 ![gitee项目网页](/source/gitee项目.png) 4. 在本项目目录下,按住``Shift``并单击右键,选择**在此处打开Powershell窗口(S)**,打开命令行窗口。 在此处打开Powershell窗口(S) ![在此处打开Powershell窗口(S)](/source/打开Powershell窗口.png) Powershell窗口 ![Powershell窗口](/source/Powershell窗口.png) 5. 如果是**conda**,复制``conda create -n music python==3.10.0``并回车,并且复制``conda activate music``回车,进入**music虚拟环境**。 music虚拟环境 ![music虚拟环境](/source/music虚拟环境.png) 6. 安装第三方包``pip install -r requirement.txt``回车,第三方包安装成功。 安装第三方包 ![安装第三方包](/source/安装第三方包.png) #### 使用说明 1. listen1中选择喜欢的歌单,点击**添加到我的歌单**,添加的歌单要在**创建的歌单**列表下。(最好是**网易云**) ![喜欢的歌单](/source/喜欢的歌单.png) 2. listen1的设置中,备份歌单,导出到本地文件,即**listen1_backup.json**文件,并移动到项目同一目录下。 ![导出歌单](/source/导出歌单.png) 项目目录下的**listen1_backup.json**文件 ![项目目录下的**listen1_backup.json**文件](/source/listen1_backup文件.png) 3. 复制``python main.py``回车,选择需要批量下载的歌单,确定(y/Y/回车),取消(n/N/其他),等待下载成功。 ![下载歌单](/source/下载歌单.png) 4. 下载成功。 ![成功下载歌单](/source/成功下载歌单.png) #### 参考 ##### 网易云API 1. mp3文件下载链接mp3_url: f"http://music.163.com/song/media/outer/url?id={id}.mp3" id=网易云对音乐的唯一标识符 2. 歌词信息下载链接lyric_url: f"http://music.163.com/api/song/media?id={id}" id=网易云对音乐的唯一标识符 ##### eyed3 MP3的ID3.2标签格式 # 加载MP3文件路径 audio = eyed3.load(path) if audio is None: return if not audio.tag: # 初始化标签 audio.initTag(version=(2, 3, 0)) # 歌名、歌手、专辑、风格、歌词等等 audio.tag.artist = "Behemoth" audio.tag.album = "The Satanist" audio.tag.album_artist = "Various Artists" audio.tag.genre = "Black Metal" audio.tag.recording_date = 2014 audio.tag.track_num = 4 audio.tag.title = "Ora pro nobis Lucifer" audio.tag.lyrics.set(u"[04:35.488]爱人就错过") audio.tag.lyrics[0].text # 导入封面 with open(cover_art_filename, "rb") as cover_art: audio.tag.images.set(3, cover_art.read(), "image/jpeg") audio.tag.save() **参考文章** 1. https://eyed3.readthedocs.io/en/latest/ 2. https://www.coder.work/article/2431296 3. https://www.coder.work/article/2384398 4. https://cloud.tencent.com/developer/ask/sof/101797941 5. https://www.haotian22.top/fd65a8a5.html 6. https://stackoverflow.com/questions/18916127/changing-lyrics-in-an-mp3-file-via-eyed3 7. https://stackoverflow.com/questions/16182094/retrieve-lyrics-from-an-mp3-file-in-python-using-eyed3 8. https://the-codeslinger.com/2021/03/07/write-id3-mp3-tags-cover-art-with-python-and-eyed3/