From cd392fed90779af3d17dbc44e25d9fcb4064e20f Mon Sep 17 00:00:00 2001 From: euzu Date: Tue, 27 May 2025 12:42:11 +0200 Subject: [PATCH] Hls request handling for m3u fixed, Updated example config --- config/README.md | 5 +++++ config/api-proxy.yml | 4 ++-- config/mapping.yml | 3 +++ config/source.yml | 4 ---- config/user.txt | 4 ++-- src/api/endpoints/hls_api.rs | 11 ----------- src/api/endpoints/m3u_api.rs | 2 +- 7 files changed, 13 insertions(+), 20 deletions(-) create mode 100644 config/README.md diff --git a/config/README.md b/config/README.md new file mode 100644 index 000000000..249d24b4e --- /dev/null +++ b/config/README.md @@ -0,0 +1,5 @@ +Sample configuration. + +Login user credentials +test: test.secret +nobody: nobody.secret \ No newline at end of file diff --git a/config/api-proxy.yml b/config/api-proxy.yml index 7ee0d9cc8..a74d10f03 100644 --- a/config/api-proxy.yml +++ b/config/api-proxy.yml @@ -1,13 +1,13 @@ server: - name: default protocol: http - host: 10.41.41.89 + host: ${env:TULIPROX_HOST_IP} port: "8901" timezone: Europe/Paris message: Welcome to m3u-filter - name: external protocol: https - host: my-own-host.com + host: ${env:TULIPROX_DOMAIN} port: "443" timezone: Europe/Paris message: Welcome to m3u-filter diff --git a/config/mapping.yml b/config/mapping.yml index d2d534384..31d05f9de 100644 --- a/config/mapping.yml +++ b/config/mapping.yml @@ -30,3 +30,6 @@ mappings: - filter: "!business!" script: | @Group = "News" + - filter: 'Input = "iptv-org"' + script: | + @Caption = concat(@Caption, " (iptv-org)") diff --git a/config/source.yml b/config/source.yml index 263b2dbdf..9a5740e49 100644 --- a/config/source.yml +++ b/config/source.yml @@ -12,10 +12,6 @@ sources: - name: iptv-org type: m3u url: https://iptv-org.github.io/iptv/countries/uk.m3u - suffix: - field: title - value: "(iptv-org)" - targets: - name: iptv-org output: - type: xtream diff --git a/config/user.txt b/config/user.txt index 4e1f9fcfa..17475287b 100644 --- a/config/user.txt +++ b/config/user.txt @@ -1,2 +1,2 @@ -test: $argon2id$v=19$m=19456,t=2,p=1$QUpBWW5uellicTFRUU1tR0RVYVVEUTN5UEJDaWNWQnI3Rm1aNU1xZ3VUSWc3djZJNjk5cGlkOWlZTGFHajllSw$3HHEnLmHW07pjE97Inh85RTi6VN6wbV27sT2hHzGgXk -nobody: $argon2id$v=$argon2id$v=19$m=19456,t=2,p=1$Y2FROE83ZDQ1c2VaYmJ4VU9YdHpuZ2c2ZUwzVkhlRWFpQk80YVhNMEJCSlhmYk8wRE16UEtWemV2dk81cmNaNw$BB81wmEm/faku/dXenC9wE7z0/pt40l4YGh8jl9G2ko +test: $argon2id$v=19$m=19456,t=2,p=1$S21mQmhrczJxbGNONmFCY0hqU20zVXU1bU42MkRXRlJGcHNYZnJXRWtOek05ejFxMGh1NjRMbTVmVTZQRGFyQg$MOybv7fXMILqkpc7CnGRxQvvez57HpaimFOI2xT5koQ +nobody: $argon2id$v=19$m=19456,t=2,p=1$d3pmWFBQbXdiWGtybm5BMXlGcEpId3BxeUhSQjZSaDBIZHRkRGZFaks4ZXpBUHlyb2dkc3JENHNvVzNwb0JMSQ$sIEu5aJkR5boMmZTAeHFQGRKI8rIVVbpxD+faDWQCm0 diff --git a/src/api/endpoints/hls_api.rs b/src/api/endpoints/hls_api.rs index 1a849e291..8d6a3b109 100644 --- a/src/api/endpoints/hls_api.rs +++ b/src/api/endpoints/hls_api.rs @@ -119,17 +119,6 @@ async fn hls_api_stream( return create_custom_video_stream_response(&app_state.config, CustomVideoStreamType::ProviderConnectionsExhausted).into_response(); } - // let hls_url = if let Some((session_token_opt, hls_url)) = get_hls_session_token_and_url_from_token(&app_state.config.t_encrypt_secret, ¶ms.token) { - // if let Some(session_token) = session_token_opt { - // if session.token != session_token { - // return axum::http::StatusCode::BAD_REQUEST.into_response(); - // } - // } - // hls_url - // } else { - // return axum::http::StatusCode::BAD_REQUEST.into_response(); - // }; - let hls_url = match get_hls_session_token_and_url_from_token(&app_state.config.t_encrypt_secret, ¶ms.token) { Some((Some(session_token), hls_url)) if session_token == session.token => hls_url, _ => return axum::http::StatusCode::BAD_REQUEST.into_response(), diff --git a/src/api/endpoints/m3u_api.rs b/src/api/endpoints/m3u_api.rs index 4e12c6d95..ff9e52910 100644 --- a/src/api/endpoints/m3u_api.rs +++ b/src/api/endpoints/m3u_api.rs @@ -115,7 +115,7 @@ async fn m3u_api_stream( item: &pli, provider_id: pli.get_provider_id(), cluster, - target_type: TargetType::Xtream, + target_type: TargetType::M3u, target, input, user: &user,