Morsel #8: Bandcamp Album Length Calculator
My eighth morsel is a Python script that returns the running time of an album from Bandcamp in your CLI of choice. I previously used a JS plugin/applet in my browser but it stopped working and couldn’t find a replacement (there probably is one but I also don’t like installing add-ons unless I have to because Chromium browsers already hog enough memory!)
Then I thought “why not create a quick script to do the job?“. I have also made this into a Streamlit app but that’ll be coming in a future morsel. In the meantime, I discovered argparse and thought it’d be handy for me to have everything run in my CLI and print out the album length. No frills!
- Python 3
- Beautiful Soup
How to use
In your command line, enter
python3 bandcamp_calc.py -u [URL] and it will print out the running time in seconds.