aboutsummaryrefslogtreecommitdiff
path: root/src/watch_command.sh
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-01-18 06:29:02 +0000
committerFuwn <[email protected]>2024-01-18 06:29:02 +0000
commit91b9523a6bdd22de1d5612a560a41cf966b2839f (patch)
treead4c1ef7a0048ee0fec7329522eb32b3e0ef7af5 /src/watch_command.sh
parentdocs(readme): update description (diff)
downloadtama-91b9523a6bdd22de1d5612a560a41cf966b2839f.tar.xz
tama-91b9523a6bdd22de1d5612a560a41cf966b2839f.zip
feat(watch): local streaming
Diffstat (limited to 'src/watch_command.sh')
-rw-r--r--src/watch_command.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/watch_command.sh b/src/watch_command.sh
index 6c94bf0..0d42267 100644
--- a/src/watch_command.sh
+++ b/src/watch_command.sh
@@ -1,4 +1,12 @@
-xdg-open "$(get "/stream/$(get "/episodes/${args[id]}" |
+PLAYER="$(get "/stream/$(get "/episodes/${args[id]}" |
jq -r ".[] | .id" |
head -n 1 |
sed -E 's/-episode-[0-9]+$//')-episode-1" | jq -r ".plyr.default")"
+
+if [[ -n "${args[--browser]}" ]]; then
+ xdg-open "${PLAYER}"
+else
+ "${args[--player]}" "$(echo "${PLAYER}" |
+ sed -E 's/.*#//' |
+ base64 --decode)"
+fi