summaryrefslogtreecommitdiff
path: root/odin
diff options
context:
space:
mode:
Diffstat (limited to 'odin')
-rw-r--r--odin/strm.nix4
-rw-r--r--odin/strm/download_youtube11
2 files changed, 12 insertions, 3 deletions
diff --git a/odin/strm.nix b/odin/strm.nix
index 70034404..8fe4a68b 100644
--- a/odin/strm.nix
+++ b/odin/strm.nix
@@ -1,5 +1,5 @@
1{ stdenv 1{ stdenv
2, zsh, ffmpeg-full, youtube-dl, pv, notmuch, rss2email, rolling-directory 2, zsh, ffmpeg-full, youtube-dl, pv, notmuch, rss2email, rolling-directory, qprint, coreutils
3, buildPerlPackage, perlPackages 3, buildPerlPackage, perlPackages
4}: 4}:
5 5
@@ -46,7 +46,7 @@ in stdenv.mkDerivation {
46 46
47 phases = [ "unpackPhase" "buildPhase" "installPhase" ]; 47 phases = [ "unpackPhase" "buildPhase" "installPhase" ];
48 48
49 inherit zsh pv notmuch rss2email; 49 inherit zsh pv notmuch rss2email coreutils qprint;
50 ffmpeg = ffmpeg-full; 50 ffmpeg = ffmpeg-full;
51 youtubedl = youtube-dl; 51 youtubedl = youtube-dl;
52 rollingdirectory = rolling-directory; 52 rollingdirectory = rolling-directory;
diff --git a/odin/strm/download_youtube b/odin/strm/download_youtube
index ccb3a7bc..72dcd40a 100644
--- a/odin/strm/download_youtube
+++ b/odin/strm/download_youtube
@@ -74,9 +74,18 @@ printf ">>> %s <<<\n %s\n" "${msgId}" "${message}"
74 tmpFile=$(mktemp --tmpdir=/home/gkleen/rss/tmp .writeOut.XXXXXX) 74 tmpFile=$(mktemp --tmpdir=/home/gkleen/rss/tmp .writeOut.XXXXXX)
75 printf "Decoding base64 message content for ‘%s’" ${message} 75 printf "Decoding base64 message content for ‘%s’" ${message}
76 sed '/^Content-Transfer-Encoding: */d; /^$/q' ${message} >! $tmpFile 76 sed '/^Content-Transfer-Encoding: */d; /^$/q' ${message} >! $tmpFile
77 sed '1,/^$/d' ${message} | base64 -d >> $tmpFile 77 sed '1,/^$/d' ${message} | @coreutils@/bin/base64 -d >> $tmpFile
78 mv -v $tmpFile ${message} 78 mv -v $tmpFile ${message}
79 fi 79 fi
80
81 if [[ 'quoted-printable' == $(sed '/^Content-Transfer-Encoding: */!d; s///;q' ${message}) ]]; then
82 tmpFile=$(mktemp --tmpdir=/home/gkleen/rss/tmp .writeOut.XXXXXX)
83 printf "Decoding quoted printable message content for ‘%s’" ${message}
84 sed '/^Content-Transfer-Encoding: */d; /^$/q' ${message} >! $tmpFile
85 sed '1,/^$/d' ${message} | @qprint@/bin/qprint -d >> $tmpFile
86 mv -v $tmpFile ${message}
87 fi
88
80 89
81 from=$(mungefilename $(awk '/^From/ { gsub("^\"", "", $2); print $2; exit; }' "${message}")) 90 from=$(mungefilename $(awk '/^From/ { gsub("^\"", "", $2); print $2; exit; }' "${message}"))
82 if grep -q "<p>Enclosure: <a" "${message}"; then 91 if grep -q "<p>Enclosure: <a" "${message}"; then