copyparty/bin/hooks
ed fc658e5b9e utcfromtimestamp was deprecated and nobody told me,
not even the deprecationwarning that got silently generated burning
20~30% of all CPU-time without actually displaying it anywhere, nice

python 3.12.0 is now only 5% slower than 3.11.6

also fixes some other, less-performance-fatal deprecations
2023-10-20 23:41:58 +00:00
..
discord-announce.py hooks: more correct usage examples 2023-03-26 22:18:48 +00:00
image-noexif.py new hook: exif stripper 2023-03-26 22:19:15 +00:00
msg-log.py utcfromtimestamp was deprecated and nobody told me, 2023-10-20 23:41:58 +00:00
notify.py hooks: more correct usage examples 2023-03-26 22:18:48 +00:00
notify2.py utcfromtimestamp was deprecated and nobody told me, 2023-10-20 23:41:58 +00:00
README.md add windows example + update docs + some cosmetics 2023-04-12 22:06:44 +00:00
reject-extension.py hooks: more correct usage examples 2023-03-26 22:18:48 +00:00
reject-mimetype.py hooks: more correct usage examples 2023-03-26 22:18:48 +00:00
wget.py wget: only allow http/https/ftp/ftps (#50): 2023-08-20 09:47:50 +00:00
xiu-sha.py utcfromtimestamp was deprecated and nobody told me, 2023-10-20 23:41:58 +00:00
xiu.py hooks: more correct usage examples 2023-03-26 22:18:48 +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