MattJaccino / spotify-downloader

Spotify song downloader using API created by spotifydown.com
100 stars 22 forks source link

New argument --filename, allowing user to specify custom filename #11

Closed Caninas closed 1 month ago

Caninas commented 3 months ago

Proposed changes: New argument --filename, allowing user to specify the filename template. Fix FRONT_COVER not showing up in windows explorer (W11) and added 'album' and 'releaseDate' metadata to file.

Hi. I've been using the app a lot recently and found some "bugs" and thought about a new argument to change the default filename scheme ("title - artist"). The changes regarding the bugs were in the end of download_track function, just added the album and recording_date to the file itself because it was available from the track data JSON and also noticed that the FRONT_COVER was not showing up on my windows 11 (can't say about W10 or Linux yet), because of that i changed the ID3 version from 2.4 (default) to 2.3 as that seems to solve the problem.

Talking about the new argument, it replaces the function _get_track_local_title for a new one assemble_track_custom_title. It allows you to use 3 tags in a string to specify the scheme for the filename. For example: --filename "{id} - {artist}, {title}" will produce: "1 - Deftones, 7 Words.mp3". Anything that is not {id}, {artist} or {title} will appear on the final filename. The id is just the index of the music in the case of playlists (or 1 with a single track), the same that shows up when showing the selected playlist musics. Sometimes useful when making USB playlists to play on radios and ordering in general.

Issues #8 and #9 may find this new argument useful. On the future the same ID can be set on the track_number metadata as an option.

Caninas commented 3 months ago

Redid build commit (removed files that were not necessary).

MattJaccino commented 2 months ago

this is awesome man. you get a chance to play around with it and test it and everything looks good?

Caninas commented 2 months ago

this is awesome man. you get a chance to play around with it and test it and everything looks good?

Thanks. Yeah, tested a couple of inputs, tracks and playlists. Those templates that are misspelled get interpreted as just text in the music name, without getting replaced (like "{titlee}" becomes titlee.mp3). I think this is fine, without the need to put any code for these templates to show up as errors.

MattJaccino commented 2 months ago

this is awesome man. you get a chance to play around with it and test it and everything looks good?

Thanks. Yeah, tested a couple of inputs, tracks and playlists. Those templates that are misspelled get interpreted as just text in the music name, without getting replaced (like "{titlee}" becomes titlee.mp3). I think this is fine, without the need to put any code for these templates to show up as errors.

all good man. i can add validation afterwards

Caninas commented 2 months ago

Changes made

MattJaccino commented 1 month ago

thank you man