aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAlex Shnitman <alexta69@gmail.com>2021-04-12 23:08:36 +0300
committerAlex Shnitman <alexta69@gmail.com>2021-04-12 23:08:36 +0300
commit6eb691029eb960901fbbcde3591ae0caedfa254d (patch)
tree0d34d1a1f94496691807c7c17c02b011209924c5 /README.md
parentfix manual run instructions in README (closes #28) (diff)
downloadmetube-6eb691029eb960901fbbcde3591ae0caedfa254d.tar.gz
metube-6eb691029eb960901fbbcde3591ae0caedfa254d.tar.bz2
metube-6eb691029eb960901fbbcde3591ae0caedfa254d.zip
add bookmarklet in README
Diffstat (limited to 'README.md')
-rw-r--r--README.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/README.md b/README.md
index 4a694f8..a42c2c2 100644
--- a/README.md
+++ b/README.md
@@ -36,6 +36,16 @@ Certain values can be set via environment variables, using the `-e` parameter on
* __DOWNLOAD_DIR__: path to where the downloads will be saved. Defaults to `/downloads` in the docker image, and `.` otherwise.
* __URL_PREFIX__: base path for the web server (for use when hosting behind a reverse proxy). Defaults to `/`.
+## Bookmarklet
+
+[kushfest](https://github.com/kushfest) has created a bookmarklet for sending the currently open webpage to MeTube. Please note that if you're on an HTTPS page, your MeTube instance must be behind an HTTPS reverse proxy (see below) for the bookmarklet to work.
+
+GitHub doesn't allow embedding JavaScript as a link, so the bookmarklet has to be created manually by copying the following code to a new bookmark you create on your bookmarks bar. Change the hostname in the URL below to point to your MeTube instance.
+
+```javascript
+javascript:!function(){xhr=new XMLHttpRequest();xhr.open("POST","https://metube.domain.com/add");xhr.send(JSON.stringify({"url":document.location.href,"quality":"best"}));xhr.onload=function(){if(xhr.status==200){alert("Sent to metube!")}else{alert("Send to metube failed. Check the javascript console for clues.")}}}();
+```
+
## Running behind a reverse proxy
Use the following nginx configuration to run MeTube behind a reverse proxy. The extra `proxy_set_header` directives are there to make WebSocket work. Don't forget to set the URL_PREFIX environment variable to the correct value as well.
@@ -50,6 +60,8 @@ location /metube/ {
}
```
+If you're using the [linuxserver/swag](https://docs.linuxserver.io/general/swag) image for your reverse proxying needs (which I can heartily recommend), it already includes ready snippets for proxying MeTube both in [subfolder](https://github.com/linuxserver/reverse-proxy-confs/blob/master/metube.subfolder.conf.sample) and [subdomain](https://github.com/linuxserver/reverse-proxy-confs/blob/master/metube.subdomain.conf.sample) modes under the `nginx/proxy-confs` directory in the configuration volume.
+
## Build and run locally
Make sure you have node.js and Python 3.8 installed.
bgstack15