diff options
Diffstat (limited to 'src/watch_command.sh')
| -rw-r--r-- | src/watch_command.sh | 10 |
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 |