1
0
Fork 0

readwwwlog: Fix pastebin.com

This commit is contained in:
tastytea 2022-04-27 20:56:30 +02:00
parent 4925847c43
commit 4e7c0f4d96
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
2 changed files with 6 additions and 2 deletions

View File

@ -28,7 +28,11 @@ for url in ${urls}; do
elif [[ ${url} =~ '(//|\.)(pastebin\.|paste\.centos\.org)' ]] && \
[[ ! ${url} =~ '/raw/' ]]; then
local host=${${(@s:/:)url}[2]}
url="https://${host}/view/raw/${id}"
if [[ ${${(@s:/:)url}[3]} == "view" ]]; then
url="https://${host}/view/raw/${id}"
else
url="https://${host}/raw/${id}"
fi
elif [[ ${url} =~ 'irccloud\.com' && ! ${url} =~ '/raw/' ]]; then
id=${${(@s:/:)url}[4]}
url="https://www.irccloud.com/pastebin/raw/${id}"

View File

@ -29,7 +29,7 @@ local -A assignments=(
'^(gemini|gopher)://' "kristall"
'\.(log|txt)$' "readwwwlog"
'^https?://(www\.)?(dpaste|irccloud)\.com/' "readwwwlog"
'^https?://(www\.)?pastebin\.[^/]+/view/' "readwwwlog"
'^https?://(www\.)?pastebin\.[^/]+/' "readwwwlog"
'^https?://bpa\.st/' "readwwwlog"
'^https?://sprunge\.us/' "readwwwlog"
'^https?://paste\.debian\.net/' "readwwwlog"