Music: new homekit

Not always but sometimes I need some muzak to focus myself in whatever I'm doing. To be honest I'm not the kind of people that wears (head|ear)phones all the time, I don't like, but from time to time it's ok with me to put them on to feel more isolated.

As I've said here before, since I have a solid disk (yep, that ones that are fast as hell but size is not something to celebrate) I'm mostly using streaming music (grooveshark, google play music, spotify, plex) but... what if you're not at home with a reliable connection or no data plan?.

Shit happens, mostly when you're working remotely, so I've decided to backup my online lists - at least the most used ones - to an external hard drive following the next steps:

  • As I've been using youtube-dl before, I've thought that best approach could be to reproduce all the lists in youtube and download them to different directories. So first step is to create manually the lists. In fact, as I was using youtube already, I had half of the work done.
  • Once all the lists are ready, just download them with youtube-dl. Easy peasy with this two commands:
    • $ youtube-dl --add-metadata --metadata-from-title "%(artist)s - %(title)s"
      --prefer-ffmpeg --no-post-overwrites -x -i --audio-format mp3 --audio-quality 320K
      --embed-thumbnail -o "%(title)s.%(ext)s" https://youtube.com/url/to/list
    • $ youtube-dl --add-metadata -x --audio-format mp3 https://youtube.com/url/to/video
  • Once I had the files "physically" on the hard drive I realized that some of them were in an unknown format for me: opus. Some players (like VLC) were able to play that format but cmus wasn't, so I needed to convert them to mp3/ogg... ffmpeg to the rescue:
    • for i in *.opus; do ffmpeg -i "$i" -f mp3 "${i%.*}.mp3"; done

Also, as extra step, I've bought this adapter, took an old microSD and rsynced the Music folder. And now I can enjoy it on the smartphone too without worrying about space or data plan limits.

About the author

Óscar
has doubledaddy super powers, father of Hugo and Nico, husband of Marta, *nix user, Djangonaut and open source passionate.
blog comments powered by Disqus