spotify-downloader icon indicating copy to clipboard operation
spotify-downloader copied to clipboard

Allow specifying which format id to download and allow transcoding for Opus

Open Ciancy28 opened this issue 2 months ago • 3 comments

Requested Feature

currently, when m4a or Opus is set as format in config.json, the highest quality version available is chosen and (in case of opus) the "bitrate" field is ignored (despite the documentation suggesting otherwise). This has become a problem for me now that youtube is starting to roll out 256 kbps Opus (format id 774) to youtube music uploads even for non-premium users, as spotdl now downloads these needlessly bloated files (opus is already beyond transparency at 128 kbps for most people including me), and there's no easy way of lossy to lossy transcoding either (which wouldn't be ideal anyways for obvious reasons). There might also be a need for some people to download lower quality audio such as 64 kbps opus/he-aac (maybe for playback on storage-constrained mobile devices), which again, doesn't seem to be possible currently. Another edge case were this is a problem would be people using premium cookies for access to songs unavailable without music premium (very few but there are some) but without the need for 256 kbps aac, from my understanding, in this case you would be forced to get 256 kbps aac audio even if you are perfectly happy with 128 kbps opus and prefer that format. I've been trying to get format 251 back for the past two hours with no luck, even using yt-dlp args, but the software just keeps downloading format 774 no matter what (trying to download this album: https://open.spotify.com/album/0qws44dIANrXaaErn7kGCW, which apparently has every track available in this new format).

Possible implementation

add a "format_id": field to config.json and make "bitrate": functional for opus transcoding (only seems to work for m4a) or maybe add a "high_quality": true/false field instead, which enables/disables downloading of format 774/141, this would make sense disabled by default imo.

Ciancy28 avatar Apr 30 '24 17:04 Ciancy28