mirror of
https://github.com/sile/hls_m3u8.git
synced 2024-11-25 16:41:00 +00:00
disable examples
This commit is contained in:
parent
ec07e6b64c
commit
acbe7e73da
2 changed files with 4 additions and 27 deletions
|
@ -25,5 +25,4 @@ hex = "0.4"
|
|||
shorthand = "0.1"
|
||||
|
||||
[dev-dependencies]
|
||||
clap = "2.33"
|
||||
pretty_assertions = "0.6"
|
||||
|
|
|
@ -1,29 +1,7 @@
|
|||
use clap::{App, Arg};
|
||||
use hls_m3u8::{MasterPlaylist, MediaPlaylist};
|
||||
use std::io::{self, Read};
|
||||
// use hls_m3u8::{MasterPlaylist, MediaPlaylist};
|
||||
// use std::fs::File;
|
||||
// use std::io::Read;
|
||||
|
||||
fn main() {
|
||||
let matches = App::new("parse")
|
||||
.arg(
|
||||
Arg::with_name("M3U8_TYPE")
|
||||
.long("m3u8-type")
|
||||
.takes_value(true)
|
||||
.default_value("media")
|
||||
.possible_values(&["media", "master"]),
|
||||
)
|
||||
.get_matches();
|
||||
let mut m3u8 = String::new();
|
||||
io::stdin().read_to_string(&mut m3u8).unwrap();
|
||||
|
||||
match matches.value_of("M3U8_TYPE").unwrap() {
|
||||
"media" => {
|
||||
let playlist: MediaPlaylist = m3u8.parse().unwrap();
|
||||
println!("{}", playlist);
|
||||
}
|
||||
"master" => {
|
||||
let playlist: MasterPlaylist = m3u8.parse().unwrap();
|
||||
println!("{}", playlist);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
unimplemented!();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue