mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-02 05:52:26 +02:00
single Http Client reuse
This commit is contained in:
@@ -9,6 +9,7 @@ use std::collections::HashMap;
|
||||
use std::fs::File;
|
||||
use std::io::{BufWriter, Error, ErrorKind, Write};
|
||||
use std::path::PathBuf;
|
||||
use std::sync::Arc;
|
||||
|
||||
const FILE_SERIES_INFO: &str = "xtream_series_info";
|
||||
const FILE_VOD_INFO: &str = "xtream_vod_info";
|
||||
@@ -53,11 +54,11 @@ macro_rules! create_resolve_options_function_for_xtream_target {
|
||||
};
|
||||
}
|
||||
|
||||
pub(in crate::processing) async fn playlist_resolve_download_playlist_item(pli: &PlaylistItem, input: &ConfigInput, errors: &mut Vec<M3uFilterError>, resolve_delay: u16, cluster: XtreamCluster) -> Option<String> {
|
||||
pub(in crate::processing) async fn playlist_resolve_download_playlist_item(client: Arc<reqwest::Client>, pli: &PlaylistItem, input: &ConfigInput, errors: &mut Vec<M3uFilterError>, resolve_delay: u16, cluster: XtreamCluster) -> Option<String> {
|
||||
let mut result = None;
|
||||
let provider_id = pli.get_provider_id()?;
|
||||
if let Some(info_url) = download::get_xtream_player_api_info_url(input, cluster, provider_id) {
|
||||
result = match download::get_xtream_stream_info_content(&info_url, input).await {
|
||||
result = match download::get_xtream_stream_info_content(client, &info_url, input).await {
|
||||
Ok(content) => Some(content),
|
||||
Err(err) => {
|
||||
errors.push(info_err!(format!("{err}")));
|
||||
|
||||
Reference in New Issue
Block a user