Giter Site home page Giter Site logo

ww-rm / ncmdump-py Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 4.0 31 KB

A simple package used to dump ncm files to mp3 or flac files.

Home Page: https://ww-rm.github.io/posts/2023/11/04/ncmdump/

License: MIT License

Python 100.00%
ncmdump ncm python neteasecloudmusic

ncmdump-py's Introduction

ncmdump-py

A simple package used to dump ncm files to mp3 or flac files, it can:

  • Decrypt and dump .ncm files.
  • Auto add album and cover info into .mp3 or .flac files.
  • Auto try download cover image when there is no cover data in .ncm files.

Install

pip install ncmdump-py

Usage

Command-line tool

python -m ncmdump [-h] [--in-folder IN_FOLDER] [--out-folder OUT_FOLDER] [--dump-metadata] [--dump-cover] [files ...]
usage: ncmdump [-h] [--in-folder IN_FOLDER] [--out-folder OUT_FOLDER] [--dump-metadata] [--dump-cover] [files ...]

Dump ncm files with progress bar and logging info, only process files with suffix '.ncm'

positional arguments:
  files                 Files to dump, can follow multiple files.

optional arguments:
  -h, --help            show this help message and exit
  --in-folder IN_FOLDER
                        Input folder of files to dump.
  --out-folder OUT_FOLDER
                        Output folder of files dumped.
  --dump-metadata       Whether dump metadata.
  --dump-cover          Whether dump album cover.

Import in your code

from ncmdump import NeteaseCloudMusicFile

ncmfile = NeteaseCloudMusicFile("filename.ncm")
ncmfile.decrypt()

print(ncmfile.music_metadata)  # show music metadata

ncmfile.dump_music("filename.mp3")  # auto detect correct suffix

# Maybe you also need dump metadata or cover image
# ncmfile.dump_metadata("filename.json")  
# ncmfile.dump_cover("filename.jpeg")

If you think this project is helpful to you, โญ it and let more people see!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.