summaryrefslogtreecommitdiffstats
path: root/.local/bin/audioarticle
diff options
context:
space:
mode:
authormsglm <msglm@techchud.xyz>2023-01-14 10:33:04 -0600
committermsglm <msglm@techchud.xyz>2023-01-14 10:33:04 -0600
commit0d05ef1e12314985988e567ac22a179d0f646899 (patch)
treede702ad5f7550a27a6fb982e617363ccaca4fecf /.local/bin/audioarticle
downloadmsglm-dotfiles-0d05ef1e12314985988e567ac22a179d0f646899.tar.gz
msglm-dotfiles-0d05ef1e12314985988e567ac22a179d0f646899.tar.bz2
msglm-dotfiles-0d05ef1e12314985988e567ac22a179d0f646899.zip
Inital Commit
Diffstat (limited to '.local/bin/audioarticle')
-rwxr-xr-x.local/bin/audioarticle17
1 files changed, 17 insertions, 0 deletions
diff --git a/.local/bin/audioarticle b/.local/bin/audioarticle
new file mode 100755
index 0000000..9b044ba
--- /dev/null
+++ b/.local/bin/audioarticle
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+#Description: This script takes in a URL, saves the URL's to a file, then passes it through firefox's readable'
+
+#Axioms: CONTENTDIR
+
+#Dependencies: https://www.npmjs.com/package/readability-cli https://github.com/coqui-ai/TTS https://packages.debian.org/stretch/festival
+
+webpageLocation=$(mktemp)
+wget -O "$webpageLocation" -c "$1"
+
+title=$(/home/"$USER"/.npm-global/bin/readable -q -p "title" "$webpageLocation")
+article=$(/home/"$USER"/.npm-global/bin/readable -q -p "text-content" "$webpageLocation"|iconv -c -f utf-8 -t ascii -)
+
+/home/"$USER"/.local/bin/tts --use_cuda true --text "$article" --out_path "/home/$USER/Media/Videos/Content/$title-$(openssl rand -hex 6).wav" || echo "$article" | text2wave > "/home/$USER/Media/Videos/Content/$title-$(openssl rand -hex 6).wav"
+
+rm "$webpageLocation"