update media polling services

This commit is contained in:
Ingolf Wagner 2023-08-03 11:50:39 +02:00
parent 971ad73195
commit 95e908cb1d
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
5 changed files with 61 additions and 47 deletions

View file

@ -28,6 +28,7 @@
./media-tdarr.nix
./media-jellyfin.nix
./media-youtube.nix
./media-castget.nix
# logging
./loki.nix

View file

@ -0,0 +1,24 @@
{ config, lib, ... }:
let
home = "/media/podcasts";
in
{
custom.services.castget = {
enable = true;
user = "media";
feeds = {
Alternativlos = {
url = "https://alternativlos.org/alternativlos.rss";
spool = "${home}/Alternativlos";
};
WohlstandFuerAlle = {
url = "https://wohlstandfueralle.podigee.io/feed/mp3";
spool = "${home}/Wohlstand für Alle";
};
DieNeuenZwanziger = {
url = "https://neuezwanziger.de/feed/mp3/";
spool = "${home}/Die Neuen Zwanziger";
};
};
};
}

View file

@ -92,6 +92,22 @@ let
target = "/media/youtube/series/SunkCostGalaxy";
output = "SunkCostGalaxy S01E%(playlist_index)s %(title)s.%(ext)s";
};
MusicVideos = {
url = "https://www.youtube.com/playlist?list=PLP33x-q_GftakJgpD48pZNl0TkhljQI7S";
target = "/media/youtube/music-videos";
output = "%(title)s.%(ext)s";
};
Movies = {
url = "https://www.youtube.com/playlist?list=PLP33x-q_Gftb-r8eUWBS1mjMlQZgCAljE";
target = "/media/youtube/movies";
output = "%(title)s.%(ext)s";
};
# like Documentations or something
Videos = {
url = "https://www.youtube.com/playlist?list=PLP33x-q_GftZa0-UG9yltYLea5scEHxd7";
target = "/media/youtube/loot";
output = "%(title)s.%(ext)s";
};
};
downloadScript =

View file

@ -1,22 +0,0 @@
{ config, lib, ... }:
let
home = "/home/syncthing/podcasts";
in
{
custom.services.castget = {
enable = true;
user = "root";
feeds = {
Alternativlos = {
url = "https://alternativlos.org/alternativlos.rss";
spool = "${home}/alternativlos";
};
gegenstandpunkt = {
url = "https://pc.argudiss.de/";
spool = "${home}/GegenStandpunkt";
};
};
};
}

View file

@ -1,28 +1,24 @@
{ config, lib, pkgs, ... }:
with lib;
with types;
let
cfg = config.custom.services.castget;
in
{
options.custom.services.castget = {
enable = mkEnableOption "enable custom.services.castget";
feeds = mkOption {
type = with types;
attrsOf (submodule {
type = attrsOf (submodule {
options = {
url = mkOption {
type = with types; str;
type = str;
description = ''
url to the rss feed
'';
};
spool = mkOption {
type = with types; path;
type = path;
description = ''
download enclosures to this directory.
'';
@ -34,13 +30,13 @@ in
'';
};
user = mkOption {
type = with types; string;
type = str;
description = ''
user to run the systemd service as
'';
};
timerConfig = mkOption {
type = with types; attrsOf str;
type = attrsOf str;
default = { OnCalendar = "daily"; };
example = {
OnCalendar = "00:05";
@ -51,7 +47,7 @@ in
'';
};
serviceName = mkOption {
type = with types; string;
type = str;
default = "castget";
description = ''
the name of the castget systemd service
@ -70,8 +66,7 @@ in
preStart =
let
mkSpools =
mapAttrsToList (ignore: value: "mkdir -p ${value.spool}") cfg.feeds;
mkSpools = mapAttrsToList (ignore: value: "mkdir -p \"${value.spool}\"") cfg.feeds;
in
concatStringsSep "\n" mkSpools;
script =