Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Metadata to Playlist Files #2215

Merged
merged 13 commits into from
Nov 14, 2024
Merged

Add Metadata to Playlist Files #2215

merged 13 commits into from
Nov 14, 2024

Conversation

PranjalSurana
Copy link
Contributor

Title

Add Metadata to Playlist Files

Description

Adding new setting to enhance the playlist (M3U) file generation by including #EXTINF metadata tag.

Related Issue

#2126

Motivation and Context

Enhancing playlist (M3U) file generation by including #EXTINF metadata tag . This would enrich the playlist files by including additional information like track duration and title, thereby providing a better user experience.

How Has This Been Tested?

Ran spotDL many times, to test various scenarios

Screenshots (if appropriate)

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the CONTRIBUTING document
  • I have read the CORE VALUES document
  • I have added tests to cover my changes
  • All new and existing tests passed

xnetcat and others added 10 commits September 6, 2024 12:21
Bug fixes:
- Always include filter when sending requests to piped by @xnetcat 
- Check status code when getting response from piped by @xnetcat 
- Use piped.video instead of main piped instance by @j3bx in spotDL#2172
- Fixed `RuntimeError: Directory 'C:\Users\myuser\.spotdl\web-ui\dist' does not exist` by @R0GUE-A5H in spotDL#2173
- Make sync command aware of file name changes by @xnetcat 

Documentation:
- Chore: update downloader.py by @Elto

Co-authored-by: kuba <xnetcat.dev@gmail.com>
Co-authored-by: Alan <96998756+j3bx@users.noreply.github.com>
Co-authored-by: Ikko Eltociear Ashimine <eltociear@gmail.com>
Co-authored-by: Ash <38578557+R0GUE-A5H@users.noreply.github.com>
@PranjalSurana
Copy link
Contributor Author

The failed pylint tests is failing, even though it shows "Your code has been rated at 10.00/10 (previous run: 10.00/10, -0.00)"
image

How should I address this?

@PranjalSurana
Copy link
Contributor Author

Also, failing test-vcr
image

If this url updated according to the assertion, other tests fail.

How should this be addressed?

@xnetcat
Copy link
Member

xnetcat commented Oct 21, 2024

Don't worry about tests, they are currently being improved. I will check this PR later today. Ping me so I don't forget :)

@xnetcat
Copy link
Member

xnetcat commented Oct 21, 2024

You should also add an cli argument

@PranjalSurana
Copy link
Contributor Author

Ok, so to enhance M3U file generation, I shld create a new CLI arg, and reuse the existing function for m3u in the new cli arg, rt?

@PranjalSurana
Copy link
Contributor Author

@xnetcat Can u plz recheck this PR, added new CLI arg

@Silverarmor Silverarmor changed the base branch from master to dev November 3, 2024 02:47
@Silverarmor Silverarmor requested a review from xnetcat November 3, 2024 02:48
@Silverarmor
Copy link
Member

@PranjalSurana is there any reason not to simply change the default --m3u files to this enhanced version? Any downside? Don't see why we need another separate CLI arg for it

@PranjalSurana
Copy link
Contributor Author

@Silverarmor, I can use the default --m3u CLI arg, there is no downside to it.

@xnetcat xnetcat merged commit 1c110e7 into spotDL:dev Nov 14, 2024
2 of 11 checks passed
@xnetcat xnetcat mentioned this pull request Nov 15, 2024
@Silverarmor
Copy link
Member

Silverarmor commented Dec 9, 2024

copying in all users who have interacted with the m3u file issue recently.
@jessicah @jnxr @redfast00 @PranjalSurana @xnetcat

Thanks all for your input on this bug that was introduced. In my opinion, the best solution is to remove the option (i.e. the CLI flag) to allow for customising metadata.
Reviewing the file format, we should have an m3u / m3u8 file as follows

#EXTM3U
#EXTINF:123,Artist Name - Track Title
Artist Name - Track title.mp3
#EXTINF:123,TestTwo- TestTwo
TestTwo.mp3

There appears to be no reason to allow customisation of these tags. Devices that do not support it simply ignore the metadata due to the # comment operator.

Are there any disagreements on this? Apologies for the delay in merging PRs resolving this, as some of them didn't solve the root cause.

@jessicah
Copy link

jessicah commented Dec 9, 2024 via email

@redfast00
Copy link

My two cents: a recent upgrade of spotDL changed the format that files are saved in if there are multiple authors of a song. This caused a bunch of duplicate files (one with only one author that was downloaded before the change, one with multiple authors that was downloaded after the change (or vice versa)). The simple format of the m3u file, where each line contains a filename, allowed me to easily write a commandline that moved the duplicate files that aren't in the m3u to a separate folder; for that purpose, the simpler m3u format was useful.

I realize this is a real edge case, so I'd say, disregard that usecase (woudn't be that hard to ignore lines starting with # anyways); I agree with just removing the CLI flag and using a default format.

@jnxr
Copy link

jnxr commented Dec 12, 2024

In my opinion, the best solution is to remove the option (i.e. the CLI flag) to allow for customising metadata.

The m3u customization can be used to hard code paths into the playlist file. The saved playlist files can then be placed outside of the folder and still work. You could play stuff from your NAS or something directly from the playlist file.

Right now, it would require one to go to the path the files are within or else the playlist file won't work.

The issue is solvable, the entire feature doesn't need to be removed outright.

@Silverarmor
Copy link
Member

@jnxr The m3u8 is created from the defined --output that is set. If you use a relative filepath output, then the m3u8 file uses a relative filepath.

e.g. Using spotdl --output "D:\spotdl" <link> --m3u will create an m3u file with lines reading D:\spotdl\filename.mp3

@jnxr
Copy link

jnxr commented Jan 16, 2025

@Silverarmor
Doesn't this make it imperative that the --output directory matches the final organization directory, what if they are different?
People might have use cases which match the above scenario. For eg. I download playlists to a temporary scratch drive before sending it over to the Disk to reduce the need for defragmentation.

@Silverarmor
Copy link
Member

Silverarmor commented Jan 16, 2025

@Silverarmor Doesn't this make it imperative that the --output directory matches the final organization directory, what if they are different? People might have use cases which match the above scenario. For eg. I download playlists to a temporary scratch drive before sending it over to the Disk to reduce the need for defragmentation.

Hmm that's true. However I don't see it as a crucial feature that many users must have.
spotDL as a project is facing issues of unmanageable codebase and too many features for users. I think your use case is too minor for me (currently, the entire dev team) to allocate time to.

copy past:
sorry i'm a one man team working on the project rn, on top of full time work & other things in life.
We are humans as well, and my work on spotDL over the last 4+ years is completely voluntary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants