youtube-to-opml/Makefile
Pierre Ayoub edbd83c9db
fix(makefile): forgotten mkdir
Without creating the `json` directory, the `generate-json-opml` script
will fail complaining that `json/XXX.json` does not exists. If the
directory is already created, the `mkdir` will silently return.
2025-04-24 11:52:55 +02:00

21 lines
679 B
Makefile

JAQ?=jaq
subscriptions.txt: subscriptions.json
$(JAQ) --raw-output '.[]' subscriptions.json > $@
subscriptions.curl: subscriptions.json
$(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
mkdir -p json
# 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