mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-12-24 06:04:00 +01:00
24 lines
692 B
Text
Executable file
24 lines
692 B
Text
Executable file
#!/usr/bin/env scriptisto
|
|
|
|
(*
|
|
scriptisto-begin
|
|
script_src: playtwitch.ml
|
|
build_cmd: dune build playtwitch.exe
|
|
target_bin: ./_build/default/playtwitch.exe
|
|
files:
|
|
- path: dune
|
|
content: (executable (name playtwitch) (libraries clap))
|
|
scriptisto-end
|
|
*)
|
|
|
|
Clap.description "play a twitch stream using streamlink";
|
|
let stream_name = Clap.mandatory_string ~placeholder:"stream_name" () in
|
|
let quality = Clap.default_string ~placeholder:"quality" "best" in
|
|
Clap.close ();
|
|
|
|
let stream_name = "https://twitch.tv/" ^ stream_name in
|
|
|
|
let exit =
|
|
String.concat " " [ "streamlink"; stream_name; quality ] |> Sys.command
|
|
in
|
|
if exit != 0 then Stdlib.print_endline "streamlink crashed :("
|