commit b36fba7d698e42121c0fb49fc51fb4507dd4cb50
parent b6f6dca9f92ddcc4c6256b3eb81c2eb4430d94a0
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date: Sat, 27 Apr 2024 17:38:49 +0200
Update readme
Diffstat:
M | README | | | 81 | ++++++++++++++++++++++++++++++++++++++----------------------------------------- |
1 file changed, 39 insertions(+), 42 deletions(-)
diff --git a/README b/README
@@ -1,22 +1,22 @@
tw2html
------
+=======
Please send patches or remarks to <jayvii[AT]posteo[DOT]de>
Checks online status of streams on twitch.tv and lets you watch them right here!
Usage
------
+=====
-You can simply call the `?streams` endpoint with a comma-separated list of your
+You can simply call the "?streams" endpoint with a comma-separated list of your
favorite streams:
-index.php?streams=gamingonlinux,linustechtips,...
+ index.php?streams=gamingonlinux,linustechtips,...
Assuming you host this service under the URL "https://tw2html.example.com", you
can open up the streamlist like so:
-https://tw2html.example.com/?streams=gamingonlinux,linustechtips
+ https://tw2html.example.com/?streams=gamingonlinux,linustechtips
The site will show you a loading screen, while the status of streams are fetched
in the background. Once the process is finished, the site refreshes by itself
@@ -24,64 +24,61 @@ and shows you a list of online streams. You can watch them directly on tw2html
via iframe-embedding (this transfers your IP and user-agent information to
twitch.tv).
-Alternatively if your client can handle `streamlink://` schemes, you may open
+Alternatively if your client can handle "streamlink://" schemes, you may open
the stream via https://streamlink.github.io/.
-Requirements
------
-
-- PHP-7.2 or higher
-
Further notes
------
+=============
streamlink:// scheme handler
+----------------------------
-tw2html offers buttons with the custom `streamlink://` scheme. It gives you the
+tw2html offers buttons with the custom "streamlink://" scheme. It gives you the
opportunity to open up streams on your computer via streamlink.
-For Mozilla Firefox:
+This has only be tested on GNU/Linux, if you have any notes on how to add
+custom scheme handlers on macOS or MS Windows, please let me know.
-Add following key in `about:config`:
+For Mozilla Firefox, add following key in "about:config":
- Key: network.protocol-handler.expose.streamlink
- Type: Boolean
- Value: true
+For Chrome/Chromium, protocol-handlers are added on-demand by clicking on such
+URLs/handles, autoamtically.
+
For GNU/Linux:
In addition to the scheme handler in your browser (see above for Firefox), you
need to add a streamlink-handler (e.g. in `~/.local/bin/streamlink-handler.sh`),
such as:
-
-#!/usr/bin/env bash
-
-function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
-
-URL=$(urldecode "$1" | sed -E -e 's/\?.*$//' -e 's/^streamlink/https/')
-TITLE=$(urldecode "$1" | sed -E -e 's/^.*?title=//')
-
-streamlink \
- --player "mpv" \
- --title "${TITLE}" \
- "${URL}" best
-
-
-and the according `.desktop` file (e.g. in
-`~/.local/share/applications/streamlink-handler.desktop`):
-
-
-[Desktop Entry]
-Type=Application
-Name=Streamlink Scheme Handler
-Exec=.local/bin/streamlink-handler.sh %u
-StartupNotify=false
-NoDisplay=true
-MimeType=x-scheme-handler/streamlink;
-
+ #!/usr/bin/env bash
+ function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
+ URL=$(urldecode "$1" | sed -E -e 's/\?.*$//' -e 's/^streamlink/https/')
+ TITLE=$(urldecode "$1" | sed -E -e 's/^.*?title=//')
+ streamlink \
+ --player "mpv" \
+ --title "${TITLE}" \
+ "${URL}" best
+
+and the according ".desktop" file (e.g. in
+"~/.local/share/applications/streamlink-handler.desktop"):
+
+ [Desktop Entry]
+ Type=Application
+ Name=Streamlink Scheme Handler
+ Exec=.local/bin/streamlink-handler.sh %u
+ StartupNotify=false
+ NoDisplay=true
+ MimeType=x-scheme-handler/streamlink;
Afterwards, add the new scheme handler to xdg:
+ xdg-mime default streamlink-handler.desktop x-scheme-handler/streamlink
+
+Requirements
+============
-xdg-mime default streamlink-handler.desktop x-scheme-handler/streamlink
+- PHP-7.2 or higher