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

Code to extract track title and timestamp is not perfect on tracks with dashes #49

Open
crisbal opened this issue Sep 21, 2022 · 4 comments
Assignees
Labels

Comments

@crisbal
Copy link
Owner

crisbal commented Sep 21, 2022

As reported by @nicolaasjan in #22

However, the -'s in the filenames in the case of video https://www.youtube.com/watch?v=WUNipoTGhMc were still omitted, e.g.:
01 Olivia Newton-JohnMagic.wav.
I would prefer 01 - Olivia Newton-John - Magic.wav.

This is the relevant code : https://github.com/crisbal/album-splitter/blob/master/album_splitter/parse_tracks.py#L39

Work to be done:

  • Write unit tests for the current implementation
  • Replace the current implementation with one easier to understand and maintain
@crisbal crisbal self-assigned this Sep 21, 2022
@crisbal crisbal added the bug label Sep 21, 2022
@crisbal
Copy link
Owner Author

crisbal commented Oct 19, 2022

Hey @nicolaasjan

I have made some changes to the code and this is what is returned now:

01 Olivia Newton-John - Magic.wav
02 Rupert Holmes - Escape (The Pina Colada Song).wav
03 Captain & Tenille - Do that to me one more time.wav
04 Michael Jackson - Rock with you.wav
05 Queen - Crazy little thing called love.wav
06 Bette Midler - The rose.wav
07 Smokey Robinson - Crusin'.wav
08 Paul McCartney - Coming up.wav
09 Lipps, Inc - Funkytown.wav
10 Air Supply - Lost in love.wav
11 Elton John - Little Jeannie.wav
12 Gary Numan - Cars.wav
13 Spinners - Working my way back to you-Forgive me, girl.wav
14 KC & The Sunshine Band - Please don't go.wav
15 Styx - Babe.wav
16 Christopher Cross - Ride like the wind.wav
17 Diana Ross - Upside down.wav
18 Billy Preston & Syreeta - With you i'm born again.wav
19 Pink Floyd - Another brick in the wall (Part 2).wav

Please let me know if this is good for you.

There are still some edge cases, like if your tracks.txt contains a track number, this is treated as part of the title (For example 02 Olivia Newton-John - Magic - 00:00 will produce a track with the title 02 Olivia Newton John also in the metadata. This is something I will try to fix later. But at least it should be much better than before.

@nicolaasjan
Copy link

Please let me know if this is good for you.

Much better. Thanks!

Had to omit the track numbers from tracks.txt to get the same output you had.
Ideally, output file name should be like:
01 - Olivia Newton-John - Magic.wav

Also better that all is now handled in the virtual environment, so that it doesn't interfere with my own yt-dlp version. 😀️

@crisbal
Copy link
Owner Author

crisbal commented Oct 19, 2022

@nicolaasjan Yep, you can now pip install it too from the python package index.

@nicolaasjan
Copy link

nicolaasjan commented Oct 19, 2022

@nicolaasjan Yep, you can now pip install it too from the python package index.

Shouldn't there be .wav instead of .mp3 in Project description ---> Downloading and splitting an album from YouTube?

Screenshot 2022-10-19 at 16-22-05 album-splitter

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

No branches or pull requests

2 participants