HTML2wget2M3U2mpg123

The battle of the command line continues...

This is for downloading all the audio files linked from a web page, creating an M3U playlist, then playing the M3U with mpg123:


wget 'url' --recursive --level=1 --span-hosts --no-parent \
--wait=5  --no-directories --no-clobber --accept .mp3 \
&& ls -t *.mp3 > play.m3u \
&& mpg123 --list play.m3u

where url is the address of the web page containing the links. Annoyingly though, this still downloads every linked html or php page before deleting it, which on a weblog means that it downloads all the archive pages and links from every post (but doesn't keep them), instead of just the audio files.

Replace .mp3 with .ogg and use ogg123 ('ogg123 -d esd' to use the EsounD driver on OS X) if you want to play Ogg Vorbis files.