1

With a music file and a text file containing the time stamp and name of each track is there a program that would separate and name each of the tracks correctly?

The file is not ripped CD (cue, flac, etc). I have continuous normal opus file, extracted from youtube music file, and a text list of its contents as listed on youtube.

(Preferably GUI).

I"m on Kubuntu 22.04.

cipricus
  • 3,444
  • 2
  • 34
  • 85
  • Is this a .cue file with time stamps, and a flac master file with all the tracks? Try flacon (https://flacon.github.io/download/) – Jos Sep 13 '22 at 15:06
  • @Jos - I will edit the question to give more details. I see there are a lot of scripts on the U&L but they are cumbersome for my purpose (at least what I can find), so a gui would be better. – cipricus Sep 13 '22 at 16:35
  • @Jos - I have found a solution and will post it. – cipricus Sep 13 '22 at 16:49

1 Answers1

1

Instead of downloading/extracting the youtube audio and then trying to split it based on the separate list, one should consider that such music-video files may have chapters, with a separate chapter for each track (as the file in question had).

There is a youtube-dl fork that has an option to download the chapters separately (in fact it downloads also the full audio and then splits it).

It is called yt-dlp.

In order to download the best m4a audio in separate tracks:

yt-dlp -f ba[ext=m4a] --split-chapters URL

In order to first list the available formats:

yt-dlp -F URL

which gives something like:

[youtube] QsmFrf-1wYE: Downloading webpage
[youtube] QsmFrf-1wYE: Downloading android player API JSON
[info] Available formats for QsmFrf-1wYE:
ID  EXT   RESOLUTION FPS CH │   FILESIZE  TBR PROTO │ VCODEC       VBR ACODEC      ABR ASR MORE INFO
──────────────────────────────────────────────────────────────────────────────────────────────────────────────
sb2 mhtml 48x27        0    │                 mhtml │ images                               storyboard
sb1 mhtml 80x45        0    │                 mhtml │ images                               storyboard
sb0 mhtml 160x90       0    │                 mhtml │ images                               storyboard
599 m4a   audio only      2 │   14.00MiB  31k https │ audio only       mp4a.40.5   31k 22k ultralow, m4a_dash
600 webm  audio only      2 │   17.51MiB  39k https │ audio only       opus        39k 48k ultralow, webm_dash
139 m4a   audio only      2 │   22.18MiB  49k https │ audio only       mp4a.40.5   49k 22k low, m4a_dash
249 webm  audio only      2 │   25.65MiB  56k https │ audio only       opus        56k 48k low, webm_dash
...     

and then download the desired audio format while splitting per chapter:

yt-dlp -f 139 --split-chapters URL

Source: here, here and here.


In order to automate that a bit, I have installed xclip. A shortcut can trigger the whole process (first selecting url, then using the shortcut) with a command like:

konsole --noclose -e yt-dlp -f ba[ext=m4a]  --split-chapters $(xclip -o)

Or a desktop/panel launcher can be created, containing the same command:

[Desktop Entry]
Exec=konsole --noclose -e yt-dlp -f ba[ext=m4a]  --split-chapters $(xclip -o)
Icon=im-youtube
Name[en_US]=Download youtube chapters
Name=Download youtube chapters 

After dragging it onto the Plasma panel, just select the URL and click the button:

enter image description here


UPDATE on Plasma: in Plasma KDE, xclip is not needed in fact, if the clipboard actions are used. More details in my related answers under here and here.

cipricus
  • 3,444
  • 2
  • 34
  • 85