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
run copyparty with --help-hooks
for usage details / hook type explanations (xm/xbu/xau/xiu/xbc/xac/xbr/xar/xbd/xad/xban)
note: in addition to event hooks (the stuff described here), copyparty has another api to run your programs/scripts while providing way more information such as audio tags / video codecs / etc and optionally daisychaining data between scripts in a processing pipeline; if that's what you want then see mtp plugins instead
- notify.py shows a desktop notification (example)
- notify2.py uses the json API to show more context
- image-noexif.py removes image exif by overwriting / directly editing the uploaded file
- discord-announce.py announces new uploads on discord using webhooks (example)
- reject-mimetype.py rejects uploads unless the mimetype is acceptable
- into-the-cache-it-goes.py avoids bugs in caching proxies by immediately downloading each file that is uploaded
these are --xiu
hooks; unlike xbu
and xau
(which get executed on every single file), xiu
hooks are given a list of recent uploads on STDIN after the server has gone idle for N seconds, reducing server load + providing more context
- xiu.py is a "minimal" example showing a list of filenames + total filesize
- xiu-sha.py produces a sha512 checksum list in the volume root
- reject-extension.py rejects uploads if they match a list of file extensions
- reloc-by-ext.py redirects an upload to another destination based on the file extension
- wget.py lets you download files by POSTing URLs to copyparty
- qbittorrent-magnet.py starts downloading a torrent if you post a magnet url
- msg-log.py is a guestbook; logs messages to a doc in the same folder