mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Small bug fixes
This commit is contained in:
parent
cb1c74be06
commit
508a00aacf
@ -52,8 +52,7 @@ browser="$TRUEBROWSER"
|
|||||||
## Templates
|
## Templates
|
||||||
# Images
|
# Images
|
||||||
imgFiles="png apng jpg jpeg jpe bmp tiff"
|
imgFiles="png apng jpg jpeg jpe bmp tiff"
|
||||||
imgSites="i.imgur.com/
|
imgSites="i.redd.it/
|
||||||
\|i.redd.it/
|
|
||||||
\|deviantart.com/
|
\|deviantart.com/
|
||||||
\|tinypic.com/
|
\|tinypic.com/
|
||||||
\|unsplash.com/photos/
|
\|unsplash.com/photos/
|
||||||
@ -69,6 +68,7 @@ gifSites="gfycat.com/
|
|||||||
\|gifbin.com/
|
\|gifbin.com/
|
||||||
\|clips.twitch.tv/
|
\|clips.twitch.tv/
|
||||||
\|streamable.com/
|
\|streamable.com/
|
||||||
|
\|streamja.com/
|
||||||
"
|
"
|
||||||
|
|
||||||
# Video
|
# Video
|
||||||
@ -76,6 +76,8 @@ vidFiles="mkv mp4 mov mpv flv avi"
|
|||||||
vidSites="youtube.com/watch
|
vidSites="youtube.com/watch
|
||||||
\|youtube.com/embed/
|
\|youtube.com/embed/
|
||||||
\|youtube.com/video/
|
\|youtube.com/video/
|
||||||
|
\|youtube.com/playlist
|
||||||
|
\|youtube.com/attribution_link
|
||||||
\|youtu.be/
|
\|youtu.be/
|
||||||
\|hooktube.com/
|
\|hooktube.com/
|
||||||
\|bitchute.com/
|
\|bitchute.com/
|
||||||
@ -183,19 +185,20 @@ imgurQueue() {
|
|||||||
|
|
||||||
for link; do
|
for link; do
|
||||||
[[ -n $indirectLink ]] && printMessage "Link: $link"
|
[[ -n $indirectLink ]] && printMessage "Link: $link"
|
||||||
[[ $link =~ \?.+$ ]] && link="${link%\?*}"
|
[[ $link =~ \?.+$ ]] && link="${link%%\?*}"
|
||||||
|
|
||||||
# Gif
|
# Gif
|
||||||
if [[ "${link##*.}" =~ ^(gif|gifv|mov|mp4)$ ]]; then
|
if [[ ${link##*.} =~ ^(gif|gifv|mp4)$ ]]; then
|
||||||
printMessage "Link type: Gif"
|
printMessage "Link type: Gif"
|
||||||
[[ -n $indirectLink ]] && printMessage
|
[[ -n $indirectLink ]] && printMessage
|
||||||
gifQueue+=( "${link%.*}.mp4" )
|
gifQueue+=( "${link%.*}.mp4" )
|
||||||
|
|
||||||
# Image
|
# Image
|
||||||
elif [[ "${link##*.}" =~ ^(jpg|jpeg|png|apng|tiff)$ ]]; then
|
elif [[ ${link##*.} =~ ^(jpg|jpeg|png)$ ]]; then
|
||||||
printMessage "Link type: Image"
|
printMessage "Link type: Image"
|
||||||
[[ -n $indirectLink ]] && printMessage
|
[[ -n $indirectLink ]] && printMessage
|
||||||
imgQueue+=( "$link" )
|
[[ $link == *_d.$BASH_REMATCH ]] && link="${link%_d*}.$BASH_REMATCH"
|
||||||
|
imgQueue+=( "${link%.*}.png" )
|
||||||
|
|
||||||
# Indirect link
|
# Indirect link
|
||||||
else
|
else
|
||||||
@ -211,14 +214,14 @@ imgurCheck() {
|
|||||||
for link; do
|
for link; do
|
||||||
# Album
|
# Album
|
||||||
if imgurReply="$(imgurReq album "$link")" &&
|
if imgurReply="$(imgurReq album "$link")" &&
|
||||||
[[ $(echo "$imgurReply" | jq -j '.status') = 200 ]]; then
|
[[ $(echo "$imgurReply" | jq -j '.status') -eq 200 ]]; then
|
||||||
printMessage "Imgur link type: Album\n"
|
printMessage "Imgur link type: Album\n"
|
||||||
imgurLinks="$(echo "$imgurReply" | jq -r '.data.images[].link')"
|
imgurLinks="$(echo "$imgurReply" | jq -r '.data.images[].link')"
|
||||||
imgurQueue -i $imgurLinks
|
imgurQueue -i $imgurLinks
|
||||||
|
|
||||||
# Single image/gif
|
# Single image/gif
|
||||||
elif imgurReply="$(imgurReq image "$link")" &&
|
elif imgurReply="$(imgurReq image "$link")" &&
|
||||||
[[ $(echo "$imgurReply" | jq -j '.status') = 200 ]]; then
|
[[ $(echo "$imgurReply" | jq -j '.status') -eq 200 ]]; then
|
||||||
printMessage "Imgur link type: Single image/gif\n"
|
printMessage "Imgur link type: Single image/gif\n"
|
||||||
imgurLinks="$(echo "$imgurReply" | jq -r '.data.link')"
|
imgurLinks="$(echo "$imgurReply" | jq -r '.data.link')"
|
||||||
imgurQueue -i $imgurLinks
|
imgurQueue -i $imgurLinks
|
||||||
@ -232,7 +235,7 @@ imgurCheck() {
|
|||||||
|
|
||||||
|
|
||||||
## Flags
|
## Flags
|
||||||
[[ $# = 0 ]] && { ${browser:-usage}; exit 0; }
|
[[ $# -eq 0 ]] && { ${browser:-usage}; exit 0; }
|
||||||
checkDep getopt &&
|
checkDep getopt &&
|
||||||
eval set -- $(getopt -o "h,d,v" -l "help,detect,verbose" \
|
eval set -- $(getopt -o "h,d,v" -l "help,detect,verbose" \
|
||||||
-n "$(basename "$0")" -- "$@")
|
-n "$(basename "$0")" -- "$@")
|
||||||
@ -259,6 +262,7 @@ done
|
|||||||
|
|
||||||
## Parse links
|
## Parse links
|
||||||
for arg; do
|
for arg; do
|
||||||
|
[[ $arg =~ /$ ]] && arg="${arg%/}"
|
||||||
printMessage "Link: $arg"
|
printMessage "Link: $arg"
|
||||||
printNewline="true"
|
printNewline="true"
|
||||||
ext="${arg##*.}"
|
ext="${arg##*.}"
|
||||||
@ -295,32 +299,32 @@ for arg; do
|
|||||||
grep -Po "(?<=location.href=').+.pdf")" &disown
|
grep -Po "(?<=location.href=').+.pdf")" &disown
|
||||||
|
|
||||||
# Gif
|
# Gif
|
||||||
elif echo "$arg" | grep -q "$gifSites" ||
|
elif echo "$arg" | grep -qi "$gifSites" ||
|
||||||
echo "$gifFiles" | grep -q "${ext%%\?*}"; then
|
echo "$gifFiles" | grep -qi "${ext%%\?*}"; then
|
||||||
printMessage "Link type: Gif"
|
printMessage "Link type: Gif"
|
||||||
gifQueue+=( "$arg" )
|
gifQueue+=( "$arg" )
|
||||||
|
|
||||||
# Image
|
# Image
|
||||||
elif echo "$arg" | grep -q "$imgSites" ||
|
elif echo "$arg" | grep -qi "$imgSites" ||
|
||||||
echo "$imgFiles" | grep -q "${ext%%\?*}"; then
|
echo "$imgFiles" | grep -qi "${ext%%\?*}"; then
|
||||||
printMessage "Link type: Image"
|
printMessage "Link type: Image"
|
||||||
imgQueue+=( "$arg" )
|
imgQueue+=( "$arg" )
|
||||||
|
|
||||||
# Video
|
# Video
|
||||||
elif echo "$arg" | grep -q "$vidSites" ||
|
elif echo "$arg" | grep -qi "$vidSites" ||
|
||||||
echo "$vidFiles" | grep -q "${ext%%\?*}"; then
|
echo "$vidFiles" | grep -qi "${ext%%\?*}"; then
|
||||||
printMessage "Link type: Video"
|
printMessage "Link type: Video"
|
||||||
vidQueue+=( "$arg" )
|
vidQueue+=( "$arg" )
|
||||||
|
|
||||||
# Download
|
# Download
|
||||||
elif echo "$arg" | grep -q "$dwnSites" ||
|
elif echo "$arg" | grep -qi "$dwnSites" ||
|
||||||
echo "$dwnFiles" | grep -q "${ext%%\?*}"; then
|
echo "$dwnFiles" | grep -qi "${ext%%\?*}"; then
|
||||||
printMessage "Link type: Download"
|
printMessage "Link type: Download"
|
||||||
dwnQueue+=( "$arg" )
|
dwnQueue+=( "$arg" )
|
||||||
|
|
||||||
# Browser
|
# Browser
|
||||||
elif echo "$arg" | grep -q "$brwSites" ||
|
elif echo "$arg" | grep -qi "$brwSites" ||
|
||||||
echo "$brwFiles" | grep -q "${ext%%\?*}" ||
|
echo "$brwFiles" | grep -qi "${ext%%\?*}" ||
|
||||||
[[ -z $detect ]]; then
|
[[ -z $detect ]]; then
|
||||||
printMessage "Link type: Browser"
|
printMessage "Link type: Browser"
|
||||||
brwQueue+=( "$arg" )
|
brwQueue+=( "$arg" )
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user