copyparty/bin/hooks
2023-02-26 19:22:54 +00:00
..
discord-announce.py docs + chmod 2023-01-29 18:28:53 +00:00
notify.py include filesize in notification 2023-01-31 19:03:13 +00:00
notify2.py add xiu (batching hook; runs on idle after uploads) + 2023-02-26 18:23:32 +00:00
README.md update readmes + fix typo 2023-02-26 19:22:54 +00:00
reject-extension.py docs + chmod 2023-01-29 18:28:53 +00:00
reject-mimetype.py docs + chmod 2023-01-29 18:28:53 +00:00
wget.py docs + chmod 2023-01-29 18:28:53 +00:00
xiu-sha.py add xiu (batching hook; runs on idle after uploads) + 2023-02-26 18:23:32 +00:00
xiu.py add xiu (batching hook; runs on idle after uploads) + 2023-02-26 18:23:32 +00:00

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 (xbu/xau/xiu/xbr/xar/xbd/xad)

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

after upload

upload batches

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

before upload

on message

  • wget.py lets you download files by POSTing URLs to copyparty