Files
copyparty/bin/hooks
ed 2f6707825a improve usb-eject hook:
* don't crash internet explorer
* support running as root
* support old linuxen
2025-02-10 04:52:57 +00:00
..
2023-03-26 22:19:15 +00:00
2024-07-13 01:32:26 +02:00
2023-03-26 22:18:48 +00:00
2025-01-25 17:02:41 +00:00
2024-08-15 19:26:06 +00:00
2025-02-10 04:52:57 +00:00
2025-02-10 04:52:57 +00:00
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 (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

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
  • qbittorrent-magnet.py starts downloading a torrent if you post a magnet url
  • usb-eject.py adds web-UI buttons to safe-remove usb flashdrives shared through copyparty
  • msg-log.py is a guestbook; logs messages to a doc in the same folder