add get_url_content
This commit is contained in:
@@ -1,6 +1,11 @@
|
|||||||
use http::Uri;
|
use http::Uri;
|
||||||
use rust_util::*;
|
use rust_util::*;
|
||||||
|
|
||||||
|
pub async fn get_url_content(url: &str) -> XResult<String> {
|
||||||
|
let client = reqwest::Client::new();
|
||||||
|
Ok(client.get(url).send().await?.text().await?)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn make_url(base_url: &str, ts_url: &str) -> XResult<String> {
|
pub fn make_url(base_url: &str, ts_url: &str) -> XResult<String> {
|
||||||
let lower_ts_url = ts_url.to_lowercase();
|
let lower_ts_url = ts_url.to_lowercase();
|
||||||
if lower_ts_url.starts_with("http://") || lower_ts_url.starts_with("https://") {
|
if lower_ts_url.starts_with("http://") || lower_ts_url.starts_with("https://") {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
use http::Uri;
|
use http::Uri;
|
||||||
|
|
||||||
|
// https://github.com/rutgersc/m3u8-rs/blob/master/examples/simple.rs
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Hello, world!");
|
println!("Hello, world!");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user