1
0
Fork 0

Support all pastebin.TLD services in readwwwlog

This commit is contained in:
tastytea 2022-04-26 23:43:43 +02:00
parent 450ef82d9b
commit cd8244faa4
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
2 changed files with 7 additions and 6 deletions

View File

@ -25,8 +25,10 @@ for url in ${urls}; do
if [[ ${url} =~ 'dpaste\.com' && ! ${url[-4,-1]} == ".txt" ]]; then
url+=".txt"
elif [[ ${url} =~ 'pastebin\.com' && ! ${url} =~ '/raw/' ]]; then
url="https://pastebin.com/raw/${id}"
elif [[ ${url} =~ '(//|\.)(pastebin\.|paste\.centos\.org)' ]] && \
[[ ! ${url} =~ '/raw/' ]]; then
local host=${${(@s:/:)url}[2]}
url="https://${host}/view/raw/${id}"
elif [[ ${url} =~ 'irccloud\.com' && ! ${url} =~ '/raw/' ]]; then
id=${${(@s:/:)url}[4]}
url="https://www.irccloud.com/pastebin/raw/${id}"
@ -34,8 +36,6 @@ for url in ${urls}; do
url="https://bpa.st/download-archive/${id}"
elif [[ ${url} =~ 'paste\.debian\.net' && ! ${url} =~ '/plain/' ]]; then
url="https://paste.debian.net/plain/${id}"
elif [[ ${url} =~ 'paste\.centos\.org' && ! ${url} =~ '/raw/' ]]; then
url="https://paste.centos.org/view/raw/${id}"
fi
if [[ ${TERMINAL} =~ "alacritty|xfce4-terminal" ]]; then

View File

@ -28,11 +28,12 @@ local -A assignments=(
'^https?://(www\.)?youtu(\.be|be\.com)/' "${mpv}"
'^(gemini|gopher)://' "kristall"
'\.(log|txt)$' "readwwwlog"
'^https?://(www\.)?(dpaste|pastebin|irccloud)\.com/' "readwwwlog"
'^https?://(www\.)?(dpaste|irccloud)\.com/' "readwwwlog"
'^https?://(www\.)?pastebin\.[^/]+/view/' "readwwwlog"
'^https?://bpa\.st/' "readwwwlog"
'^https?://sprunge\.us/' "readwwwlog"
'^https?://paste\.debian\.net/' "readwwwlog"
'^https://paste\.centos\.org/' "readwwwlog"
'^https?://paste\.centos\.org/' "readwwwlog"
'\.(webm|png|jpe?g|gif|svg|bmp|xcf)(\?.+)?$' "openwwwimg"
'(^magnet:|\.torrent$)' "transmission-remote-gtk"
)