youtube-to-opml/Makefile

21 lines
664 B
Makefile
Raw Permalink Normal View History

JAQ?=jaq
subscriptions.txt: subscriptions.json
$(JAQ) --raw-output '.[]' subscriptions.json > $@
subscriptions.curl: subscriptions.json
2024-05-06 02:38:41 +00:00
$(JAQ) --raw-output '.[] | (split("/") | last) as $$name | "url \(.)\noutput \($$name).html"' subscriptions.json > $@
fetch: subscriptions.curl
curl --location --output-dir html --create-dirs --rate 1/s --config subscriptions.curl
channel-json: subscriptions.txt
# nproc is not portable :-/
xargs -n1 --max-procs=$$(nproc) --arg-file subscriptions.txt --verbose ./generate-json-opml
# turn all the channel json files into an OPML file
subscriptions.opml:
./generate-opml > $@
.PHONY: channel-json subscriptions.opml