Fix curi handling. Make youtube use individuous. - annna - Annna the nice frien… | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit 01d96c9afbf853e71878dc9410576cbff9a4e5a0 | |
parent 83de680c4f3886aace0d1e803df25ce5e1413ccf | |
Author: Annna Robert-Houdin <[email protected]> | |
Date: Sun, 14 Jun 2020 18:56:56 +0200 | |
Fix curi handling. Make youtube use individuous. | |
Diffstat: | |
M annna-start-services | 29 ++++++++++++++++------------- | |
1 file changed, 16 insertions(+), 13 deletions(-) | |
--- | |
diff --git a/annna-start-services b/annna-start-services | |
@@ -56,6 +56,8 @@ annna_common() { | |
sturi="" | |
# Replacement URI. | |
nuri="" | |
+ # Replacement URI display string. | |
+ snuri="" | |
# html2text content. | |
curi="" | |
# Set to 0, if some URI content should be shown. | |
@@ -83,30 +85,31 @@ annna_common() { | |
case "${uri}" in | |
*youtube.com/*|*youtu.be/*) | |
nuri="https://invidio.us/${uri#https*://*/}" | |
+ nuris="${nuri}" | |
+ fetch-uri "${nuri}" > "${tmpf}" | |
urititle="$(curl-grabtitle "${nuri}")" | |
sturi="$(subtitle-paste "${uri}")" | |
- nuri="invidious: ${nuri}" | |
- nocuri=0 | |
+ nuris="invidious: ${nuri}" | |
;; | |
*twitter.com*) | |
nuri="$(printf "%s\n" "${uri}" | sed 's;\(mobi… | |
+ fetch-uri "${nuri}" > "${tmpf}" | |
urititle="$(curl-grabtitle "${nuri}")" | |
suri="$(screenshot-paste "${nuri}")" | |
- nuri="nitter: ${nuri} " | |
- nocuri=0 | |
+ nuris="nitter: ${nuris} " | |
;; | |
*en.wikipedia.org/wiki*) | |
if ! regeximatch "$uri" '\.(jpg,bmp,gif,png,ti… | |
then | |
- nuri="$(printf 'gopherpedia: %s \n' "$… | |
- curi="$(9 htmlfmt < "${tmpf}" | /br/bi… | |
- nocuri=0 | |
+ nuri="$(printf '%s\n' "${uri}" | sed -… | |
+ nuris="$(printf 'gopherpedia: %s \n' "… | |
+ fetch-uri "${nuri}" > "${tmpf}" | |
fi | |
;; | |
*www.reddit.com*) | |
- nuri="$(printf 'old.reddit: %s \n' "${uri}" | … | |
- curi="$(9 htmlfmt < "${tmpf}" | /br/bin/bitrei… | |
- nocuri=0 | |
+ nuri="$(printf '%s\n' "${uri}" | sed "s;www.re… | |
+ nuris="old.reddit: ${nuri} " | |
+ fetch-uri "${nuri}" > "${tmpf}" | |
if [ -n "${uri#*www.reddit.com/r/*}" ]; | |
then | |
subreddit="$(printf '%s\n' "${uri}" | … | |
@@ -117,12 +120,12 @@ annna_common() { | |
else | |
guri="gopher://gopherddit.com/… | |
fi | |
- nuri="${nuri}; gopherdit: ${guri} " | |
+ nuris="${nuri}; gopherdit: ${guri} " | |
fi | |
;; | |
*github.com/*/blob/*) | |
urltitle="" | |
- nuri="$(printf '%s' "${uri}" | sed 's/blob/raw… | |
+ nuris="$(printf '%s' "${uri}" | sed 's/blob/ra… | |
;; | |
*) | |
mimetype="$(file -b --mime-type "${tmpf}")" | |
@@ -145,7 +148,7 @@ annna_common() { | |
outputstr="${outputstr}content: ${curi… | |
fi | |
- [ -n "${nuri}" ] && outputstr="${outputstr}; $… | |
+ [ -n "${nuris}" ] && outputstr="${outputstr}; … | |
[ -n "${urititle}" ] && outputstr="${outputstr… | |
[ -n "${suri}" ] && outputstr="${outputstr}; s… | |
[ -n "${sturi}" ] && outputstr="${outputstr}; … |