Skip to content

Commit 3602fe7

Browse files
Support cookies while recording (#4)
1 parent f58a455 commit 3602fe7

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
- Added SOCKS proxy support. See [the reqwest docs](https://docs.rs/reqwest/latest/reqwest/#proxies) for usage instructions. ([#3](https://github.com/THEOplayer/streamrr/pull/3))
6+
- Added cookies support while recording. ([#4](https://github.com/THEOplayer/streamrr/pull/4))
67

78
## v0.2.0 (2025-11-19)
89

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ publish = false
1313
[dependencies]
1414
m3u8-rs = "6.0.0"
1515
url = "2.5.7"
16-
reqwest = { version = "0.12.23", features = ["rustls-tls", "stream", "socks"], default-features = false }
16+
reqwest = { version = "0.12.23", features = ["rustls-tls", "stream", "socks", "cookies"], default-features = false }
1717
clap = { version = "4.5.48", features = ["derive"] }
1818
serde = { version = "1.0.228", features = ["derive"] }
1919
serde_json = "1.0.145"

src/record/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,11 @@ pub async fn record(
5656
let recording_path = dest.join("recording.json");
5757
let recording = RecordingFile::new(&recording_path).await?;
5858
let recording = Arc::new(Mutex::new(recording));
59+
let client = Client::builder()
60+
.cookie_store(true)
61+
.build()
62+
.map_err(|_| RecordError::Config("Error while building HTTP client"))?;
5963
// Download initial playlist
60-
let client = Client::new();
6164
let raw_playlist = token
6265
.run_until_cancelled(download_playlist(&client, url))
6366
.await

0 commit comments

Comments
 (0)