1
0
Fork 0
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:
Luro02 2020-02-10 12:45:58 +01:00
parent ec07e6b64c
commit acbe7e73da
No known key found for this signature in database
GPG key ID: B66FD4F74501A9CF
2 changed files with 4 additions and 27 deletions

View file

@ -25,5 +25,4 @@ hex = "0.4"
shorthand = "0.1"
[dev-dependencies]
clap = "2.33"
pretty_assertions = "0.6"

View file

@ -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!();
}