Skip to content

Commit

Permalink
args: add --print-streams arg
Browse files Browse the repository at this point in the history
Just takes the same path as when a quality isn't set
  • Loading branch information
2bc4 committed Feb 20, 2024
1 parent e2f60bc commit ebc6b34
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ servers=https://eu.luminous.dev/live/[channel],https://lb-eu.cdn-perfprod.com/li
debug=true
quiet=true
passthrough=false
print-streams=false
no-low-latency=false
no-kill=false
force-https=true
Expand Down
7 changes: 6 additions & 1 deletion src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,24 @@ pub struct Args {
pub hls: HlsArgs,
pub debug: bool,
pub passthrough: bool,
pub print_streams: bool,
pub quality: Option<String>,
}

impl ArgParser for Args {
fn parse(&mut self, parser: &mut Parser) -> Result<()> {
parser.parse_switch_or(&mut self.debug, "-d", "--debug")?;
parser.parse_switch(&mut self.passthrough, "--passthrough")?;
parser.parse_switch(&mut self.print_streams, "--print-streams")?;

self.http.parse(parser)?;
self.player.parse(parser)?;
self.hls.parse(parser)?;

parser.parse_free(&mut self.quality, "quality")?;
if !self.print_streams {
parser.parse_free(&mut self.quality, "quality")?;
}

Ok(())
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/usage
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Options:
Silence player output
--passthrough
Passthrough playlist URL to player and do nothing else
--print-streams
Print available stream qualities and exit
--no-low-latency
Disable low latency streaming
--no-config
Expand Down

0 comments on commit ebc6b34

Please sign in to comment.