aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-23 00:40:41 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-23 00:40:41 +1200
commit4af6360e47b5b65a708080b2cae0dac9336e9107 (patch)
treef89e6e5f2cd640e5e0840c621c54c9a37bc98035
parent494e12ccda174cfbd305d8f4c0e5abff8bfe8577 (diff)
downloaddotfiles-4af6360e47b5b65a708080b2cae0dac9336e9107.tar.gz
dotfiles-4af6360e47b5b65a708080b2cae0dac9336e9107.zip
Extract actual media from GitHub/Imgur links
-rwxr-xr-xbin/xgo6
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/xgo b/bin/xgo
index 6bb48af6..8329c511 100755
--- a/bin/xgo
+++ b/bin/xgo
@@ -15,6 +15,12 @@ for url ; do (
*[/.]youtube.com/watch*)
mpv -- "$url" && exit
;;
+ https://github.com/*/blob/*)
+ url=$(printf '%s\n' "$url" | sed 's_/blob/_/raw/_')
+ ;;
+ *://imgur.com/*)
+ url=$(printf '%s\n' "$url" | sed 's_imgur\.com_i.imgur.com_;s/$/.jpg/')
+ ;;
esac
# Get the MIME type data