Convert Figma logo to code with AI

atlas-comstock logoNeteaseCloudMusicFlac

根据网易云音乐的歌单, 下载flac无损音乐到本地. Download the FLAC music from Internet according to your NeteaseCloudMusic playlist.

2,997
557
2,997
25

Top Related Projects

根据网易云音乐的歌单, 下载flac无损音乐到本地. Download the FLAC music from Internet according to your NeteaseCloudMusic playlist.

网易云音乐 Node.js API service

网易云音乐命令行版本

one for all free music in china (chrome extension, also works for firefox)

高颜值的第三方网易云播放器,支持 Windows / macOS / Linux :electron:

Salt Player for Android Release, Feedback

Quick Overview

NeteaseCloudMusicFlac is a Python script that allows users to download high-quality FLAC music files from NetEase Cloud Music. It searches for and retrieves FLAC versions of songs in a user's playlist, providing a convenient way to obtain lossless audio files from the popular Chinese music streaming service.

Pros

  • Enables users to download high-quality FLAC files from NetEase Cloud Music
  • Supports batch downloading of entire playlists
  • Provides a simple command-line interface for easy use
  • Automatically creates organized folders for downloaded music

Cons

  • May potentially violate NetEase Cloud Music's terms of service
  • Limited to NetEase Cloud Music platform only
  • Requires users to have their own NetEase Cloud Music account
  • Depends on the availability of FLAC versions for requested songs

Code Examples

  1. Importing required modules and setting up the script:
import requests
import json
import os
import sys
import urllib.request
import urllib.error
import time
  1. Fetching song details from NetEase Cloud Music API:
def get_song_info(music_id):
    url = "http://music.163.com/api/song/detail/?id={}&ids=[{}]".format(music_id, music_id)
    response = requests.get(url)
    song_js = response.json()
    return song_js['songs'][0]
  1. Downloading FLAC files:
def download_file(song_info, download_url):
    file_name = "{} - {}.flac".format(song_info['name'], song_info['artists'][0]['name'])
    print("Downloading: {}".format(file_name))
    
    try:
        urllib.request.urlretrieve(download_url, file_name)
        print("Downloaded successfully!")
    except urllib.error.URLError as e:
        print("Download failed!")

Getting Started

  1. Clone the repository:

    git clone https://github.com/atlas-comstock/NeteaseCloudMusicFlac.git
    
  2. Install required dependencies:

    pip install requests
    
  3. Run the script with your NetEase Cloud Music playlist ID:

    python main.py <playlist_id>
    

Replace <playlist_id> with the actual ID of your NetEase Cloud Music playlist. The script will then download available FLAC files from the specified playlist.

Competitor Comparisons

根据网易云音乐的歌单, 下载flac无损音乐到本地. Download the FLAC music from Internet according to your NeteaseCloudMusic playlist.

Pros of NeteaseCloudMusicFlac

  • Identical functionality and features as both repositories are the same project
  • Consistent codebase and implementation across both repositories

Cons of NeteaseCloudMusicFlac

  • No unique advantages or improvements over the other repository
  • Potential confusion for users due to duplicate repositories with the same name

Code Comparison

Both repositories contain identical code, so there are no differences to highlight. Here's a sample of the main functionality from both:

def main():
    username = input("请输入用户名:")
    password = input("请输入密码:")
    user = User(username, password)
    user.download_songs()

This code snippet demonstrates the core functionality of logging in and downloading songs, which is consistent across both repositories.

网易云音乐 Node.js API service

Pros of NeteaseCloudMusicApi

  • More comprehensive API coverage for Netease Cloud Music features
  • Better documentation and examples for developers
  • Actively maintained with frequent updates

Cons of NeteaseCloudMusicApi

  • Focuses on API functionality rather than direct music downloading
  • May require more setup and configuration for specific use cases

Code Comparison

NeteaseCloudMusicApi:

const { login_cellphone, user_playlist } = require('NeteaseCloudMusicApi')

login_cellphone({
  phone: '手机号',
  password: '密码'
}).then(result => {
  console.log(result)
  user_playlist({
    uid: result.body.account.id
  }).then(data => {
    console.log(data)
  })
})

NeteaseCloudMusicFlac:

import requests
import json

url = 'http://music.163.com/api/playlist/detail?id=' + playlist_id
response = requests.get(url)
data = json.loads(response.text)

NeteaseCloudMusicApi provides a more structured approach with dedicated functions for different API endpoints, while NeteaseCloudMusicFlac uses simpler HTTP requests to fetch data. The former offers a more comprehensive set of features, while the latter focuses on downloading high-quality audio files.

网易云音乐命令行版本

Pros of musicbox

  • More comprehensive features for interacting with NetEase Cloud Music, including playlist management and lyric display
  • Better maintained with more recent updates and active community support
  • Supports both command-line and curses interfaces for improved user experience

Cons of musicbox

  • Focuses solely on NetEase Cloud Music, while NeteaseCloudMusicFlac supports downloading from multiple sources
  • May have a steeper learning curve due to more complex functionality
  • Doesn't specifically target high-quality FLAC downloads like NeteaseCloudMusicFlac

Code Comparison

musicbox:

def play_song(song):
    if 'mp3Url' in song:
        song_url = song['mp3Url']
    elif 'url' in song:
        song_url = song['url']
    else:
        return
    self.popen_handler = subprocess.Popen(self.mpg123_parameters + [song_url])

NeteaseCloudMusicFlac:

def get_song_info(music_id):
    url = "http://music.163.com/api/song/detail/?id={}&ids=[{}]".format(music_id, music_id)
    r = requests.get(url)
    json_data = r.json()
    return json_data['songs'][0]

Both projects interact with the NetEase Cloud Music API, but musicbox focuses on playback functionality, while NeteaseCloudMusicFlac emphasizes retrieving song information for downloading.

one for all free music in china (chrome extension, also works for firefox)

Pros of listen1_chrome_extension

  • Cross-platform support as a Chrome extension
  • Integrates multiple music streaming services in one interface
  • Actively maintained with regular updates

Cons of listen1_chrome_extension

  • Limited to browser usage, not a standalone application
  • Depends on third-party APIs, which may change or become unavailable
  • May have lower audio quality compared to FLAC files

Code Comparison

NeteaseCloudMusicFlac:

def get_music_info(music_id):
    url = "http://music.163.com/api/song/detail/?id={}&ids=[{}]".format(music_id, music_id)
    r = requests.get(url)
    return r.json()["songs"][0]

listen1_chrome_extension:

function getPlaylist(url, hm, se) {
  const list_id = getParameterByName('list_id', url);
  return {
    success: (fn) => {
      hm.get(`${se.url}/playlist?list_id=${list_id}`).then((response) => {
        fn(response.data);
      });
    },
  };
}

The code snippets show different approaches to fetching music information. NeteaseCloudMusicFlac uses Python to directly access the Netease API, while listen1_chrome_extension employs JavaScript to retrieve playlist data from multiple sources through a custom API.

高颜值的第三方网易云播放器,支持 Windows / macOS / Linux :electron:

Pros of YesPlayMusic

  • More active development with frequent updates and bug fixes
  • Sleek, modern user interface with better visual design
  • Cross-platform support (Windows, macOS, Linux) via Electron

Cons of YesPlayMusic

  • Lacks direct FLAC download functionality
  • May have higher resource usage due to Electron framework
  • Requires user login for full functionality

Code Comparison

YesPlayMusic (Vue.js component):

<template>
  <div class="player">
    <div class="cover-artwork">
      <img :src="currentTrack.artwork" :alt="currentTrack.name" />
    </div>
    <div class="track-info">
      <h3>{{ currentTrack.name }}</h3>
      <p>{{ currentTrack.artist }}</p>
    </div>
  </div>
</template>

NeteaseCloudMusicFlac (Python script):

def get_music_info(music_id):
    url = "http://music.163.com/api/song/detail/?id={}&ids=[{}]".format(music_id, music_id)
    r = requests.get(url)
    json_obj = r.json()
    return json_obj['songs'][0]

def download_flac(music_id):
    music_info = get_music_info(music_id)
    download_url = get_flac_url(music_id)
    filename = "{} - {}.flac".format(music_info['name'], music_info['artists'][0]['name'])
    urllib.request.urlretrieve(download_url, filename)

Salt Player for Android Release, Feedback

Pros of SaltPlayerSource

  • More active development with recent commits and releases
  • Broader feature set for a full-fledged music player application
  • Better documentation and project structure

Cons of SaltPlayerSource

  • Larger codebase, potentially more complex to understand and contribute to
  • Focused on a complete music player, less specialized for FLAC downloads

Code Comparison

SaltPlayerSource (Kotlin):

class PlaylistViewModel : ViewModel() {
    private val _playlists = MutableLiveData<List<Playlist>>()
    val playlists: LiveData<List<Playlist>> = _playlists

    fun loadPlaylists() {
        viewModelScope.launch {
            _playlists.value = PlaylistRepository.getPlaylists()
        }
    }
}

NeteaseCloudMusicFlac (Python):

def get_song_info(music_id):
    url = "http://music.163.com/api/song/detail/?id={}&ids=[{}]".format(music_id, music_id)
    r = requests.get(url)
    json_obj = r.json()
    return json_obj['songs'][0]

The code snippets showcase different languages and focuses. SaltPlayerSource uses Kotlin for Android development with a ViewModel for playlist management, while NeteaseCloudMusicFlac uses Python for API interactions to fetch song details.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

NeteaseCloudMusicFlac

NeteaseCloudMusicFlac is being sponsored by the following tool; please help to support us by taking a look and signing up to a free tria.

本程序仅供学习之用

感谢为 NeteaseCloudMusicFlac 的开发付出过努力以及提出建议的每一个人!

根据网易云音乐歌单, 下载对应无损FLAC歌曲到本地.

BackGround

现在无损资源基本都是专辑, 很难找到单曲来下载. 而且下载需要每个专辑搜索一遍, 需要用云盘复制粘贴密码再下载. 这对于听Hi-Fi的人们来说是非常不便利的事情, 找歌曲可以找一整天. 而现在网易云音乐是绝大多数人听在线歌曲的平台, 歌单众多. 于是我想做如此一个项目, 根据网易云音乐上面的歌单, 自动下载FLAC无损音乐到本地.

注意

海外由于版权问题无法下载歌曲, 所以会导致此issue, 无法正常使用, 需要修改DNS配置, 里面有解决方法.

安装

安装Python

根据此网站教程安装Python 注意安装的版本是 python3

强制使用 python3, 从我做起

下载main.py

可以使用此链接 https://codeload.github.com/YongHaoWu/NeteaseCloudMusicFlac/zip/master

获取歌单

到网易云音乐网页版找出想要下载无损的歌单, 如下图

NeteaseCloudMusicFlac

后进入歌单, 地址栏地址便是歌单地址.

使用

$ python main.py 歌单地址(如上图便是: http://music.163.com/#/playlist?id=145258012)

python3示例命令(注意 windows 可能要把下面的单引号去掉)

$ python3 main.py 'http://music.163.com/#/playlist?id=145258012'

下载所有歌曲, 包括 MP3 在内

$ python3 main.py 'http://music.163.com/#/playlist?id=145258012' --mp3

如果告知缺乏module

下载对应的模块(module), 网上搜索如何安装python模块.

python3
pip3 install requests

如运行中遇到错误, 可以运行 pip3 install --upgrade requests (其中一已知错误是request 旧版本在多线程下载时出现错误)

TODO list

  1. 目前只是匹配歌曲名字, 最好加上匹配歌手名
  2. 歌曲匹配率不高, 可以考虑再到其他网站抓

Enjoy it !

版权问题

如果涉及版权问题,项目将立刻关闭。 自己为百度音乐会员, 该项目为方便自己而做

The MIT License (MIT)

CopyRight (c) 2016 YongHaoHu <christopherwuy@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.