Compare commits

..

10 Commits

@ -0,0 +1,4 @@
.git
target/
config.toml
cookies.txt

4
.gitignore vendored

@ -1,2 +1,6 @@
/target
config.toml
/vendor
/.cargo/config.toml
Cargo.lock
cookies.txt

@ -0,0 +1,11 @@
FROM rust:alpine as builder
RUN apk add --no-cache musl-dev
WORKDIR /usr/src/svr
COPY . .
RUN cargo build --release
FROM alpine:edge
RUN apk add --no-cache yt-dlp
COPY --from=builder /usr/src/svr/target/release/svr /usr/local/bin/svr
CMD ["/usr/local/bin/svr"]

@ -2,7 +2,12 @@
`svr` is a utility that monitors and downloads livestreams for any site with a youtube-dl extractor.
Example `config.toml`:
## Example CLI Usage
```bash
svr -c /path/to/config.toml
```
## Example `config.toml`:
```toml
output = "/media/livestreams"
@ -25,13 +30,25 @@ url = "https://www.youtube.com/watch?v=jfKfPfyJRdk"
frequency = "2h"
```
## Example `docker-compose.yml`:
```yaml
version: "3.0"
services:
svr:
container_name: svr
image: git.nickzana.dev/nick/svr:latest
volumes:
- $CONFIG/config.toml:/config.toml
- $MEDIA_PATH/livestreams:/media/livestreams
restart: unless-stopped
```
## TODO
- Implement credential management for protected streams
- More configuration options for individual streams
- Handle server/stream interruptions (e.g. merging multiple stream files)
- Monitor playlists and other non-live content (monitor a channel???)
- Automatic deletion after e.g. a period of time
- Improved logging (tracing?)
- Save metadata somewhere
- Dockerfile for easy deployment
- Improve cli docs
- Add --help menu
- Web GUI for subscription management

@ -81,10 +81,17 @@ impl Stream {
loop {
match dl.run_async().await {
Ok(YoutubeDlOutput::SingleVideo(video)) => {
println!("Successfully downloading video `{url:#?}`: {video:#?}");
println!(
"Successfully downloaded {} `{url:#?}`: {video:#?}",
if Some(true) == video.is_live {
"livestream"
} else {
"video"
}
);
}
Ok(YoutubeDlOutput::Playlist(playlist)) => {
println!("Successfully downloading playlist `{url:#?}`: {playlist:#?}");
println!("Successfully downloaded playlist `{url:#?}`: {playlist:#?}");
}
Err(e) => {
let err = if let youtube_dl::Error::ExitCode { stderr, .. } = e {

@ -1,5 +1,3 @@
#![feature(async_closure)]
use config::Config;
use futures::future::join_all;
use std::sync::Arc;

Loading…
Cancel
Save