miraclx / freyr-js

A tool for downloading songs from music streaming services like Spotify and Apple Music.
https://git.io/freyr-js
Apache License 2.0
1.37k stars 89 forks source link

Option to skip the conversion step #168

Open Rubecks opened 2 years ago

Rubecks commented 2 years ago

Converting a lossy file to another lossy format is a bad practice, the audio quality reduces 2 times (YouTube converts the upload on their side, and freyr converts it again), 3 times if the uploader sent a lossy audio too.

Sure, converting to AAC 320kbps is probably ok for YouTube's audio quality, but then you are creating bigger files for no reason. One of the songs I used to test it was 3.94 MB when downloaded, and 9.48 MB after conversion. Trying to reduce the bitrate to match the source size would be gambling with the audio quality too, since the same bitrate with different formats gives different results; a 128 kbps opus has higher quality than a 128 kbps aac.

Could you add an option to keep the original file, probably opus, and do everything else (tagging, organizing, etc...)?

miraclx commented 2 years ago

@Rubecks, yeah, we can probably do this. I'll have to do some research into which tools are available for embedding metadata of different audio formats. I think, so far, Mutagen – https://github.com/quodlibet/mutagen should suffice for as many formats as freyr needs. But since that's written in Python, we need to get #21 merged to aid bridging node and python.

ocococococ commented 1 year ago

Yes indeed, this feature would be more than nice.

Larox commented 4 months ago

Hi! I'm a new user, and notice something odd in the conversion process. The download file is 3.36 MB and the total output size is 2.15 GB. I'm not a 100% sure if related to the conversion process but is definitely worth of reviewing.

This is the command I used:

freyr get -b 256 https://open.spotify.com/track/5r5cp9IpziiIsR6b93vcnQ?si=295f54a7150349c2
Larox commented 4 months ago

Ignore my comment, right after I came across https://github.com/miraclx/freyr-js/issues/625. It was related to atomicParsley. Bumping the version that solved the issue.

Hi! I'm a new user, and notice something odd in the conversion process. The download file is 3.36 MB and the total output size is 2.15 GB. I'm not a 100% sure if related to the conversion process but is definitely worth of reviewing.

This is the command I used:

freyr get -b 256 https://open.spotify.com/track/5r5cp9IpziiIsR6b93vcnQ?si=295f54a7150349c2
rofe33 commented 1 week ago

@Rubecks, yeah, we can probably do this. I'll have to do some research into which tools are available for embedding metadata of different audio formats. I think, so far, Mutagen – https://github.com/quodlibet/mutagen should suffice for as many formats as freyr needs. But since that's written in Python, we need to get #21 merged to aid bridging node and python.

Hello all, I love freyr-js and I've been using it for quite a couple of years now. Just a downside is that I can't choose which track to download from youtube music. For example some songs have a clean version, and freyr doesn't download the clean version from youtube music.

I read miraclx's comment (the quoted comment) and thought to create a python package that just append metadata from apple to music files, downloaded using yt-dlp, so now I have the ability to download whatever version I want, and get the metadata that I want.

The supported files types are only opus files and m4a (m4a files because if a person wants to be able to open the music in iTunes on the computer and sync them to his/her iPhone/iPad).

I managed with the package that I created, to save 8GB (about 550+ songs) of space by just downloading the files in opus format.

The package is ammg.

Thank you @miraclx! Love your work.