diff --git a/README.md b/README.md index 551564f2..d448a48e 100644 --- a/README.md +++ b/README.md @@ -75,8 +75,8 @@ try the **[read-only demo server](https://a.ocv.me/pub/demo/)** 👀 running fro * [database location](#database-location) - in-volume (`.hist/up2k.db`, default) or somewhere else * [metadata from audio files](#metadata-from-audio-files) - set `-e2t` to index tags on upload * [file parser plugins](#file-parser-plugins) - provide custom parsers to index additional tags - * [event hooks](#event-hooks) - trigger a script/program on uploads, renames etc - * [upload events](#upload-events) - the older, more powerful approach + * [event hooks](#event-hooks) - trigger a program on uploads, renames etc ([examples](./bin/hooks/)) + * [upload events](#upload-events) - the older, more powerful approach ([examples](./bin/mtag/)) * [hiding from google](#hiding-from-google) - tell search engines you dont wanna be indexed * [themes](#themes) * [complete examples](#complete-examples) @@ -997,7 +997,7 @@ if something doesn't work, try `--mtag-v` for verbose error messages ## event hooks -trigger a script/program on uploads, renames etc +trigger a program on uploads, renames etc ([examples](./bin/hooks/)) you can set hooks before and/or after an event happens, and currently you can hook uploads, moves/renames, and deletes @@ -1006,7 +1006,7 @@ there's a bunch of flags and stuff, see `--help-hooks` ### upload events -the older, more powerful approach: +the older, more powerful approach ([examples](./bin/mtag/)): ``` -v /mnt/inc:inc:w:c,mte=+x1:c,mtp=x1=ad,kn,/usr/bin/notify-send diff --git a/bin/hooks/README.md b/bin/hooks/README.md new file mode 100644 index 00000000..03dfa943 --- /dev/null +++ b/bin/hooks/README.md @@ -0,0 +1,17 @@ +standalone programs which are executed by copyparty when an event happens (upload, file rename, delete, ...) + +these programs either take zero arguments, or a filepath (the affected file), or a json message with filepath + additional info + + +# after upload +* [notify.py](notify.py) shows a desktop notification +* [discord-announce.py](discord-announce.py) announces new uploads on discord using webhooks +* [reject-mimetype.py](reject-mimetype.py) rejects uploads unless the mimetype is acceptable + + +# before upload +* [reject-extension.py](reject-extension.py) rejects uploads if they match a list of file extensions + + +# on message +* [wget.py](wget.py) lets you download files by POSTing URLs to copyparty diff --git a/bin/mtag/README.md b/bin/mtag/README.md index 6361ae92..d0c04b74 100644 --- a/bin/mtag/README.md +++ b/bin/mtag/README.md @@ -1,5 +1,9 @@ standalone programs which take an audio file as argument +you may want to forget about all this fancy complicated stuff and just use [event hooks](../hooks/) instead (which doesn't need `-e2ts` or ffmpeg) + +---- + **NOTE:** these all require `-e2ts` to be functional, meaning you need to do at least one of these: `apt install ffmpeg` or `pip3 install mutagen` some of these rely on libraries which are not MIT-compatible @@ -17,6 +21,7 @@ these do not have any problematic dependencies at all: * [cksum.py](./cksum.py) computes various checksums * [exe.py](./exe.py) grabs metadata from .exe and .dll files (example for retrieving multiple tags with one parser) * [wget.py](./wget.py) lets you download files by POSTing URLs to copyparty + * also available as an [event hook](../hooks/wget.py) # dependencies