Skip to content

Commit

Permalink
chore(stream): print links in user-readable format
Browse files Browse the repository at this point in the history
  • Loading branch information
3N4N committed Aug 20, 2023
1 parent fbc24a1 commit c50343d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,12 @@ pub fn print_stream_links(channel: &str) {
let split = body.split("\n");
for s in split {
if &s[0..5] == "https" {
println!("{}", s);
println!("{}\n", s);
} else if &s[0..7] != "#EXTM3U" && &s[24..32] == "GROUP-ID" {
// TODO: Print only the relevant part, e.g., 720p60
println!("{}", s);
let re = Regex::new(r#"NAME="(.+?)""#)
.expect("[ERR] Could not init regex for capturing stream format");
let caps = re.captures(s).unwrap();
print!("{}: ", caps.get(1).unwrap().as_str());
}
}
}
Expand Down

0 comments on commit c50343d

Please sign in to comment.