From 3b16908085ed08ac70b1468357761c4307f31f07 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 14 Apr 2018 15:15:53 +0200 Subject: manual_youtube --- odin/strm.nix | 43 ++++++++++++++++++++++++++++++-- odin/strm/cleanup_youtube | 0 odin/strm/download_youtube | 0 odin/strm/manual_youtube | 62 ++++++++++++++++++++++++++++++++++++++++++++++ odin/strm/rss_staggered | 0 odin/strm/send_kitty | 0 6 files changed, 103 insertions(+), 2 deletions(-) mode change 100755 => 100644 odin/strm/cleanup_youtube mode change 100755 => 100644 odin/strm/download_youtube create mode 100644 odin/strm/manual_youtube mode change 100755 => 100644 odin/strm/rss_staggered mode change 100755 => 100644 odin/strm/send_kitty diff --git a/odin/strm.nix b/odin/strm.nix index 71d93011..094da07c 100644 --- a/odin/strm.nix +++ b/odin/strm.nix @@ -1,6 +1,43 @@ -{ stdenv, zsh, ffmpeg-full, youtube-dl, pv, notmuch, rss2email }: +{ stdenv, zsh, ffmpeg-full, youtube-dl, pv, notmuch, rss2email, buildPerlPackage, perlPackages }: -stdenv.mkDerivation { +let + manual-youtube = buildPerlPackage { + name = "manual_youtube"; + + src = ./strm/manual_youtube; + + outputs = [ "out" ]; + phases = [ "unpackPhase" "configurePhase" "buildPhase" "installPhase" "fixupPhase" ]; + + unpackPhase = '' + cp $src manual_youtube + + cat >Makefile.PL <; + close($fh); + die "youtube-dl could not extract title" unless (defined($title)); + chomp($title); + + my $mail = Email::MIME->create( + header_str => [ + From => "$fromName <$fromMail>", + To => 'gkleen@odin.asgard.yggdrasil', + Subject => $title, + 'X-RSS-URL' => $url, + Date => email_date(time() + ($i++)) + ], + attributes => { + content_type => 'text/html', + encoding => '7bit', + charset => 'US-ASCII' + }, + body => "$title\n" + ); + + my @args = (); + push @args, (('junk') x 5); + push @args, @tags; + + open($fh, '|-', "rss_deliver", @args) || die "Could not spawn rss_deliver"; + print $fh $mail->as_string; + close($fh); +} diff --git a/odin/strm/rss_staggered b/odin/strm/rss_staggered old mode 100755 new mode 100644 diff --git a/odin/strm/send_kitty b/odin/strm/send_kitty old mode 100755 new mode 100644 -- cgit v1.2.3