diff --git a/README.md b/README.md index ef9220bd..6d9b5192 100644 --- a/README.md +++ b/README.md @@ -648,7 +648,7 @@ dragdrop is the recommended way, but you may also: * select some files (not folders) in your file explorer and press CTRL-V inside the browser window * use the [command-line uploader](https://github.com/9001/copyparty/tree/hovudstraum/bin#u2cpy) -* upload using [curl or sharex](#client-examples) +* upload using [curl, sharex, ishare, ...](#client-examples) when uploading files through dragdrop or CTRL-V, this initiates an upload using `up2k`; there are two browser-based uploaders available: * `[🎈] bup`, the basic uploader, supports almost every browser since netscape 4.0 @@ -2039,7 +2039,8 @@ interact with copyparty using non-browser clients * can be downloaded from copyparty: controlpanel -> connect -> [partyfuse.py](http://127.0.0.1:3923/.cpr/a/partyfuse.py) * [rclone](https://rclone.org/) as client can give ~5x performance, see [./docs/rclone.md](docs/rclone.md) -* sharex (screenshot utility): see [./contrib/sharex.sxcu](contrib/#sharexsxcu) +* sharex (screenshot utility): see [./contrib/sharex.sxcu](./contrib/#sharexsxcu) + * and for screenshots on macos, see [./contrib/ishare.iscu](./contrib/#ishareiscu) * and for screenshots on linux, see [./contrib/flameshot.sh](./contrib/flameshot.sh) * contextlet (web browser integration); see [contrib contextlet](contrib/#send-to-cppcontextletjson) diff --git a/contrib/README.md b/contrib/README.md index 896a575f..f832f23d 100644 --- a/contrib/README.md +++ b/contrib/README.md @@ -12,14 +12,19 @@ * assumes the webserver and copyparty is running on the same server/IP * modify `10.13.1.1` as necessary if you wish to support browsers without javascript -### [`sharex.sxcu`](sharex.sxcu) -* sharex config file to upload screenshots and grab the URL +### [`sharex.sxcu`](sharex.sxcu) - Windows screenshot uploader +* [sharex](https://getsharex.com/) config file to upload screenshots and grab the URL * `RequestURL`: full URL to the target folder * `pw`: password (remove the `pw` line if anon-write) * the `act:bput` thing is optional since copyparty v1.9.29 * using an older sharex version, maybe sharex v12.1.1 for example? dw fam i got your back 👉😎👉 [`sharex12.sxcu`](sharex12.sxcu) -### [`flameshot.sh`](flameshot.sh) +### [`ishare.iscu`](ishare.iscu) - MacOS screenshot uploader +* [ishare](https://isharemac.app/) config file to upload screenshots and grab the URL +* `RequestURL`: full URL to the target folder +* `pw`: password (remove the `pw` line if anon-write) + +### [`flameshot.sh`](flameshot.sh) - Linux screenshot uploader * takes a screenshot with [flameshot](https://flameshot.org/) on Linux, uploads it, and writes the URL to clipboard ### [`send-to-cpp.contextlet.json`](send-to-cpp.contextlet.json) diff --git a/contrib/ishare.iscu b/contrib/ishare.iscu new file mode 100644 index 00000000..226ba7dc --- /dev/null +++ b/contrib/ishare.iscu @@ -0,0 +1,10 @@ +{ + "Name": "copyparty", + "RequestURL": "http://127.0.0.1:3923/screenshots/", + "Headers": { + "pw": "PUT_YOUR_PASSWORD_HERE_MY_DUDE", + "accept": "json" + }, + "FileFormName": "f", + "ResponseURL": "{{fileurl}}" +} diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index e553b97f..937d9f95 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -3395,6 +3395,8 @@ class HttpCli(object): self.reply(msg.encode("utf-8", "replace"), status=sc) elif want_json: + if len(jmsg["files"]) == 1: + jmsg["fileurl"] = jmsg["files"][0]["url"] jtxt = json.dumps(jmsg, indent=2, sort_keys=True).encode("utf-8", "replace") self.reply(jtxt, mime="application/json", status=sc) else: