uk_foundations.opus: uk_foundations.txt
	piper-make-audiobook $<
	mv $<.opus $@

uk_foundations.txt: uk_foundations.html
	cat $< | w3m -v -F -T text/html -dump -cols 9999 - | sed -e 's/Foundatio ns/Foundations/' > $@

uk_foundations.html:
	wget https://ukfoundations.co/ -O $@

end_music.m4a:
	wget https://res.cloudinary.com/dki5hzod1/video/upload/v1726794889/Foundations_eqe3ga.m4a -O $@

end_music.opus: end_music.m4a
	ffmpeg -i $< -ar 48000 -ac 1 -f opus -y $@

uk_foundations_with_music.opus: uk_foundations.opus end_music.opus
	ffmpeg -i ffconcat.list -codec:a copy -y $@
