diff --git a/.config/zsh/functions/readwwwlog b/.config/zsh/functions/readwwwlog index d6debff..002d0df 100755 --- a/.config/zsh/functions/readwwwlog +++ b/.config/zsh/functions/readwwwlog @@ -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}" diff --git a/.local/bin/urlhandler b/.local/bin/urlhandler index 7469e3e..730d3c2 100755 --- a/.local/bin/urlhandler +++ b/.local/bin/urlhandler @@ -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"