mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-10 09:52:18 +02:00
adding &type=m3u_plus at the end of an m3u url wil trigger a download. Without it will only stream the result.
This commit is contained in:
@@ -40,6 +40,7 @@ web_ui_enabled: true
|
||||
- added `hlsr` handling.
|
||||
- refactored strm generation, does not delete root directory, avoids unchanged file creations.
|
||||
- fixed mapper counter not incrementing.
|
||||
- adding `&type=m3u_plus` at the end of an `m3u` url wil trigger a download. Without it will only stream the result.
|
||||
|
||||
# 2.1.3 (2025-01-26)
|
||||
- Hotfix 2.1.2, forgot to update the stream api code.
|
||||
|
||||
+6
-3
@@ -26,9 +26,12 @@ async fn m3u_api(
|
||||
Ok(m3u_iter) => {
|
||||
// Convert the iterator into a stream of `Bytes`
|
||||
let content_stream = stream::iter(m3u_iter.map(|line| Ok::<Bytes, String>(Bytes::from([line.as_bytes(), b"\n"].concat()))));
|
||||
HttpResponse::Ok()
|
||||
.content_type(mime::TEXT_PLAIN_UTF_8)
|
||||
.streaming(content_stream)
|
||||
let mut builder = HttpResponse::Ok();
|
||||
builder.content_type(mime::TEXT_PLAIN_UTF_8);
|
||||
if api_req.content_type == "m3u_plus" {
|
||||
builder.insert_header(("Content-Disposition", "attachment; filename=\"playlist.m3u\""));
|
||||
}
|
||||
builder.streaming(content_stream)
|
||||
}
|
||||
Err(err) => {
|
||||
error!("{}", sanitize_sensitive_info(err.to_string().as_str()));
|
||||
|
||||
@@ -41,4 +41,6 @@ pub struct UserApiRequest {
|
||||
pub stream: String,
|
||||
#[serde(default)]
|
||||
pub duration: String,
|
||||
#[serde(default, alias = "type")]
|
||||
pub content_type: String,
|
||||
}
|
||||
Reference in New Issue
Block a user